GNU bug report logs -
#5126
23.1; checkdoc-comment-style-hooks stops at first error
Previous Next
Reported by: Kevin Ryde <user42 <at> zip.com.au>
Date: Fri, 4 Dec 2009 22:50:10 UTC
Severity: normal
Tags: notabug
Done: Andrew Hyatt <ahyatt <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 5126 <at> debbugs.gnu.org (full text, mbox):
On Sat 09 Jul 2016 at 09:27, Andrew Hyatt <ahyatt <at> gmail.com> wrote:
> This still is the case in Emacs 25. I agree that this seems like a
> problem.
>
> Kevin Ryde <user42 <at> zip.com.au> writes:
>
>> checkdoc-comment-style-hooks is run by checkdoc-file-comments-engine
>> with run-hook-with-args-until-success, which means if one of the hook
>> functions returns an error string (as described in the hook's docstring)
>> then no further functions are run.
Maybe I'm misunderstanding this bug report, but this works for me:
;; foobar
(defun my/checkdoc-comments-foobar ()
"Check if foobar is in a comment."
(save-excursion
(goto-char (point-min))
(unless (re-search-forward "^;; foobar" nil t)
(checkdoc-create-error
";; foobar doesn't exist"
(1- (point-max)) (point-max)))))
(defun my/checkdoc-comments-foobaz ()
"Check if foobaz is in a comment."
(save-excursion
(goto-char (point-min))
(unless (re-search-forward "^;; foobaz" nil t)
(checkdoc-create-error
";; foobaz doesn't exist"
(1- (point-max)) (point-max)))))
(add-hook 'checkdoc-comment-style-functions #'my/checkdoc-comments-foobar)
(add-hook 'checkdoc-comment-style-functions #'my/checkdoc-comments-foobaz)
Now checkdoc warns that foobaz is missing. You can change foobar to
foobaz and it warns that foobar is missing. Can we close this bug report?
Alex
This bug report was last modified 5 years and 302 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.