fix(emacs-lisp): non-package-mode: only enable in elisp buffers

This prevents +emacs-lisp-non-package-mode from being activated in
non-elisp buffers.

Amend: #7341
Close: #7645
Co-authored-by: PatrickNorton <PatrickNorton@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2024-02-02 18:47:15 -05:00
parent 180ffd3fa8
commit ffd2654aa3
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 17 additions and 11 deletions

View file

@ -95,10 +95,11 @@ See `+emacs-lisp-non-package-mode' for details.")
;; Ensure straight sees modifications to installed packages
#'+emacs-lisp-init-straight-maybe-h)
;; UX: Both Flycheck's and Flymake's two
;; emacs-lisp checkers produce a *lot* of false positives in non-packages
;; (like Emacs configs or elisp scripts), so I disable `checkdoc' (`emacs-lisp-checkdoc', `elisp-flymake-checkdoc')
;; and set `byte-compile-warnings' to a subset that makes more sense (see `+emacs-lisp-linter-warnings')
;; UX: Both Flycheck's and Flymake's two emacs-lisp checkers produce a *lot*
;; of false positives in non-packages (like Emacs configs or elisp
;; scripts), so I disable `checkdoc' (`emacs-lisp-checkdoc',
;; `elisp-flymake-checkdoc') and set `byte-compile-warnings' to a subset
;; that makes more sense (see `+emacs-lisp-linter-warnings')
(add-hook! '(flycheck-mode-hook flymake-mode-hook) #'+emacs-lisp-non-package-mode)
(defadvice! +syntax--fix-elisp-flymake-load-path (orig-fn &rest args)