From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error Date: Sat, 09 Jul 2016 09:27:27 -0400 Message-ID: References: <87ws12jr51.fsf@blah.blah> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468070906 22454 80.91.229.3 (9 Jul 2016 13:28:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2016 13:28:26 +0000 (UTC) Cc: 5126@debbugs.gnu.org To: Kevin Ryde Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 09 15:28:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLsIo-00085q-J9 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2016 15:28:14 +0200 Original-Received: from localhost ([::1]:50958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLsIn-0001Zl-R4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2016 09:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLsIg-0001Yd-2t for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 09:28:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLsIc-0003Fr-Sc for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 09:28:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLsIc-0003FX-On for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 09:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bLsIc-0002oQ-FX for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 09:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jul 2016 13:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5126-submit@debbugs.gnu.org id=B5126.146807085910781 (code B ref 5126); Sat, 09 Jul 2016 13:28:02 +0000 Original-Received: (at 5126) by debbugs.gnu.org; 9 Jul 2016 13:27:39 +0000 Original-Received: from localhost ([127.0.0.1]:43347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLsIE-0002no-MK for submit@debbugs.gnu.org; Sat, 09 Jul 2016 09:27:38 -0400 Original-Received: from mail-qt0-f174.google.com ([209.85.216.174]:34875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLsIB-0002nY-Uh for 5126@debbugs.gnu.org; Sat, 09 Jul 2016 09:27:37 -0400 Original-Received: by mail-qt0-f174.google.com with SMTP id f89so34066093qtd.2 for <5126@debbugs.gnu.org>; Sat, 09 Jul 2016 06:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=fvJM1mF8bPBNMqpvjugXJNVqNWf4rVj9eY/cgpkecaM=; b=UX9pyxn3vz7N4gqXTiu4A8w9L+ZxwgQHrffmk6uCNyrrJOJLmcELQdi0aHH4CZtZCd PNeQeRHJbMoj/7gJfor4d/wNOT5wnNRBEPpN9i2Ob/Bd0tO7kJ39RufnOEeBsyfvw2mt w/RkSXzmBeY7nfub6LjOO4akdGdC0NkunnkR4RqdH4tPGEGNGMxyni5b0yDfILfEQZiB KPZeN6EwfpLSJ+O8VnGUGwfG4fJNoOZCXYhFhm17/MTFy3i6UWY0Rc8IwosKRgRHtz4s qizWVMQqHI3ELXa0fRqg/4WBl7YAhHQJW+g+vh9yHsM0NR1BYJgqzDdzcKgG+rHpJLGH bCPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=fvJM1mF8bPBNMqpvjugXJNVqNWf4rVj9eY/cgpkecaM=; b=TxgCNyHXhtSB8CQAbZ7m7bbwSDTcnWbutl0UaiCYSMkxDBEU1B/jJFyQa0np9pRXML nOkCM36yyMcYJKIF8MEpAt63slZ1vIiDzfeD4khD3iY+ywo4rpyJ3vYqv0/5xvjpDwvj ElLBH5ydlmogwYEnM1pZJG4Rlk6gy0MZb8Yz2dBrt5wa1+kjdjiPYAPHFpRx1WlUdtQl 0xF3ALV3vlwoCtAu++Qn3/OPG8zHteSOPhxMV71CpIq5Ui49jpXangjJO0C9i5FlKSLN 7M7hhsqt28T87hSRFEHuSrsV4+FUL1uemNYdLwWMrvXuDncRYTnHA49qXlF2GLB3esvv iG2g== X-Gm-Message-State: ALyK8tLHeFy4s7IUfj0XyyQ3nE8mPoqqS88w0Ns8+yZEOcu+UQhYmEtY3e7F6aDhGQ9ECw== X-Received: by 10.200.42.161 with SMTP id b30mr16096080qta.94.1468070850565; Sat, 09 Jul 2016 06:27:30 -0700 (PDT) Original-Received: from Andrews-MacBook-Pro.local (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id p83sm1720229qkh.49.2016.07.09.06.27.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jul 2016 06:27:28 -0700 (PDT) In-Reply-To: <87ws12jr51.fsf@blah.blah> (Kevin Ryde's message of "Sat, 05 Dec 2009 09:44:42 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120685 Archived-At: This still is the case in Emacs 25. I agree that this seems like a problem. Kevin Ryde 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. > > I hoped the hook functions would instead run like the builtin checks of > checkdoc-file-comments-engine, > > (setq err (or (some check) > err)) > > so that all checks are always run, with an error reported if any one of > them reports an error. > > Or alternately perhaps I misunderstand the docstring of > checkdoc-comment-style-hooks, and that a "problem discovered" means > something fatal and unrecoverable, or something, and that hook functions > should almost always return nil no matter what they find. > > > I threw down the few lines below for a hook run which returns the last > true value, but I'm not sure I like it much. An alternative to picking > out a list of functions from a hook might be a > "run-hook-with-accumulator-function" or even a "map-hook" -- unless that > exists already. > > (defun checkdoc-run-hooks-last-true (hookvar) > "Run hooks in HOOKVAR and return the last true value." > (let (ret) > (dolist (func (checkdoc-hook-functions hookvar)) > (setq ret (or (funcall func) ret))))) > > (defun checkdoc-hook-functions (hookvar) > "Return a list of functions HOOKVAR should run. > HOOKVAR can be a single function or list of functions, the return > is always a list. `t' in a buffer-local value means use the > global `default-value' at that point, and it can likewise be a > function or list." > (let ((hooks (symbol-value hookvar))) > (if (and hooks > ;; same test as run_hook_with_args() > (or (not (consp hooks)) > (eq 'lambda (car hooks)))) > (list hooks) ;; single function listified > > ;; expand `t' to global value > (apply 'append > (mapcar (lambda (func) > (if (eq t func) > (let ((global (default-value hookvar))) > ;; same test as run_hook_with_args() > (if (or (not (consp global)) > (eq 'lambda (car global))) > (list global) > global)) > (list func))) > hooks))))) > > > > > In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) > of 2009-09-14 on raven, modified by Debian > configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' > > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: en_AU > value of $XMODIFIERS: nil > locale-coding-system: iso-latin-1-unix > default-enable-multibyte-characters: t