]> git.eshelyaron.com Git - emacs.git/commitdiff
Protect elisp-flymake-checkdoc against boundless diagnostics
authorJoão Távora <joaotavora@gmail.com>
Thu, 31 Dec 2020 13:24:32 +0000 (13:24 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 31 Dec 2020 14:03:53 +0000 (14:03 +0000)
These would be the kind of "This file needs a ;;Code section" and
such.

* lisp/progmodes/elisp-mode.el (elisp-flymake-checkdoc): Resist
checkdoc diagnostics with no end position.

lisp/progmodes/elisp-mode.el

index 0e5155308528c64a52c953e0016437dc2132fc1e..9fbfe03fb63caf6a5dc710e2f2e68d01160c200a 100644 (file)
@@ -1720,7 +1720,8 @@ Calls REPORT-FN directly."
                       collect
                       (flymake-make-diagnostic
                        (current-buffer)
-                       start end :note text)))
+                       (or start 1) (or end (1+ (or start 1)))
+                       :note text)))
     collected))
 
 (defun elisp-flymake--byte-compile-done (report-fn