diff lisp/info.el @ 65825:b89d9c4d5386

* info.el (Info-next, Info-prev, Info-up): Select info buffer, in case the user clicks on the link while another window is selected. (Info-speedbar-hierarchy-buttons): Use speedbar-current-frame. * dframe.el (dframe-update-keymap): Use mouse-1-click-follows-link functionality. (dframe-help-echo): Save point in case mouse tracking is off.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 04 Oct 2005 14:06:44 +0000
parents 6e229fd94815
children c4bdbe18630e aa89c814f853
line wrap: on
line diff
--- a/lisp/info.el	Tue Oct 04 13:55:17 2005 +0000
+++ b/lisp/info.el	Tue Oct 04 14:06:44 2005 +0000
@@ -1845,36 +1845,45 @@
 (defun Info-next ()
   "Go to the next node of this node."
   (interactive)
-  (Info-goto-node (Info-extract-pointer "next")))
+  ;; In case another window is currently selected
+  (save-window-excursion
+    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+    (Info-goto-node (Info-extract-pointer "next"))))
 
 (defun Info-prev ()
   "Go to the previous node of this node."
   (interactive)
-  (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous")))
+  ;; In case another window is currently selected
+  (save-window-excursion
+    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+    (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))))
 
 (defun Info-up (&optional same-file)
   "Go to the superior node of this node.
 If SAME-FILE is non-nil, do not move to a different Info file."
   (interactive)
-  (let ((old-node Info-current-node)
-        (old-file Info-current-file)
-        (node (Info-extract-pointer "up")) p)
-    (and (or same-file (not (stringp Info-current-file)))
-	 (string-match "^(" node)
-	 (error "Up node is in another Info file"))
-    (Info-goto-node node)
-    (setq p (point))
-    (goto-char (point-min))
-    (if (and (search-forward "\n* Menu:" nil t)
-             (re-search-forward
-              (if (string-equal old-node "Top")
-                  (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")")
-                (concat "\n\\* +\\(" (regexp-quote old-node)
-                        ":\\|[^:]+: +" (regexp-quote old-node) "\\)"))
-              nil t))
-        (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
-      (goto-char p)
-      (Info-restore-point Info-history))))
+  ;; In case another window is currently selected
+  (save-window-excursion
+    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+    (let ((old-node Info-current-node)
+	  (old-file Info-current-file)
+	  (node (Info-extract-pointer "up")) p)
+      (and (or same-file (not (stringp Info-current-file)))
+	   (string-match "^(" node)
+	   (error "Up node is in another Info file"))
+      (Info-goto-node node)
+      (setq p (point))
+      (goto-char (point-min))
+      (if (and (search-forward "\n* Menu:" nil t)
+	       (re-search-forward
+		(if (string-equal old-node "Top")
+		    (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")")
+		  (concat "\n\\* +\\(" (regexp-quote old-node)
+			  ":\\|[^:]+: +" (regexp-quote old-node) "\\)"))
+		nil t))
+	  (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
+	(goto-char p)
+	(Info-restore-point Info-history)))))
 
 (defun Info-history-back ()
   "Go back in the history to the last node visited."
@@ -4033,7 +4042,7 @@
       (save-window-excursion
 	(setq completions
 	      (Info-speedbar-fetch-file-nodes (or node '"(dir)top"))))
-      (select-frame speedbar-frame)
+      (select-frame (speedbar-current-frame))
       (if completions
 	  (speedbar-with-writable
 	   (dolist (completion completions)