From be2b43c4d6ee7a4f63caf0d496789963fcf4fb00 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 08:23:31 +0100 Subject: [PATCH] `g' in *Help* doesn't require confirmation * lisp/help-mode.el (help-mode-revert-buffer): Don't require confirmation before reverting (bug#44202). This mimics how most other non-file reverting functions work. --- etc/NEWS | 3 +++ lisp/help-mode.el | 19 +++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a77c1c883eb..71749d1b1ff 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -583,6 +583,9 @@ skipped. ** Help +--- +*** 'g' ('revert-buffer') in 'help-mode' no longer requires confirmation. + +++ *** New command 'describe-keymap' describes keybindings in a keymap. diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 0dc6c9ffae0..f0770fb6602 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -756,16 +756,15 @@ Show all docs for that symbol as either a variable, function or face." (help-do-xref pos #'describe-symbol (list sym)) (user-error "No symbol here")))) -(defun help-mode-revert-buffer (_ignore-auto noconfirm) - (when (or 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. - (help-xref-stack-item nil) - ;; Use the current buffer. - (help-xref-following t)) - (apply (car item) (cdr item)) - (goto-char pos)))) +(defun help-mode-revert-buffer (_ignore-auto _noconfirm) + (let ((pos (point)) + (item help-xref-stack-item) + ;; Pretend there is no current item to add to the history. + (help-xref-stack-item nil) + ;; Use the current buffer. + (help-xref-following t)) + (apply (car item) (cdr item)) + (goto-char pos))) (defun help-insert-string (string) "Insert STRING to the help buffer and install xref info for it. -- 2.39.2