bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44202: [PATCH] Add variable to control confirmation of help-mode-rev


From: Kevin Foley
Subject: bug#44202: [PATCH] Add variable to control confirmation of help-mode-revert-buffer
Date: Sat, 24 Oct 2020 16:25:24 -0400

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]