From gg@zip.com.au Fri Dec 4 14:45:15 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 4 Dec 2009 22:45:16 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.8 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 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) 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) 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 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 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> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 09 09:27:38 2016 Received: (at 5126) by debbugs.gnu.org; 9 Jul 2016 13:27:39 +0000 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 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 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) 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) From: Andrew Hyatt To: Kevin Ryde Subject: Re: bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error References: <87ws12jr51.fsf@blah.blah> Date: Sat, 09 Jul 2016 09:27:27 -0400 In-Reply-To: <87ws12jr51.fsf@blah.blah> (Kevin Ryde's message of "Sat, 05 Dec 2009 09:44:42 +1100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 5126 Cc: 5126@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 15:14:17 2019 Received: (at 5126) by debbugs.gnu.org; 16 Aug 2019 19:14:17 +0000 Received: from localhost ([127.0.0.1]:54883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyhg0-0006CM-Tu for submit@debbugs.gnu.org; Fri, 16 Aug 2019 15:14:17 -0400 Received: from mail-ot1-f43.google.com ([209.85.210.43]:35174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyhfz-0006C7-Hk for 5126@debbugs.gnu.org; Fri, 16 Aug 2019 15:14:16 -0400 Received: by mail-ot1-f43.google.com with SMTP id g17so9767312otl.2 for <5126@debbugs.gnu.org>; Fri, 16 Aug 2019 12:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0SlxRr0rz0uxWHgOAPTnnhOnFZx9KxbKg/brIz1gfa8=; b=JCRR8v3FSbyBZasT45aIMWYACRoDdEV3QgNJHc+f/2cMmn3zvUfl3A0pblc97kaaM9 rOI+eTZ3YPWpRH+Xu/rFIojNP6JwN8GuVtdL9NKLXV3t+lPC8YlK2HHT+fatR2to4WB4 we4A1Hz2MxR+Udb+0UHzP0/Ydndmc42JHHZKm6vFxb0Hn5gPIic8WOg34wsO+BH/POVo LlARO6yBh90gBlGcrcBzunttXsnFhutWHCYZD0yKzqCkOARHqu6ttlrpcuqOARVTG7Mm gkkjZZMAaPVyYPS5/EMB5HiYiWRdsXg0580G4bahRGCR/hgjF33QvUPdBz4RAGzngHEY tShw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=0SlxRr0rz0uxWHgOAPTnnhOnFZx9KxbKg/brIz1gfa8=; b=K98OvEMyYpEJoyrubJ9+ZH3OZ+NcvOWVVpOvvxp4mUU9OnGTpaTcZnUQoyQRYfqwUb eSvtAUyPQ6oWnI8PFnMewUi5po77adD20YlOMgfyPm4gGwN+4uye30NAuZX8Z/jFg5s2 vetZp6yFbodsRLkhiKd6UBvwpCU6wsVVAgxnvPYchN+lE48Wv1G1m8QqoiMXRC91hiZC 3ZGnA+qeQP8ilwGZtxWCRoX1VRcm3/OqEXCpXDUFd16ynTwLt8wryXaaedoOTIS+pGho EADp9K8wITyCFOTpvcL2ZXZMJyI0g0weWEmXeKjX871KoZ9Y9yBMek83lo1UY7PHocVF m4nQ== X-Gm-Message-State: APjAAAXOUXSIhgKbXJgZkhrxf+0W1SSauxbpNLMNWqZ0xItVlui7AYa2 qVgcnDuW6HsI/Hw4gq15MpYiqBiu2/Y= X-Google-Smtp-Source: APXvYqwqSjweHP2jed5yHfUuTywE5tQXrzUUnKvywu41t+VRcRU42PUlrDaMs1iKZYOfqTzu6Kn1tw== X-Received: by 2002:a9d:bb0:: with SMTP id 45mr9235669oth.34.1565982849762; Fri, 16 Aug 2019 12:14:09 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id n109sm2521016ota.36.2019.08.16.12.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 12:14:09 -0700 (PDT) From: Alex Branham To: Andrew Hyatt Subject: Re: bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error References: <87ws12jr51.fsf@blah.blah> Date: Fri, 16 Aug 2019 14:14:08 -0500 In-Reply-To: (Andrew Hyatt's message of "Sat, 09 Jul 2016 09:27:27 -0400") Message-ID: <87sgq0ly7z.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 5126 Cc: 5126@debbugs.gnu.org, Kevin Ryde X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) On Sat 09 Jul 2016 at 09:27, Andrew Hyatt wrote: > 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. 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 13:22:06 2019 Received: (at 5126) by debbugs.gnu.org; 20 Aug 2019 17:22:06 +0000 Received: from localhost ([127.0.0.1]:33876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i07pe-0005VF-G0 for submit@debbugs.gnu.org; Tue, 20 Aug 2019 13:22:06 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:39174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i07pb-0005Uk-F1 for 5126@debbugs.gnu.org; Tue, 20 Aug 2019 13:22:04 -0400 Received: by mail-qk1-f170.google.com with SMTP id 125so5154688qkl.6 for <5126@debbugs.gnu.org>; Tue, 20 Aug 2019 10:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qwm4ci/Foulcq5v8yEBj13m3mSgO+LftqScHAAyTcEE=; b=bM3EkHBNR2JTWSAIvuCQAZwYqBje5Dcjnl4rZmw5o4nGNMh/CM9TCCNl9zOR7zet1g pWXTkmt4v0bQLs+ON8LjYafn2XtZksHc81sNi/oaHvU/qK9/wJ+fIdaV7iE8E0vs5TD2 ixO2UcCkTXLBQiABbMOujFVdii9ijg2iO3kBpd+/Ijh7zRNjyVWgM5XVPoX60DiHCiZD utdFfRv7Liq7d+1PhUfohIE93PyJmisusk2KaFw1YO4j+SHF13Y2Oy1NMH0opWWcciuC udG85vgNbqb6+cP2rd59LBvnCzGvOCHQbzWrPRZqntzgeb8CLzsrV0uU4f4P1QJwkFCV cwTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qwm4ci/Foulcq5v8yEBj13m3mSgO+LftqScHAAyTcEE=; b=LYcaiHs92fbrSRtoE4SmDpG9OO42BVWr45y+6w0kw2RgrhjGvvOBmQ+OtaXRDds0yT QnetKjyz6fQUJpBA+BO5b8/3J9JE4yczLIm81RAzsrhlOSFgptH3GA8+2X6/kw0IDWUN RM3BjgmARCeA4iqSNkxzfskzsH3qnPlUA2aC+lgHPiNZ2njD0euhjzsLZSGtFWOnhKb3 ElZp1v+HGHrqVpv0SENzetu5ofv5qJTlMCA0OGsZKFp7tE8rtPkul5MkzQjwzD8ECY6A O9wr9b7sjgXLx1S6P+pbDdnvNeL2NzMe9ImAW+tSpiiZs7l6Cm8KvbDN4dcHSDHBD5T4 TBqg== X-Gm-Message-State: APjAAAW3y66Qwg0G6qM3e5dSljB1DXgbR6CVdkbJcC/BFgVRXlxBdC1l 2iIICJG6zrag4TyYyoFhvOmXP2WNoYa+4MC56FY= X-Google-Smtp-Source: APXvYqxn8G5XAwoQRNfB7ULszCftl5k+QMDn1lXBXFqVRp1h6xNdeimpDp0TNV7LSKd0RtRZ0BKAZNySqaMT6cALz2o= X-Received: by 2002:a37:5fc6:: with SMTP id t189mr26745652qkb.483.1566321717762; Tue, 20 Aug 2019 10:21:57 -0700 (PDT) MIME-Version: 1.0 References: <87ws12jr51.fsf@blah.blah> <87sgq0ly7z.fsf@gmail.com> In-Reply-To: <87sgq0ly7z.fsf@gmail.com> From: Andrew Hyatt Date: Tue, 20 Aug 2019 13:21:46 -0400 Message-ID: Subject: Re: bug#5126: 23.1; checkdoc-comment-style-hooks stops at first error To: Alex Branham Content-Type: multipart/alternative; boundary="0000000000009760d705908fb156" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 5126 Cc: 5126@debbugs.gnu.org, Kevin Ryde X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000009760d705908fb156 Content-Type: text/plain; charset="UTF-8" The bug report is saying that not all checks are run. If you trace your functions you tested with and run checkdoc, you will find that foobaz is checked for but not foobar. So not all checks are run. The author of the bug wants both checked for. Maybe this bug should be a feature request instead. Or, maybe it's not a good idea to even do all the checks when only one error message will be printed. I'm not sure why the author of the bug thought this was a problem, to be honest. If someone understands what the benefit would be of running all checks, please share that info. Otherwise, I'm happy to close this bug in a few weeks if we don't hear anything. On Fri, Aug 16, 2019 at 3:14 PM Alex Branham wrote: > On Sat 09 Jul 2016 at 09:27, Andrew Hyatt wrote: > > > 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. > > 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 > --0000000000009760d705908fb156 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The bug report is saying that not all checks are run. If y= ou trace your
functions you tested with and run checkdoc, you will find = that foobaz is
checked for but not foobar. So not all checks are run. Th= e author of the
bug wants both checked for.

Maybe this bug should= be a feature request instead.

Or, maybe it's not a good idea to= even do all the checks when only one
error message will be printed.=C2= =A0 I'm not sure why the author of the bug
thought this was a proble= m, to be honest.

If someone understands what the ben= efit would be of running
all checks, please share that info.=C2= =A0 Otherwise, I'm happy to close this
bug in a few weeks if = we don't hear anything.

On Fri, Aug 16, 2019 at 3:14 PM Alex Branh= am <alex.branham@gmail.com= > wrote:
On S= at 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-engi= ne
>> with run-hook-with-args-until-success, which means if one of the h= ook
>> 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 ()
=C2=A0 "Check if foobar is in a comment."
=C2=A0 (save-excursion
=C2=A0 =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 (unless (re-search-forward "^;; foobar" nil t)
=C2=A0 =C2=A0 =C2=A0 (checkdoc-create-error
=C2=A0 =C2=A0 =C2=A0 =C2=A0";; foobar doesn't exist"
=C2=A0 =C2=A0 =C2=A0 =C2=A0(1- (point-max)) (point-max)))))

(defun my/checkdoc-comments-foobaz ()
=C2=A0 "Check if foobaz is in a comment."
=C2=A0 (save-excursion
=C2=A0 =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 (unless (re-search-forward "^;; foobaz" nil t)
=C2=A0 =C2=A0 =C2=A0 (checkdoc-create-error
=C2=A0 =C2=A0 =C2=A0 =C2=A0";; foobaz doesn't exist"
=C2=A0 =C2=A0 =C2=A0 =C2=A0(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
--0000000000009760d705908fb156-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 24 20:42:03 2019 Received: (at control) by debbugs.gnu.org; 25 Sep 2019 00:42:03 +0000 Received: from localhost ([127.0.0.1]:40626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCvNa-0005sh-Qr for submit@debbugs.gnu.org; Tue, 24 Sep 2019 20:42:03 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:36777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCvNY-0005s9-0o for control@debbugs.gnu.org; Tue, 24 Sep 2019 20:42:01 -0400 Received: by mail-qk1-f179.google.com with SMTP id y189so3785883qkc.3 for ; Tue, 24 Sep 2019 17:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=JuGmGl34czEsLkOvlIxlIQpIOSx0A70Xa+whuqDfz5k=; b=CzF0BGmu3WKefKdwd5mEgnfiD1oyLX0DRHfWhyHxFzXZXIT2cMh/wm/OupgcT9C/tg eatyI71OPMFaQSjZyCDz1RHjvEsIyv43ArlpmF58lbQD07pz+ULdBLiTmUaIJyJ/KVdt EQHgFFWKd7czZ1qGH7DuzzxSaGpsZzLTduqiEttG+4ZL9wHq2TU6Kw7jLaskTwAgcr5M wOazclIH5SDv++4UIeidFI2BPuOxFwDcxK0mDnfjyyWu7Xj3BYimCmNUQgTP+AxGaY+d fQ79Yvwl23TLEkKhq7gB/bivEFFLWLf2Uz8+DaOHJpr5hVhXvBBFdSDUj7tkTPbmda9J Zv2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=JuGmGl34czEsLkOvlIxlIQpIOSx0A70Xa+whuqDfz5k=; b=tLs00T3cUfFQW0N7/ygAclZxhwD4TK4vvJtV0f3hLaowGrWGqno0PfQBd4rC2Hwt5T hUgPkXb4NwckMA6ChNwcMgAXWX5BEd2wLzTxq2hRa9EGnkyIUikYFjzJCTye6WcEfuRP M7zovu8V+vYro86nEqStgU/LsawcWkKtQ5xqZVuTsXw8d7piRwatZAtsotYeBqoPpPGd juUglpVMcXcaQZNKPlC9sxFQE5CQCgVpfCD4BhfxH98+xfaN3WRZbfDfZSz3BVaUo3Vs 5OKDeDiiU33eSNcCEneR1tLbvmFWe57q6uqqO9zSKrPbyHTUfAEg0XHT+4M1GfFVOP3F q3JA== X-Gm-Message-State: APjAAAVh9qfXviyA7rKBptxNc9eLtfAsrdP5AD7jR5L+WSuPlcaS8MUV F2omqoYfYtIPLl7hieGn40haIbTB X-Google-Smtp-Source: APXvYqxBVf2aUQEYuh+tJLd9BE2mw8+grCaieZOCPmCG/svtqEozFsysF/jKJZcV6hKKxIe0eplv+Q== X-Received: by 2002:a05:620a:1037:: with SMTP id a23mr978315qkk.280.1569372114031; Tue, 24 Sep 2019 17:41:54 -0700 (PDT) Received: from ahyatt-macbookpro6.roam.corp.google.com (pool-74-101-146-201.nycmny.fios.verizon.net. [74.101.146.201]) by smtp.gmail.com with ESMTPSA id q49sm3077537qta.60.2019.09.24.17.41.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 17:41:53 -0700 (PDT) Date: Tue, 24 Sep 2019 20:41:45 -0400 Message-Id: To: control@debbugs.gnu.org From: Andrew Hyatt Subject: control message for bug #5126 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 5126 notabug close 5126 quit From unknown Tue Aug 19 02:59:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Oct 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator