summaryrefslogtreecommitdiff
path: root/lisp/help-mode.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2010-06-17 23:56:17 +0300
committerJuri Linkov <juri@jurta.org>2010-06-17 23:56:17 +0300
commitdbd6da78650014d997dceeecaa4392fc79f6ca8b (patch)
treed23eff2c0dd4f6dbad8c9edd9159c1b2eac356ae /lisp/help-mode.el
parent64eba874f5977eb99d9f1bdaa26010cc5fd9e689 (diff)
downloademacs-dbd6da78650014d997dceeecaa4392fc79f6ca8b.tar.gz
Fix revert-buffer functionality of Help mode and Info.
* lisp/help-mode.el (help-mode): Set buffer-local variable revert-buffer-function to help-mode-revert-buffer. (help-mode-revert-buffer): New function. * lisp/info.el (Info-revert-find-node): Check for major-mode Info-mode before popping to "*info*" (like in other Info functions). Keep buffer-name in old-buffer-name. Keep Info-history-forward in old-history-forward. Pop to old-buffer-name or "*info*" to recreate the killed buffer. Set Info-history-forward from old-history-forward. (Info-breadcrumbs-depth): Add :group and :version.
Diffstat (limited to 'lisp/help-mode.el')
-rw-r--r--lisp/help-mode.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index f115e425325..c478bf6d16c 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -272,6 +272,9 @@ Commands:
(with-current-buffer buffer
(bury-buffer))))
+ (set (make-local-variable 'revert-buffer-function)
+ 'help-mode-revert-buffer)
+
(run-mode-hooks 'help-mode-hook))
;;;###autoload
@@ -783,6 +786,17 @@ Show all docs for that symbol as either a variable, function or face."
(fboundp sym) (facep sym))
(help-do-xref pos #'help-xref-interned (list sym)))))
+(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-insert-string (string)
"Insert STRING to the help buffer and install xref info for it.
This function can be used to restore the old contents of the help buffer