Commit graph

185 commits

Author SHA1 Message Date
Álan Crístoffer
b636d9e793
fix: strip './' from projectile file list produced by fd
Fix: #6504
Ref: bbatsov/projectile#1784
2022-07-23 15:57:23 +02:00
Henrik Lissner
14b2395424
refactor: remove unused core variables
doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.

And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.

Also done to reduce Doom's footprint, in general.
2022-06-29 18:14:20 +02:00
Henrik Lissner
4c97de4163
refactor: remove custom projectile-mode-line-function
projectile guards its projectile-update-mode-line calls with
file-remote-p checks, so this is redundant.

Ref: 4d6da873ae/projectile.el (L5791-L5793)
2022-06-18 16:57:17 +02:00
Henrik Lissner
f5c1332a31 refactor: minor refactors & nit picks across core 2021-10-10 18:36:46 +02:00
Henrik Lissner
2c4328ccf0 fix: flipped logic in tramp + projectile advice
Some logic derps from 0b5243c. Also restores
projectile-git-submodule-command in remote buffers (to fix a
wrong-type-argument error waiting to happen).

Ref 0b5243c12c
Ref #5360
2021-08-10 17:32:34 -04:00
Henrik Lissner
0b5243c12c perf: optimize tramp + projectile integration
Reduce how much projectile hits the server in TRAMP buffers by:

- Not looking for fd/fdfind (just use the VCS-specific commands
  projectile provides and assume they're present on the remote).
- Not walking up the directory tree to display the project name in the
  mode line.
- Reducing TRAMP file-cache misses.
- Reducing how chatty tramp is about its connections.

Fix #5360
2021-08-10 17:10:42 -04:00
Henrik Lissner
1352f8a9aa fix: args-out-of-range when cleaning project cache
Caused when the key of a cached project is an empty string.

Fix #5345
2021-08-06 03:13:36 -04:00
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Henrik Lissner
e5b52e2a50 Remove "fix" for projectile + $HOME git repos
There are legitimate reasons why a user would want to treat $HOME as a
project. 'doom doctor' now complains about this case in greater detail.
I'll leave it to users to deal with this edge case.
2021-05-23 22:09:07 -04:00
Henrik Lissner
0196875d9c Remove redundant projectile-ignored-projects entries
/tmp and ~/.emacs.d/.local are already covered by our
projectile-ignored-project-function (doom-project-ignored-p).
2021-05-17 23:35:55 -04:00
Henrik Lissner
c9b41205b2 Fix #4925: defining lexical variables error in 28+ 2021-04-29 13:25:48 -04:00
Henrik Lissner
f8d181a8c4 Ignore remote/temp files or packages as projects 2021-03-06 11:41:47 -05:00
Henrik Lissner
0ebd58c991 Purge ignored projects from cache/known projects
At shutdown time.
2021-03-06 11:39:54 -05:00
JerryChu
b4fbafe451 Fix path separator in msys2 2021-01-21 14:10:14 +08:00
Ho-Yon Mak
2253e7f467
Add --exclude .git to fd in projectile-generic-command 2020-12-17 22:57:17 +00:00
Henrik Lissner
742ff5629c
Create different compilation buffers per-project 2020-11-27 22:22:11 -05:00
Henrik Lissner
db66b8af31
Omit .git from projectile-find-file & ocunsel-file-jump 2020-11-16 20:10:26 -05:00
Henrik Lissner
7ec623593e
Fix magit in remote repos
And backport executable-find from Emacs 27.1 so we don't have to do
these version checks every time we use it.
2020-11-02 14:43:12 -05:00
Henrik Lissner
f7b786f72e
Reduce projectile cache limit
fd/ripgrep are pretty fast, so be a little more aggressive when cleaning
up the projectile cache.
2020-08-01 15:19:59 -04:00
Henrik Lissner
d597663d63
Discover projects on switch-project
Rather than when projectile-mode is started up.

Also clean up 404'ed projects on quit.
2020-07-31 16:01:55 -04:00
Henrik Lissner
c3ac295f7d
Remove Icon^M from projectile-globally-ignored-files
Can break file indexing over TRAMP.
2020-07-31 16:01:16 -04:00
Henrik Lissner
351e7036d9
doom-cleanup-project-cache-h: do nothing if caching is disabled 2020-07-31 16:00:52 -04:00
Henrik Lissner
da1030985d
Minor refactors & reformatting 2020-07-23 01:26:03 -04:00
Henrik Lissner
4205f1bbea
Fix #3591: wrong-type-arg stringp from projectile 2020-07-19 16:45:45 -04:00
Henrik Lissner
523e945a3a
Fix #3215: ripgrep reporting error code 2 on Windows
Closes #3512
2020-07-17 19:24:26 -04:00
Henrik Lissner
00ebbafb96
Fix #3455: wrong-number-of-args on executable-find call
executable-find's second argument was added in Emacs 27, so 26 users
would suffer this error.

Closes #3460
2020-06-25 15:27:26 -04:00
Henrik Lissner
d034bc2004
Fix #3425: eagerly resolve path to fd executable
This ensures that the correct binary is found, even if you're remoting
onto a system where `fd` is named `fdfind`.
2020-06-24 19:49:08 -04:00
Saál Germán Gutiérrez Calderón
3c7b64c5b0 Enable projectile-locate-dominating-file on tramp 2020-06-22 11:37:11 -05:00
Henrik Lissner
4e193dbbd3
Bump :core
raxod502/straight.el@09cfa1b -> raxod502/straight.el@ffaad60
bbatsov/projectile@7e552b6 -> bbatsov/projectile@95bcc7d
2020-06-17 14:34:52 -04:00
Henrik Lissner
67c5de0313
Change :around advice to :override 2020-06-13 17:13:38 -04:00
Henrik Lissner
10f5916298
Only use projectile-generic-command
Rather than the 7 different commands for indexing the project's files.

This also fixes an issue with #3377, where changes to
`projectile-globally-ignored-directories` weren't seen unless they were
done at startup, before projectile loads.
2020-06-13 17:01:09 -04:00
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