diff lisp/info.el @ 109021:35894ae393bb

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.
author Juri Linkov <juri@jurta.org>
date Thu, 17 Jun 2010 23:56:17 +0300
parents daa05d3ccff4
children fa4400531412
line wrap: on
line diff
--- a/lisp/info.el	Thu Jun 17 09:41:13 2010 -0700
+++ b/lisp/info.el	Thu Jun 17 23:56:17 2010 +0300
@@ -238,7 +238,9 @@
 (defcustom Info-breadcrumbs-depth 4
   "Depth of breadcrumbs to display.
 0 means do not display breadcrumbs."
-  :type 'integer)
+  :version "23.1"
+  :type 'integer
+  :group 'info)
 
 (defcustom Info-search-whitespace-regexp "\\s-+"
   "If non-nil, regular expression to match a sequence of whitespace chars.
@@ -800,17 +802,22 @@
   "Go to an Info node FILENAME and NODENAME, re-reading disk contents.
 When *info* is already displaying FILENAME and NODENAME, the window position
 is preserved, if possible."
-  (pop-to-buffer "*info*")
+  (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
   (let ((old-filename Info-current-file)
 	(old-nodename Info-current-node)
+	(old-buffer-name (buffer-name))
 	(pcolumn      (current-column))
 	(pline        (count-lines (point-min) (line-beginning-position)))
 	(wline        (count-lines (point-min) (window-start)))
+	(old-history-forward Info-history-forward)
 	(old-history  Info-history)
 	(new-history  (and Info-current-file
 			   (list Info-current-file Info-current-node (point)))))
     (kill-buffer (current-buffer))
+    (pop-to-buffer (or old-buffer-name "*info*"))
+    (Info-mode)
     (Info-find-node filename nodename)
+    (setq Info-history-forward old-history-forward)
     (setq Info-history old-history)
     (if (and (equal old-filename Info-current-file)
 	     (equal old-nodename Info-current-node))