Commit Graph

132 Commits

Author SHA1 Message Date
Henrik Lissner
a999a0ddd6
General refactors & comment revision 2019-12-19 14:51:34 -05:00
Henrik Lissner
cdf4604288
Reduce file cache timeout from 7 days to 1
Also:
- Reorder projectile variables.
- Remove unused projectile-sort-order (since ripgrep is a hard
  dependency of Doom now, there should be no situation where we
  projectile-sort-order is important to us as a default).
2019-12-13 20:07:41 -05:00
Henrik Lissner
078e563355
Prevent duplicates in projectile file lists
Projectile has `projectile-git-command` and
`projectile-git-submodule-command`. By default, these use `git ls-files`
and `git submodule foreach 'echo $path'`, respectively. It uses them
together to index a full list of project files.

Since we've changed `projectile-git-command` to use `fd` or `ripgrep`,
which indexes submodules just fine (unlike git ls-files), you get
duplicates when projectile does a second pass with
`projectile-git-submodule-command`, so we unset it completely.
2019-12-13 17:28:33 -05:00
Henrik Lissner
f959147218
Reset projectile-use-git-grep
Other search engines are no longer our responsibility.
2019-11-28 15:36:07 -05:00
Henrik Lissner
fb13b902b0
Minor comment/doc revision & refactors 2019-11-21 14:46:45 -05:00
Henrik Lissner
263c82def1
Remove references to old ivy/helm search commands
And consolidate ex commands into :pg[rep][!] and :pg[rep]d[!].
2019-11-18 15:06:11 -05:00
Henrik Lissner
2a6b1a1fb6
Unset projectile-git-submodule-command if tr is unavailable
Otherwise windows users can't use projectile in projects with
submodules.
2019-10-29 11:36:46 -04:00
Henrik Lissner
8cedbc3b5d
Prioritize fdfind over fd #1931
Since fd is used by another program on Ubuntu.
2019-10-22 12:40:30 -04:00
Henrik Lissner
7cbd6c756c
Remove projectile-add-known-project autoload
Merged upstream in bbatsov/projectile#1457
2019-10-20 10:58:53 -04:00
Henrik Lissner
9b25582be1
Reduce list of root files projectile searches for
And define them on a per-module basis. This reduces the number of file
checks it performs, particularly for non-project files.

Might help #1317
2019-10-19 22:22:49 -04:00
Rudi Grinberg
78f808d31e Fix uses of projectile-locate-dominating-file
This function isn't autoloaded so we should include it in the list of
commands like some other projectile functions.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-10-13 11:37:06 +09:00
Henrik Lissner
4cafaec527
Disable projectile-grep for +{ivy,helm}/grep 2019-10-10 16:11:41 -04:00
Henrik Lissner
d297dc6934
Minor refactor & comment revision across the board 2019-10-03 23:33:59 -04:00
Henrik Lissner
29055ae6a3
Disable projectile-{ag,ripgrep}
Emit warnings for commands that won't work, as is, and that Doom
already provides a better alternative for.
2019-09-06 14:17:34 -04:00
Henrik Lissner
4b736bef68
Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
Henrik Lissner
d1a299b9f5
Fix #1719: sole :when in def-project-mode! 2019-08-29 20:05:34 -04:00
Henrik Lissner
851b51357e
Fix #1712, #1719: project minor modes not activating 2019-08-28 15:17:40 -04:00
Henrik Lissner
205bf453de
Fix void-function doom--resolve-path-forms error
By using project-file-exists-p! macro instead.
2019-08-23 01:56:43 -04:00
Henrik Lissner
baafa0f635
Fix #1617: fd is used despite being absent 2019-07-29 15:05:26 +02:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
Henrik Lissner
e0fe2a85d1
Ensure doom-projectile-fd-binary is never nil 2019-07-24 17:09:51 +02:00
Henrik Lissner
82ae3a73f3
def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
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