`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.
This commit is contained in:
Lars Ingebrigtsen 2020-10-27 08:23:31 +01:00
parent eca5f4dec7
commit be2b43c4d6
2 changed files with 12 additions and 10 deletions

View file

@ -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.

View file

@ -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.