diff options
| author | Lars Ingebrigtsen | 2021-01-29 07:04:43 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-29 07:04:47 +0100 |
| commit | 0b80935d37f4a089ee7e925e246622dcd4b1addb (patch) | |
| tree | 6454d365c44b44c993359c7090981a945d05d723 | |
| parent | 5f650422e4a4c44ffc5ee0be4ec969765a307c7b (diff) | |
| download | emacs-0b80935d37f4a089ee7e925e246622dcd4b1addb.tar.gz emacs-0b80935d37f4a089ee7e925e246622dcd4b1addb.zip | |
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).
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 76638ec13b1..9722792a5a5 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." | |||
| 2362 | (checkdoc-create-error | 2362 | (checkdoc-create-error |
| 2363 | (format "The footer should be: (provide '%s)\\n;;; %s%s ends here" | 2363 | (format "The footer should be: (provide '%s)\\n;;; %s%s ends here" |
| 2364 | fn fn fe) | 2364 | fn fn fe) |
| 2365 | (1- (point-max)) (point-max))))) | 2365 | ;; The buffer may be empty. |
| 2366 | (max (point-min) (1- (point-max))) | ||
| 2367 | (point-max))))) | ||
| 2366 | err)) | 2368 | err)) |
| 2367 | ;; The below checks will not return errors if the user says NO | 2369 | ;; The below checks will not return errors if the user says NO |
| 2368 | 2370 | ||