From f0d2b92f8b7377678231bec502c0f05b26b3a58e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Thu, 31 Dec 2020 13:24:32 +0000 Subject: [PATCH] Protect elisp-flymake-checkdoc against boundless diagnostics 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0e515530852..9fbfe03fb63 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -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 -- 2.39.5