comparison 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
comparison
equal deleted inserted replaced
65824:4f45bcb69451 65825:b89d9c4d5386
1843 (match-string 1))) 1843 (match-string 1)))
1844 1844
1845 (defun Info-next () 1845 (defun Info-next ()
1846 "Go to the next node of this node." 1846 "Go to the next node of this node."
1847 (interactive) 1847 (interactive)
1848 (Info-goto-node (Info-extract-pointer "next"))) 1848 ;; In case another window is currently selected
1849 (save-window-excursion
1850 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
1851 (Info-goto-node (Info-extract-pointer "next"))))
1849 1852
1850 (defun Info-prev () 1853 (defun Info-prev ()
1851 "Go to the previous node of this node." 1854 "Go to the previous node of this node."
1852 (interactive) 1855 (interactive)
1853 (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))) 1856 ;; In case another window is currently selected
1857 (save-window-excursion
1858 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
1859 (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))))
1854 1860
1855 (defun Info-up (&optional same-file) 1861 (defun Info-up (&optional same-file)
1856 "Go to the superior node of this node. 1862 "Go to the superior node of this node.
1857 If SAME-FILE is non-nil, do not move to a different Info file." 1863 If SAME-FILE is non-nil, do not move to a different Info file."
1858 (interactive) 1864 (interactive)
1859 (let ((old-node Info-current-node) 1865 ;; In case another window is currently selected
1860 (old-file Info-current-file) 1866 (save-window-excursion
1861 (node (Info-extract-pointer "up")) p) 1867 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
1862 (and (or same-file (not (stringp Info-current-file))) 1868 (let ((old-node Info-current-node)
1863 (string-match "^(" node) 1869 (old-file Info-current-file)
1864 (error "Up node is in another Info file")) 1870 (node (Info-extract-pointer "up")) p)
1865 (Info-goto-node node) 1871 (and (or same-file (not (stringp Info-current-file)))
1866 (setq p (point)) 1872 (string-match "^(" node)
1867 (goto-char (point-min)) 1873 (error "Up node is in another Info file"))
1868 (if (and (search-forward "\n* Menu:" nil t) 1874 (Info-goto-node node)
1869 (re-search-forward 1875 (setq p (point))
1870 (if (string-equal old-node "Top") 1876 (goto-char (point-min))
1871 (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")") 1877 (if (and (search-forward "\n* Menu:" nil t)
1872 (concat "\n\\* +\\(" (regexp-quote old-node) 1878 (re-search-forward
1873 ":\\|[^:]+: +" (regexp-quote old-node) "\\)")) 1879 (if (string-equal old-node "Top")
1874 nil t)) 1880 (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")")
1875 (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2))) 1881 (concat "\n\\* +\\(" (regexp-quote old-node)
1876 (goto-char p) 1882 ":\\|[^:]+: +" (regexp-quote old-node) "\\)"))
1877 (Info-restore-point Info-history)))) 1883 nil t))
1884 (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
1885 (goto-char p)
1886 (Info-restore-point Info-history)))))
1878 1887
1879 (defun Info-history-back () 1888 (defun Info-history-back ()
1880 "Go back in the history to the last node visited." 1889 "Go back in the history to the last node visited."
1881 (interactive) 1890 (interactive)
1882 (or Info-history 1891 (or Info-history
4031 (let ((completions nil)) 4040 (let ((completions nil))
4032 (speedbar-select-attached-frame) 4041 (speedbar-select-attached-frame)
4033 (save-window-excursion 4042 (save-window-excursion
4034 (setq completions 4043 (setq completions
4035 (Info-speedbar-fetch-file-nodes (or node '"(dir)top")))) 4044 (Info-speedbar-fetch-file-nodes (or node '"(dir)top"))))
4036 (select-frame speedbar-frame) 4045 (select-frame (speedbar-current-frame))
4037 (if completions 4046 (if completions
4038 (speedbar-with-writable 4047 (speedbar-with-writable
4039 (dolist (completion completions) 4048 (dolist (completion completions)
4040 (speedbar-make-tag-line 'bracket ?+ 'Info-speedbar-expand-node 4049 (speedbar-make-tag-line 'bracket ?+ 'Info-speedbar-expand-node
4041 (cdr completion) 4050 (cdr completion)