Commit graph

154 commits

Author SHA1 Message Date
wedens
79f62a6d3e make fd respect projectile-globally-ignored-directories 2020-06-13 23:31:12 +07:00
Henrik Lissner
f548ab600c
Fix #2351: counsel-rg errors on Windows 2020-06-05 00:43:51 -04:00
Henrik Lissner
60ca118eb2
Fix #3166 and #3288: over-eager project-root caching
And prevent explicit projectile-project-root interfering with project
switching.
2020-06-04 19:43:20 -04:00
Henrik Lissner
2d4b946e03
Clear project-root cache before switching project
Fixes #3205
May address #3166
2020-06-01 18:16:26 -04:00
Henrik Lissner
3a38fc633c
Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
Henrik Lissner
49bf79a380
Restore .projectile recognition
Why it was removed in the first place: hlissner/doom-emacs#1974

Why it's being restored: seems this causes too much confusion. Folks ask
why projectile doesn't recognize their projects. It's too much of
maintenance hassle. We'll deal with the breaking changes project.el will
introduce when we cross that bridge.

Closes #3074
2020-05-19 01:56:56 -04:00
Henrik Lissner
0e851ace9b
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.

Fixes #2802, #2737, #2386

The big highlights are:

- Fix #2802: We now update recipe repos *before* updating/installing any
  new packages. No more "Could not find package X in recipe repositories".

- Fix #2737: An edge case where straight couldn't reach a pinned
  commit (particularly with agda).

- Doom is now smarter about what option it recommends when straight
  prompts you to make a choice.

- Introduces a new init path for Doom. The old way:
  - Launch in "minimal" CLI mode in non-interactive sessions
  - Launch a "full" interactive mode otherwise.
  The new way
  - Launch in "minimal" CLI mode *only* for bin/doom
  - Launch is a simple mode for non-interactive sessions that still need
    access to your interactive config (like async org export/babel).
  - Launch a "full" interactive mode otherwise.

  This should fix compatibility issues with plugins that use the
  async.el library or spawn child Emacs processes to fake
  parallelization (like org's async export and babel functionality).

- Your private init.el is now loaded more reliably when running any
  bin/doom command. This gives you an opportunity to configure its
  settings.

- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
  deferred activation of a number of packages. Users can remove these
  modes from these hooks; altogether preventing them from loading,
  rather than waiting for them to load to then disable them,
  e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
  'doom-first-buffer #'smartparens-global-mode)

  Hooks added to doom-first-*-hook variables will be removed once they
  run.

  This should also indirectly fix #2386, by preventing interactive modes
  from running in non-interactive session.

- Added `doom/bump-*` commands to make bumping modules and packages
  easier, and `doom/bumpify-*` commands for converting package!
  statements into user/repo@sha1hash format for bump commits.

- straight.el is now commit-pinned, like all other packages. We also
  more reliably install straight.el by cloning it ourselves, rather than
  relying on its bootstrap.el.

  This should prevent infinite "straight has diverged from master"
  prompts whenever we change branches (though, you might have to put up
  with it one more after this update -- see #2937 for workaround).

All the other minor changes:

- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
  simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
  already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
  trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
  doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
  1. Child instances will no longer inherit the process environment of
     the host instance,
  2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-15 01:33:52 -04:00
chuxubank
8a70dd0379 Change path separator on Windows when using fd
Show slash instead of backslash
2020-05-14 16:07:04 +08:00
Henrik Lissner
b51c4fc8b3
Fix projectile on Windows failing to index anything with ripgrep
Due to unescaped glob arguments.

Fixes #2897, and possibly #1803
2020-05-02 17:41:36 -04:00
Henrik Lissner
ea1a1805b3
Fix projectile failing to index symlinks
Fixes cases where, if the contents of your ~/.doom.d were symlinks, fd
and ripgrep wouldn't index them (or recurse into them), so it'd miss out
of many files.

Possibly fixes #1803
2020-05-02 16:28:48 -04:00
Henrik Lissner
e832ec5708
Fix projectile ignoring symlinks
Due to the underlying program (fd) ignoring them.
2020-05-02 13:17:10 -04:00
Henrik Lissner
ae152a5924
Cache project root earlier
So users can still change it with setq-hook! or their own hooks.
2020-04-29 03:41:32 -04:00
Henrik Lissner
9acba6b269
Speed up project root detection by resolving it less often
Projectile can consume a lot of cycles, especially in indirect buffers
or because of project-root-sensitive path segments in the modeline. This
experimental fix should spare you that heartache.
2020-04-27 17:27:32 -04:00
Henrik Lissner
06d5d5e6c0
General refactors, reformatting & comment revision 2020-04-23 23:56:17 -04:00
Henrik Lissner
99c5bac359
Correct projectile comment 2020-04-11 14:51:15 -04:00
Henrik Lissner
011bbff7af
Clarify how projectile resolves project roots 2020-04-07 22:32:52 -04:00
James Ravn
68eb41faa3
Change projectile dirconfig file to .project (#2829)
* Change projectile dirconfig file to .project

So it matches the doom project marker `.project`. Otherwise you need to
create both a `.project` and then a `.projectile` with the project
configuration.

To maintain backwards compatibility, it will prefer a `.projectile` file for
dirconfig if found.
2020-04-07 17:31:44 -04:00
Henrik Lissner
50c61c57bc
Update def-project-mode! macro docstring
Remove mention of `doom-project`, since it no longer exists.
2020-02-22 20:38:34 -05:00
Henrik Lissner
f7445a10db
General refactor & reformatting across the board 2020-02-18 22:56:47 -05:00
Henrik Lissner
5bff064ba8
Reduce number of projectile project root markers
Reduce overall I/O needed to detect project roots, at the expense of
losing detection for less popular version control systems.
2019-12-22 23:53:05 -05:00
Henrik Lissner
86c2d7c10a
No longer retain projectile cache across sessions
It's unnecessary overhead. Rebuilding the index the first time it is
used per session is acceptable, imo.
2019-12-22 23:53:05 -05:00
Henrik Lissner
213a6fda86
General refactors & reformatting 2019-12-22 23:53:04 -05:00
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