fix(emacs-lisp): add elisp flymake load path advice
We set flycheck-emacs-lisp-load-path to 'inherit, which evaluates
load-path when spawning the Emacs subprocess. flymake relies on a static
variable, hence the advice. elisp-flymake-byte-compile is autoloaded by
elisp-mode, so there is little reason to condition on `:checkers syntax
+flymake`.
Ref: e56e30d8c6/flycheck.el (L8725-L8727)
Ref: https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/elisp-mode.el?h=emacs-29.1#n2166
Ref: https://emacs.stackexchange.com/questions/48661/how-do-i-get-flymake-to-recognize-files-in-my-load-path
This commit is contained in:
parent
d509d8bea1
commit
6666685993
1 changed files with 7 additions and 0 deletions
|
@ -101,6 +101,13 @@ See `+emacs-lisp-non-package-mode' for details.")
|
|||
;; original in the flycheck instance (see `+emacs-lisp-linter-warnings').
|
||||
(add-hook 'flycheck-mode-hook #'+emacs-lisp-non-package-mode)
|
||||
|
||||
(defadvice! +syntax--fix-elisp-flymake-load-path (orig-fn &rest args)
|
||||
"Set load path for elisp byte compilation Flymake backend"
|
||||
:around #'elisp-flymake-byte-compile
|
||||
(let ((elisp-flymake-byte-compile-load-path
|
||||
(append elisp-flymake-byte-compile-load-path load-path)))
|
||||
(apply orig-fn args)))
|
||||
|
||||
;; Enhance elisp syntax highlighting, by highlighting Doom-specific
|
||||
;; constructs, defined symbols, and truncating :pin's in `package!' calls.
|
||||
(font-lock-add-keywords
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue