(help-xref-go-back): Restore POSITION in proper buffer and proper window.
authorRichard M. Stallman <rms@gnu.org>
Sat, 12 Jan 2002 21:00:17 +0000 (21:00 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 12 Jan 2002 21:00:17 +0000 (21:00 +0000)
lisp/help-mode.el

index e041f2f..d424ff4 100644 (file)
@@ -560,8 +560,10 @@ help buffer."
              method (cadr item)
              args (cddr item))))
     (apply method args)
-    ;; FIXME: are we sure we're in the right buffer ?
-    (goto-char position)))
+    (with-current-buffer buffer
+      (if (get-buffer-window buffer)
+         (set-window-point (get-buffer-window buffer) position)
+       (goto-char position)))))
 
 (defun help-go-back ()
   "Invoke the [back] button (if any) in the Help mode buffer."