emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0b80935 3/3: Fix position in empty buffers in checkdoc-file-comme


From: Lars Ingebrigtsen
Subject: master 0b80935 3/3: Fix position in empty buffers in checkdoc-file-comments-engine
Date: Fri, 29 Jan 2021 01:04:57 -0500 (EST)

branch: master
commit 0b80935d37f4a089ee7e925e246622dcd4b1addb
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix position in empty buffers in checkdoc-file-comments-engine
    
    * lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
    Don't give invalid positions on empty buffers (bug#39987).
---
 lisp/emacs-lisp/checkdoc.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 76638ec..9722792 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]