lang/emacs-lisp: restore flycheck in elisp buffers

However, with `emacs-lisp-checkdoc` disabled and `emacs-lisp`
significantly gimped.

byte-compile-warnings may need to be adjusted to allow for *some*
warnings.

Also, reformat emacs-lisp-mode hooks
This commit is contained in:
Henrik Lissner 2019-05-02 20:42:43 -04:00
parent ee7ff68ae4
commit 25beb4bcfd
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 24 additions and 7 deletions

View file

@ -122,12 +122,27 @@ if it's callable, `apropos' otherwise."
("Types" "^\\s-*(\\(cl-def\\(?:struct\\|type\\)\\|def\\(?:class\\|face\\|group\\|ine-\\(?:condition\\|error\\|widget\\)\\|package\\|struct\\|t\\(?:\\(?:hem\\|yp\\)e\\)\\)\\)\\s-+'?\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)" 2))))
;;;###autoload
(defun +emacs-lisp|disable-flycheck-maybe ()
"Disable flycheck-mode if in emacs.d."
(defun +emacs-lisp|reduce-flycheck-errors-in-emacs-config ()
"Remove `emacs-lisp-checkdoc' checker and reduce `emacs-lisp' checker
verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
(when (and (bound-and-true-p flycheck-mode)
(eq major-mode 'emacs-lisp-mode)
(or (not buffer-file-name)
(cl-loop for dir in (list doom-emacs-dir doom-private-dir)
if (file-in-directory-p buffer-file-name dir)
return t)))
(flycheck-mode -1)))
(add-to-list (make-local-variable 'flycheck-disabled-checkers)
'emacs-lisp-checkdoc)
(set (make-local-variable 'flycheck-emacs-lisp-check-form)
(concat "(progn "
(prin1-to-string
`(progn
(load ,user-init-file t t)
(defmacro map! (&rest _))
(setq byte-compile-warnings
'(obsolete cl-functions
interactive-only make-local mapcar
suspicious constants))))
" "
(default-value 'flycheck-emacs-lisp-check-form)
")"))))