From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kevin Foley Newsgroups: gmane.emacs.bugs Subject: bug#44202: [PATCH] Add variable to control confirmation of help-mode-revert-buffer Date: Sun, 25 Oct 2020 09:39:24 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38059"; mail-complaints-to="usenet@ciao.gmane.io" To: Stefan Kangas , 44202@debbugs.gnu.org, Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 25 14:40:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kWgFo-0009n4-31 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Oct 2020 14:40:12 +0100 Original-Received: from localhost ([::1]:47476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWgFm-0006Zg-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Oct 2020 09:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWgFf-0006ZU-2t for bug-gnu-emacs@gnu.org; Sun, 25 Oct 2020 09:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWgFe-0004qt-Oo for bug-gnu-emacs@gnu.org; Sun, 25 Oct 2020 09:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWgFe-0003zm-LY for bug-gnu-emacs@gnu.org; Sun, 25 Oct 2020 09:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kevin Foley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Oct 2020 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44202 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 44202-submit@debbugs.gnu.org id=B44202.160363318415326 (code B ref 44202); Sun, 25 Oct 2020 13:40:02 +0000 Original-Received: (at 44202) by debbugs.gnu.org; 25 Oct 2020 13:39:44 +0000 Original-Received: from localhost ([127.0.0.1]:36020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWgFM-0003z7-0R for submit@debbugs.gnu.org; Sun, 25 Oct 2020 09:39:44 -0400 Original-Received: from mout-p-103.mailbox.org ([80.241.56.161]:22652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWgFJ-0003yu-OQ for 44202@debbugs.gnu.org; Sun, 25 Oct 2020 09:39:42 -0400 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4CJzbW3k1szQky8; Sun, 25 Oct 2020 14:39:35 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id 2g2Ul8Hrb-Ph; Sun, 25 Oct 2020 14:39:27 +0100 (CET) In-Reply-To: X-Rspamd-Score: -7.75 / 15.00 / 15.00 X-Rspamd-Queue-Id: 3B03616FD X-Rspamd-UID: be2103 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191485 Archived-At: --=-=-= Content-Type: text/plain Drew Adams writes: > I think the first line of the doc string should > say what a true value means, because the option > name does that. > Or at least the doc string should somehow make > clear which Boolean value means which behavior. > E.g.: > Non-nil means do not prompt for confirmation when reverting a help > buffer. I agree this is better and also matches the recommendation in `(elisp)Documentation Tips', I've updated the patch to reflect this. Stefan Kangas writes: > Your patch seems to be lacking ChangeLog entries as described in > etc/CONTRIBUTE. You would help us if you could add such entries, > especially if you are planning to do more changes. I've updated the commit message per the CONTRIBUTE file, let me know if there are any changes needed. As a side note, it may be helpful to mention this file in the `(emacs)Sending Patches for GNU Emacs' info node. That was the page I was referencing for info before submitting this. >> +(defcustom help-mode-revert-buffer-noconfirm nil > > This would change the default, right? Any rationale for that? The default should be the same. I've updated the docstring which I think makes this clearer. >> + "Indicates whether to prompt for confirmation when reverting a >> +help buffer." > > The first sentence of a doc string should fit on one line. Updated with Drew's suggestion. >> (defun help-mode-revert-buffer (_ignore-auto noconfirm) >> - (when (or noconfirm (yes-or-no-p "Revert help buffer? ")) >> + "Revert help-mode buffer. See >> +`help-mode-revert-buffer-noconfirm' to control whether user is >> +prompted for confirmation." > > The first line should be one sentence only, and the second sentence > start on the second line. Updated to match these conventions. Thank you both for the feedback, let me know if there any other changes that should be made. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-option-to-disable-confirmation-prompt-when-rever.patch Content-Description: patch >From 42f226804ac20c2650ccfb063668e24e915b2cb2 Mon Sep 17 00:00:00 2001 From: "Kevin J. Foley" Date: Sat, 24 Oct 2020 16:14:31 -0400 Subject: [PATCH] Add option to disable confirmation prompt when reverting help buffer * lisp/help-mode.el (help-mode-revert-buffer-noconfirm): (help-mode-revert-buffer): Add variable and reference it in revert function. --- lisp/help-mode.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 0dc6c9ffae..729529e4db 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -98,6 +98,12 @@ The format is (FUNCTION ARGS...).") "Hook run by `help-mode'." :type 'hook :group 'help) + +(defcustom help-mode-revert-buffer-noconfirm nil + "Non-nil means do not prompt for confirmation when reverting a help buffer." + :type 'boolean + :group 'help + :version "28.1") ;; Button types used by help @@ -757,7 +763,11 @@ Show all docs for that symbol as either a variable, function or face." (user-error "No symbol here")))) (defun help-mode-revert-buffer (_ignore-auto noconfirm) - (when (or noconfirm (yes-or-no-p "Revert help buffer? ")) + "Revert help-mode buffer. +See `help-mode-revert-buffer-noconfirm' to control confirmation prompt." + (when (or noconfirm + help-mode-revert-buffer-noconfirm + (yes-or-no-p "Revert help buffer? ")) (let ((pos (point)) (item help-xref-stack-item) ;; Pretend there is no current item to add to the history. -- 2.28.0 --=-=-=--