From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error Date: Sat, 05 Dec 2009 09:44:42 +1100 Message-ID: <87ws12jr51.fsf@blah.blah> Reply-To: Kevin Ryde , 5126@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259968071 18234 80.91.229.12 (4 Dec 2009 23:07:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2009 23:07:51 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 05 00:07:44 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NGhFV-0001Ef-HR for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 00:07:41 +0100 Original-Received: from localhost ([127.0.0.1]:37359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGhFU-0005PY-P8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Dec 2009 18:07:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGhFN-0005OH-DW for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:07:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGhFJ-0005Nr-SN for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:07:33 -0500 Original-Received: from [199.232.76.173] (port=39959 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGhFJ-0005Nn-Ng for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:07:29 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37442) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGhFJ-0007O8-1t for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:07:29 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB4N7OIx005367; Fri, 4 Dec 2009 15:07:27 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB4MoBYg003299; Fri, 4 Dec 2009 14:50:11 -0800 Resent-Date: Fri, 4 Dec 2009 14:50:11 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 04 Dec 2009 22:50:10 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 5126 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12599667162979 (code B ref -1); Fri, 04 Dec 2009 22:50:10 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 4 Dec 2009 22:45:16 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB4MjDAq002952 for ; Fri, 4 Dec 2009 14:45:15 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGgtk-0006i9-Ve for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 17:45:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGgtg-0006gL-4n for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 17:45:12 -0500 Original-Received: from [199.232.76.173] (port=43978 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGgtf-0006gI-Rt for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 17:45:07 -0500 Original-Received: from mailout2-6.pacific.net.au ([61.8.2.229]:58552 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGgtf-000509-8n for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 17:45:07 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 011461A2D24 for ; Sat, 5 Dec 2009 09:45:01 +1100 (EST) Original-Received: from blah.blah (ppp2782.dyn.pacific.net.au [61.8.39.130]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id D532027411 for ; Sat, 5 Dec 2009 09:44:59 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1NGgtG-0004QA-DF for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 09:44:42 +1100 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 04 Dec 2009 18:07:33 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33218 Archived-At: 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