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: Sat, 24 Oct 2020 16:25:24 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29009"; mail-complaints-to="usenet@ciao.gmane.io" To: 44202@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 25 01:13:11 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 1kWSik-0007SN-MN for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Oct 2020 01:13:10 +0200 Original-Received: from localhost ([::1]:59450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWSij-00044c-Nk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Oct 2020 19:13:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWSic-00044Q-II for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 19:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWSic-0004MS-9o for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 19:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWSic-0001K7-6G for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 19:13: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: Sat, 24 Oct 2020 23:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44202 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16035811485040 (code B ref -1); Sat, 24 Oct 2020 23:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2020 23:12:28 +0000 Original-Received: from localhost ([127.0.0.1]:35447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWSi3-0001JD-C7 for submit@debbugs.gnu.org; Sat, 24 Oct 2020 19:12:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWQ6c-0005d0-MQ for submit@debbugs.gnu.org; Sat, 24 Oct 2020 16:25:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWQ6c-0001yp-Fl for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 16:25:38 -0400 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:31842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1kWQ6Z-0003kR-SN for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 16:25:37 -0400 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (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-202.mailbox.org (Postfix) with ESMTPS id 4CJXfM0MB9zQkjT for ; Sat, 24 Oct 2020 22:25:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id CQnO1hCmuv63 for ; Sat, 24 Oct 2020 22:25:27 +0200 (CEST) X-Rspamd-Score: -4.48 / 15.00 / 15.00 X-Rspamd-Queue-Id: 1625E17DF X-Rspamd-UID: 712a44 Received-SPF: pass client-ip=80.241.56.172; envelope-from=kevin@kevinjfoley.me; helo=mout-p-202.mailbox.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/24 16:25:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 24 Oct 2020 19:12:25 -0400 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:191459 Archived-At: Allows users to control the `noconfirm' parameter of `help-mode-revert-buffer'. I've assigned copyright to FSF but this is my first patch on this list so please let me know if I've missed any standards. --- lisp/help-mode.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 0dc6c9ffae..458b959aec 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -98,6 +98,13 @@ The format is (FUNCTION ARGS...).") "Hook run by `help-mode'." :type 'hook :group 'help) + +(defcustom help-mode-revert-buffer-noconfirm nil + "Indicates whether to prompt for confirmation when reverting a +help buffer." + :type 'boolean + :group 'help + :version "28.1") ;; Button types used by help @@ -757,7 +764,12 @@ 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 whether user is +prompted for confirmation." + (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