all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Branham <alex.branham@gmail.com>
To: Andrew Hyatt <ahyatt@gmail.com>
Cc: 5126@debbugs.gnu.org, Kevin Ryde <user42@zip.com.au>
Subject: bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error
Date: Fri, 16 Aug 2019 14:14:08 -0500	[thread overview]
Message-ID: <87sgq0ly7z.fsf@gmail.com> (raw)
In-Reply-To: <m2eg73x7pc.fsf@Andrews-MacBook-Pro.local> (Andrew Hyatt's message of "Sat, 09 Jul 2016 09:27:27 -0400")

On Sat 09 Jul 2016 at 09:27, Andrew Hyatt <ahyatt@gmail.com> wrote:

> This still is the case in Emacs 25. I agree that this seems like a
> problem.
>
> Kevin Ryde <user42@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





  reply	other threads:[~2019-08-16 19:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 22:44 bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error Kevin Ryde
2016-07-09 13:27 ` Andrew Hyatt
2019-08-16 19:14   ` Alex Branham [this message]
2019-08-20 17:21     ` Andrew Hyatt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgq0ly7z.fsf@gmail.com \
    --to=alex.branham@gmail.com \
    --cc=5126@debbugs.gnu.org \
    --cc=ahyatt@gmail.com \
    --cc=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.