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