changeset 21973:f3d29552e393

(view-lossage): Set help-xref-stack* in the help buffer. (describe-bindings): Likewise. (help-xref-go-back): New arg BUFFER. (help-make-xrefs): Specify the help buffer as arg for help-xref-go-back.
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 May 1998 05:37:59 +0000
parents 9c71660c0a8d
children 42b308d86213
files lisp/help.el
diffstat 1 files changed, 21 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help.el	Thu May 07 05:30:07 1998 +0000
+++ b/lisp/help.el	Thu May 07 05:37:59 1998 +0000
@@ -461,9 +461,9 @@
       (goto-char (point-min))
       (while (progn (move-to-column 50) (not (eobp)))
 	(search-forward " " nil t)
-	(insert "\n")))
-    (setq help-xref-stack nil
-          help-xref-stack-item nil)
+	(insert "\n"))
+      (setq help-xref-stack nil
+	    help-xref-stack-item nil))
     (print-help-return-message)))
 
 (defalias 'help 'help-for-help)
@@ -747,9 +747,10 @@
 The optional argument PREFIX, if non-nil, should be a key sequence;
 then we display only bindings that start with that prefix."
   (interactive "P")
-  (setq help-xref-stack nil
-        help-xref-stack-item nil)
-  (describe-bindings-internal nil prefix))
+  (describe-bindings-internal nil prefix)
+  (with-current-buffer "*Help*"
+    (setq help-xref-stack nil
+	  help-xref-stack-item nil)))
 
 (defun where-is (definition &optional insert)
   "Print message listing key sequences that invoke specified command.
@@ -972,7 +973,7 @@
             (insert "\n\n" help-back-label))
           ;; Just to provide the match data:
           (looking-at (concat "\n\n\\(" (regexp-quote help-back-label) "\\)"))
-          (help-xref-button 1 #'help-xref-go-back nil)))
+          (help-xref-button 1 #'help-xref-go-back (current-buffer))))
       ;; View mode steals RET from us.
       (set (make-local-variable 'minor-mode-overriding-map-alist)
            (list (cons 'view-mode
@@ -1035,18 +1036,20 @@
       (set-buffer (window-buffer window))
       (help-follow pos))))
 
-(defun help-xref-go-back ()
-  "Go back to the previous help buffer using info on `help-xref-stack'."
+(defun help-xref-go-back (buffer)
+  "Go back to the previous help buffer text using info on `help-xref-stack'."
   (interactive)
-  (when help-xref-stack
-    (setq help-xref-stack (cdr help-xref-stack)) ; due to help-follow
-    (let* ((item (car help-xref-stack))
-           (method (car item))
-           (args (cdr item)))
-      (setq help-xref-stack (cdr help-xref-stack))
-      (if (listp args)
-          (apply method args)
-        (funcall method args)))))
+  (let (item method args)
+    (with-current-buffer buffer
+      (when help-xref-stack
+	(setq help-xref-stack (cdr help-xref-stack)) ; due to help-follow
+	(setq item (car help-xref-stack)
+	      method (car item)
+	      args (cdr item))
+	(setq help-xref-stack (cdr help-xref-stack))))
+    (if (listp args)
+	(apply method args)
+      (funcall method args))))
 
 (defun help-go-back ()
   (interactive)