all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Foley <kevin@kevinjfoley.me>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Stefan Kangas <stefan@marxist.se>, 44202@debbugs.gnu.org
Subject: bug#44202: [PATCH] Add variable to control confirmation of help-mode-revert-buffer
Date: Sun, 25 Oct 2020 10:47:20 -0400	[thread overview]
Message-ID: <m2h7qil5vr.fsf@Kevins-MBP.home.lan> (raw)
In-Reply-To: <87lffu9zye.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1550 bytes --]

From 9d5c29fc084d13837a5e8fb27f3948953b923605 Mon Sep 17 00:00:00 2001
From: "Kevin J. Foley" <kevin@kevinjfoley.me>
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")
 \f
 ;; 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


  reply	other threads:[~2020-10-25 14:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-24 20:25 bug#44202: [PATCH] Add variable to control confirmation of help-mode-revert-buffer Kevin Foley
2020-10-24 23:40 ` Drew Adams
2020-10-25  0:01 ` Stefan Kangas
2020-10-25 13:39   ` Kevin Foley
2020-10-25 13:50     ` Lars Ingebrigtsen
2020-10-25 14:47       ` Kevin Foley [this message]
2020-10-25 16:50         ` Lars Ingebrigtsen
2020-10-25 18:42           ` Stefan Kangas
2020-10-25 20:08             ` Kevin Foley
2020-10-26 10:22               ` Lars Ingebrigtsen
2020-10-26 14:59                 ` Stefan Kangas
2020-10-26 22:05                   ` Kevin Foley
2020-10-27  7:27                     ` Lars Ingebrigtsen
2020-11-17 13:04                       ` Stefan Kangas
2020-11-24  5:26                         ` Lars Ingebrigtsen
2020-11-24 15:57                           ` Stefan Kangas
2020-11-25  7:01                             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2h7qil5vr.fsf@Kevins-MBP.home.lan \
    --to=kevin@kevinjfoley.me \
    --cc=44202@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.