]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix position in empty buffers in checkdoc-file-comments-engine
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 29 Jan 2021 06:04:43 +0000 (07:04 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 29 Jan 2021 06:04:47 +0000 (07:04 +0100)
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Don't give invalid positions on empty buffers (bug#39987).

lisp/emacs-lisp/checkdoc.el

index 76638ec13b1a0c2ac431cffcb91b966ecd830b24..9722792a5a501fafc4487bddade860838ab1b392 100644 (file)
@@ -2362,7 +2362,9 @@ Code:, and others referenced in the style guide."
                (checkdoc-create-error
                 (format "The footer should be: (provide '%s)\\n;;; %s%s ends here"
                         fn fn fe)
-                (1- (point-max)) (point-max)))))
+                 ;; The buffer may be empty.
+                (max (point-min) (1- (point-max)))
+                 (point-max)))))
        err))
       ;; The below checks will not return errors if the user says NO