diff options
| author | Eli Zaretskii | 2019-10-21 14:29:13 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-10-21 14:29:13 +0300 |
| commit | 61fb5214816ef3d57e676d900e499ffcd079a1f9 (patch) | |
| tree | 6cc4befd396eef08dd835e41aee2d3460aafd64d | |
| parent | 03921902b2a07909e7f36e6c8fb259eff4bad982 (diff) | |
| download | emacs-61fb5214816ef3d57e676d900e499ffcd079a1f9.tar.gz emacs-61fb5214816ef3d57e676d900e499ffcd079a1f9.zip | |
Avoid false indications from Flymake in .dir-locals.el files
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Don't install
'elisp-flymake-checkdoc' and 'elisp-flymake-byte-compile'
hooks for .dir-locals.el files. Reported by Clément
Pit-Claudel <cpitclaudel@gmail.com>.
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 516e4f9cd63..7705761365c 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el | |||
| @@ -256,8 +256,20 @@ Blank lines separate paragraphs. Semicolons start comments. | |||
| 256 | (setq-local project-vc-external-roots-function #'elisp-load-path-roots) | 256 | (setq-local project-vc-external-roots-function #'elisp-load-path-roots) |
| 257 | (add-hook 'completion-at-point-functions | 257 | (add-hook 'completion-at-point-functions |
| 258 | #'elisp-completion-at-point nil 'local) | 258 | #'elisp-completion-at-point nil 'local) |
| 259 | (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t) | 259 | ;; .dir-locals.el and lock files will cause the byte-compiler and |
| 260 | (add-hook 'flymake-diagnostic-functions #'elisp-flymake-byte-compile nil t)) | 260 | ;; checkdoc emit spurious warnings, because they don't follow the |
| 261 | ;; conventions of Emacs Lisp sources. Until we have a better fix, | ||
| 262 | ;; like teaching elisp-mode about files that only hold data | ||
| 263 | ;; structures, we disable the ELisp Flymake backend for these files. | ||
| 264 | (unless | ||
| 265 | (let* ((bfname (buffer-file-name)) | ||
| 266 | (fname (and (stringp bfname) (file-name-nondirectory bfname)))) | ||
| 267 | (or (not (stringp fname)) | ||
| 268 | (string-match "\\`\\.#" fname) | ||
| 269 | (string-equal dir-locals-file fname))) | ||
| 270 | (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t) | ||
| 271 | (add-hook 'flymake-diagnostic-functions | ||
| 272 | #'elisp-flymake-byte-compile nil t))) | ||
| 261 | 273 | ||
| 262 | ;; Font-locking support. | 274 | ;; Font-locking support. |
| 263 | 275 | ||