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).
This commit is contained in:
parent
22cc519ac1
commit
d6aa19b638
1 changed files with 11 additions and 0 deletions
|
@ -46,6 +46,17 @@ Emacs.")
|
|||
(push ".project" projectile-project-root-files-bottom-up)
|
||||
(push (abbreviate-file-name doom-local-dir) projectile-globally-ignored-directories)
|
||||
|
||||
(defun doom*projectile-default-generic-command (orig-fn &rest args)
|
||||
"If projectile can't tell what kind of project you're in, it issues an error
|
||||
when using many of projectile's command, e.g. `projectile-compile-command',
|
||||
`projectile-run-project', `projectile-test-project', and
|
||||
`projectile-configure-project', for instance.
|
||||
|
||||
This suppresses the error so these commands will still run, but prompt you for
|
||||
the command instead."
|
||||
(ignore-errors (apply orig-fn args)))
|
||||
(advice-add #'projectile-default-generic-command :around #'doom*projectile-default-generic-command)
|
||||
|
||||
;; Accidentally indexing big directories like $HOME or / will massively bloat
|
||||
;; projectile's cache (into the hundreds of MBs). This purges those entries
|
||||
;; when exiting Emacs to prevent slowdowns/freezing when cache files are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue