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 10:47:20 -0400 Message-ID: References: <87lffu9zye.fsf@gnus.org> 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="1137"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , 44202@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 25 15:48:14 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 1kWhJe-0000Cv-9t for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Oct 2020 15:48:14 +0100 Original-Received: from localhost ([::1]:54842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWhJc-00027s-W4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Oct 2020 10:48:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWhJW-00027g-KM for bug-gnu-emacs@gnu.org; Sun, 25 Oct 2020 10:48:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWhJS-0006Y5-An for bug-gnu-emacs@gnu.org; Sun, 25 Oct 2020 10:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWhJS-0001jF-8x for bug-gnu-emacs@gnu.org; Sun, 25 Oct 2020 10:48: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 14:48: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.16036372596614 (code B ref 44202); Sun, 25 Oct 2020 14:48:02 +0000 Original-Received: (at 44202) by debbugs.gnu.org; 25 Oct 2020 14:47:39 +0000 Original-Received: from localhost ([127.0.0.1]:37272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWhJ5-0001ib-HR for submit@debbugs.gnu.org; Sun, 25 Oct 2020 10:47:39 -0400 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:58440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWhJ3-0001iN-5a for 44202@debbugs.gnu.org; Sun, 25 Oct 2020 10:47:37 -0400 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1: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-202.mailbox.org (Postfix) with ESMTPS id 4CK15v07PrzQlPq; Sun, 25 Oct 2020 15:47:31 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id sl5afsfzX9kX; Sun, 25 Oct 2020 15:47:24 +0100 (CET) In-Reply-To: <87lffu9zye.fsf@gnus.org> X-Rspamd-Score: -6.27 / 15.00 / 15.00 X-Rspamd-Queue-Id: F077917DB X-Rspamd-UID: 4f9137 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:191494 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: >> +(defcustom help-mode-revert-buffer-noconfirm nil > > In general, I think "negative" variables should be avoided, because > doing the "not not" logic confuses people. So I'd rather have > `help-mode-revert-buffer-confirm' (defaulting to t). I was trying to match the noconfirm argument of the revert function but I agree, `help-mode-revert-buffer-confirm' is less confusing. I've attached an updated patch. Kevin Foley --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-option-to-disable-confirmation-prompt-when-rever.patch Content-Description: patch >From 9d5c29fc084d13837a5e8fb27f3948953b923605 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-confirm): (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..716924f312 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-confirm t + "Non-nil means 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-confirm' to control confirmation prompt." + (when (or noconfirm + (not help-mode-revert-buffer-confirm) + (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 --=-=-=--