Commit Graph

110 Commits

Author SHA1 Message Date
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
4c70cfd102
Fix hash-table-p errors loading projectile
I was reading from a file without making sure it exists!
2019-07-22 06:28:32 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
0a84d2f0a9
core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
Henrik Lissner
51d3b1b424
💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
Henrik Lissner
2ff762b397
Fix fd/rtags on debian/ubuntu
On debian/ubuntu, these executables have a different name:

- fd -> fdfind
- rc -> rtags-rc
- rdm -> rtags-rdm
2019-07-14 22:04:50 +02:00
Henrik Lissner
ed9d7feb36
projectile: persist projectile-projects-cache-time
This way, projectile caches won't expire when restarting Emacs, but
instead time + projectile-files-cache-expire seconds from the time it is
serialized.
2019-07-09 19:54:21 +02:00
Henrik Lissner
df56ea5c60
Fix projectile breakage in windows in git projects
Because projectile tries to use `tr`, which doesn't exist on windows.
2019-07-08 22:08:54 +02:00
Henrik Lissner
d6aa19b638
Suppress error from projectile-default-generic-command
Caused when using projectile-{run,test,compile,configure}-project
commands in a project that projectile cannot recognize (i.e. doesn't
match any project in projectile-project-types).
2019-06-27 17:17:04 +02:00
Henrik Lissner
129377ca5f
Remap tags commands sooner
Makes them easier for users to remap later.
2019-06-26 14:49:39 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
fd1b31667e
Index projects with ripgrep/fd on Windows 2019-06-18 14:43:15 +02:00
Henrik Lissner
f2d7c5625d
Revise comments & docstring 2019-06-18 14:43:05 +02:00
Brice Waegeneire
b29a7357c6 projectile: fd never use colors
Prevent projectile-find-file to be littered with escape codes when the
environment variable LS_COLORS is set.
2019-06-01 14:33:21 +02:00
Henrik Lissner
7443669b1e
Minor refactors & comment revision 2019-05-13 14:37:00 -04:00
Henrik Lissner
f2d267ce8b
projectile: fall back to git-grep instead of rgrep
Also changes projectile-sort-order, but this only affects the native
indexer.
2019-05-12 22:12:08 -04:00
Henrik Lissner
769cfbe5d1
projectile: resort to ripgrep if fd is absent
Speeds up file search in general, and on Windows especially.
2019-05-12 22:12:04 -04:00
Henrik Lissner
8e6953b3ac
Fix arrayp error when killing Emacs
Caused by doom|cleanup-project-cache, when a non-string key is present
in projectile-projects-cache (which will be removed).
2019-05-06 17:12:28 -04:00
Henrik Lissner
eb22177cea
Suppress kill-emacs-hook in noninteractive Doom 2019-04-24 18:16:06 -04:00
Henrik Lissner
4278eb683f
Autoload projectile-add-known-projects
This should be PRed upstream at some point
2019-04-20 19:25:10 -04:00
Henrik Lissner
f9b6f6746f
General, minor refactor/reformatting 2019-04-08 23:03:19 -04:00
Henrik Lissner
742687a51e
Add delq! and pushnew! macros
And move projectile configs to their respective modules (and out of
package configs).
2019-04-08 23:01:30 -04:00
Shanavas M
d974acfef1 Use variable for fd-find binary name 2019-04-01 12:18:12 +05:30
Henrik Lissner
c0b00327c2
Purge excess from projectile's cache
Bloated projectile caches can cause freezing and delays. This is
especially so if you accidentally index $HOME or /, which will bloat
them into the hundreds of MBs.

+ Adds purging of blacklisted, over-sized and non-projects from
  projectile's cache when Emacs is killed.
+ Projectile's project file cache will now expire after a week.
+ Corrects file paths in core/doctor's filesize checks.
2019-03-28 19:57:34 -04:00
Henrik Lissner
0085d089f3
Refactor doom*projectile-locate-dominating-file 2019-03-28 16:43:04 -04:00
Henrik Lissner
c9e3facb38
Revert bb3f027c
After more testing (along with 1ce2b291), projectile can, in fact, be
deferred until after startup.
2019-03-16 23:59:50 -04:00
Henrik Lissner
93d2a2212d
Restore projectile's :after-call
If users open Emacs with a file argument, projectile will need to load
sooner.
2019-03-15 13:30:52 -04:00
Henrik Lissner
8da2785141
Remove doom-project file/dir local var support
It didn't really work, and it's too Doom-specific to be useful. We'll
need better heuristics.
2019-03-14 17:59:24 -04:00
Henrik Lissner
bb3f027ca2
Load projectile sooner in the startup process
Projectile's use is so prolific in Doom that trying to lazy load it at
startup is wasted breath.
2019-03-14 17:59:24 -04:00
Henrik Lissner
1ce2b29193
ui/modeline: minor startup optimization
Prevents project.el from being eager-loaded at startup.
2019-03-13 18:46:06 -04:00
Henrik Lissner
df26502f01
Avoid general in core
Future proofing against changes in load order.
2019-03-10 08:12:04 -04:00
Henrik Lissner
54d1c0dd56
Minor, general refactors 2019-03-09 03:42:55 -05:00
Henrik Lissner
d46bb287ae
General refactor of Doom core
- Code reduction and refactor across the board (cull unneeded minor
  advise, hooks and hacks or update them)
- Revise outdated comments and docstrings
- Reorganize core autoload libraries
- Remove large file check (Emacs already has a built-in one, which we
  augment to be even more performant when it does kick in)
- helpful.el can now be disabled completely through package!
2019-03-02 01:34:19 -05:00
Aria Edmonds
81e8fafa18 Improve projectile-git-command
When indexing it ignores hidden files, which is especially annoying for
dotfiles where everything starts with a dot. If you just have -H it'll
index .git too though, so we exclude that
2019-01-18 19:40:09 +11:00
Henrik Lissner
f003d2b4fe
Merge pull request #1032 from mfiano/develop
Various changes
2018-12-05 18:59:42 -05:00
Aria
fe8b17d6da move projectile fd out of magit.el
lol
2018-12-04 20:09:44 +11:00
Michael Fiano
9c96a2bab7 Fix: Prevent projectile from deleting important buffers 2018-12-02 02:02:56 -05:00
Henrik Lissner
1785adb068 projectile-require-project-root = t
Now that projectile-project-root has changed not throw errors (depending
on projectile-require-project-root), it is safe to change this, in case
you use other projectile commands that do require a project.
2018-09-28 21:13:27 -04:00
Henrik Lissner
53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00
Henrik Lissner
078e3028a6 Minor, general comment revision 2018-09-28 21:02:59 -04:00
Henrik Lissner
4bdd6002a4
Restore projectile-project-root's old behavior
For now...
2018-09-27 21:55:19 -04:00
Henrik Lissner
57579b883b
Refactor doom core files 2018-09-09 09:58:20 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
d7e4901bda
Disable bottom-up root search if HOME is a project #833 2018-08-26 12:19:47 +02:00
Henrik Lissner
e348e32cbc
Fix def-project-mode! :add-hooks overwriting hooks
Would overwrite hooks previously added to the project mode.
2018-08-11 01:59:36 +02:00
Henrik Lissner
a3124f00d5
Remove redundant projectile-indexing-method setter 2018-08-01 19:26:48 +02:00
Henrik Lissner
9a2f96c0f1
Lazy load projectile (experimental)
I can feel it; the power coursing through my veins. Every millisecond
saved at startup makes me more powerful. This world will be mine. Mine I
tell you!
2018-06-16 11:42:37 +02:00
Henrik Lissner
5501b949ef
Refactor def-project-mode! with cl-defmacro 2018-06-16 11:34:19 +02:00
Henrik Lissner
b207c4040b
Minor, general refactor 2018-06-07 02:51:46 +02:00