aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2005-01-11 21:57:46 +0000
committerJuri Linkov2005-01-11 21:57:46 +0000
commit424b9d3e7da2acf96f39a06e68600fcb82a2a18e (patch)
tree0b5b1276b3d355a167d07f754b872e7c563693fb
parent4493ea9446d2998913b7655d8122cd267332b224 (diff)
downloademacs-424b9d3e7da2acf96f39a06e68600fcb82a2a18e.tar.gz
emacs-424b9d3e7da2acf96f39a06e68600fcb82a2a18e.zip
(Info-history-forward): New variable.
(Info-select-node): Reset Info-history-forward to nil. (Info-last): Turn into defalias. (Info-history-back): Rename from Info-last. Add current node to Info-history-forward. (Info-history-forward): New fun. (Info-mode-map): Replace Info-last by Info-history-back. Bind Info-history-forward to "r". (Info-mode-menu): Replace Info-last by Info-history-back. Fix menu item text. Add menu item for Info-history-forward. (info-tool-bar-map): Replace Info-last by Info-history-back. Replace its icon "undo" by "back_arrow". Add icon "fwd_arrow" for Info-history-forward. (Info-mode): Replace Info-last by Info-history-back in docstring. Add local variable Info-history-forward. (Info-goto-emacs-command-node): Replace Info-last by Info-history-back.
-rw-r--r--lisp/ChangeLog25
-rw-r--r--lisp/info.el51
2 files changed, 65 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2188f13d7ac..1d8e6518c56 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,26 @@
12005-01-11 Juri Linkov <juri@jurta.org>
2
3 * toolbar/back_arrow.xpm, toolbar/back_arrow.pbm,
4 * toolbar/lc-back_arrow.xpm, toolbar/lc-fwd_arrow.xpm,
5 * toolbar/fwd_arrow.xpm, toolbar/fwd_arrow.pbm: New icons.
6
7 * info.el (Info-history-forward): New variable.
8 (Info-select-node): Reset Info-history-forward to nil.
9 (Info-last): Turn into defalias.
10 (Info-history-back): Rename from Info-last.
11 Add current node to Info-history-forward.
12 (Info-history-forward): New fun.
13 (Info-mode-map): Replace Info-last by Info-history-back.
14 Bind Info-history-forward to "r".
15 (Info-mode-menu): Replace Info-last by Info-history-back.
16 Fix menu item text. Add menu item for Info-history-forward.
17 (info-tool-bar-map): Replace Info-last by Info-history-back.
18 Replace its icon "undo" by "back_arrow". Add icon "fwd_arrow"
19 for Info-history-forward.
20 (Info-mode): Replace Info-last by Info-history-back in docstring.
21 Add local variable Info-history-forward.
22 (Info-goto-emacs-command-node): Replace Info-last by Info-history-back.
23
12005-01-11 Stefan Monnier <monnier@iro.umontreal.ca> 242005-01-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 25
3 * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line) 26 * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line)
@@ -3224,7 +3247,7 @@
3224 * menu-bar.el (menu-bar-files-menu): Make "Open File..." call 3247 * menu-bar.el (menu-bar-files-menu): Make "Open File..." call
3225 find-file-existing. Add "New File..." that calls find-file. 3248 find-file-existing. Add "New File..." that calls find-file.
3226 3249
3227 * diropen.pbm diropen.xpm: New files. 3250 * diropen.pbm, diropen.xpm: New files.
3228 3251
3229 * toolbar/tool-bar.el (tool-bar-setup): Tool bar item dired uses 3252 * toolbar/tool-bar.el (tool-bar-setup): Tool bar item dired uses
3230 icon diropen. New tool bar item find-file-existing uses icon open. 3253 icon diropen. New tool bar item find-file-existing uses icon open.
diff --git a/lisp/info.el b/lisp/info.el
index 5e8e6ed8340..4fcbdeb6330 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -47,6 +47,10 @@
47 "Stack of info nodes user has visited. 47 "Stack of info nodes user has visited.
48Each element of list is a list (FILENAME NODENAME BUFFERPOS).") 48Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
49 49
50(defvar Info-history-forward nil
51 "Stack of info nodes user has visited with `Info-history-back' command.
52Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
53
50(defvar Info-history-list nil 54(defvar Info-history-list nil
51 "List of all info nodes user has visited. 55 "List of all info nodes user has visited.
52Each element of list is a list (FILENAME NODENAME).") 56Each element of list is a list (FILENAME NODENAME).")
@@ -1295,7 +1299,8 @@ any double quotes or backslashes must be escaped (\\\",\\\\)."
1295 ;; Add a new unique history item to full history list 1299 ;; Add a new unique history item to full history list
1296 (let ((new-history (list Info-current-file Info-current-node))) 1300 (let ((new-history (list Info-current-file Info-current-node)))
1297 (setq Info-history-list 1301 (setq Info-history-list
1298 (cons new-history (delete new-history Info-history-list)))) 1302 (cons new-history (delete new-history Info-history-list)))
1303 (setq Info-history-forward nil))
1299 (if (not (eq Info-fontify-maximum-menu-size nil)) 1304 (if (not (eq Info-fontify-maximum-menu-size nil))
1300 (Info-fontify-node)) 1305 (Info-fontify-node))
1301 (Info-display-images-node) 1306 (Info-display-images-node)
@@ -1731,18 +1736,38 @@ If SAME-FILE is non-nil, do not move to a different Info file."
1731 (goto-char p) 1736 (goto-char p)
1732 (Info-restore-point Info-history)))) 1737 (Info-restore-point Info-history))))
1733 1738
1734(defun Info-last () 1739(defun Info-history-back ()
1735 "Go back to the last node visited." 1740 "Go back in the history to the last node visited."
1736 (interactive) 1741 (interactive)
1737 (or Info-history 1742 (or Info-history
1738 (error "This is the first Info node you looked at")) 1743 (error "This is the first Info node you looked at"))
1739 (let (filename nodename opoint) 1744 (let ((history-forward
1745 (cons (list Info-current-file Info-current-node (point))
1746 Info-history-forward))
1747 filename nodename opoint)
1740 (setq filename (car (car Info-history))) 1748 (setq filename (car (car Info-history)))
1741 (setq nodename (car (cdr (car Info-history)))) 1749 (setq nodename (car (cdr (car Info-history))))
1742 (setq opoint (car (cdr (cdr (car Info-history))))) 1750 (setq opoint (car (cdr (cdr (car Info-history)))))
1743 (setq Info-history (cdr Info-history)) 1751 (setq Info-history (cdr Info-history))
1744 (Info-find-node filename nodename) 1752 (Info-find-node filename nodename)
1745 (setq Info-history (cdr Info-history)) 1753 (setq Info-history (cdr Info-history))
1754 (setq Info-history-forward history-forward)
1755 (goto-char opoint)))
1756
1757(defalias 'Info-last 'Info-history-back)
1758
1759(defun Info-history-forward ()
1760 "Go forward in the history of visited nodes."
1761 (interactive)
1762 (or Info-history-forward
1763 (error "This is the last Info node you looked at"))
1764 (let ((history-forward (cdr Info-history-forward))
1765 filename nodename opoint)
1766 (setq filename (car (car Info-history-forward)))
1767 (setq nodename (car (cdr (car Info-history-forward))))
1768 (setq opoint (car (cdr (cdr (car Info-history-forward)))))
1769 (Info-find-node filename nodename)
1770 (setq Info-history-forward history-forward)
1746 (goto-char opoint))) 1771 (goto-char opoint)))
1747 1772
1748;;;###autoload 1773;;;###autoload
@@ -2894,12 +2919,13 @@ if point is in a menu item description, follow that menu item."
2894 (define-key Info-mode-map "g" 'Info-goto-node) 2919 (define-key Info-mode-map "g" 'Info-goto-node)
2895 (define-key Info-mode-map "h" 'Info-help) 2920 (define-key Info-mode-map "h" 'Info-help)
2896 (define-key Info-mode-map "i" 'Info-index) 2921 (define-key Info-mode-map "i" 'Info-index)
2897 (define-key Info-mode-map "l" 'Info-last) 2922 (define-key Info-mode-map "l" 'Info-history-back)
2898 (define-key Info-mode-map "L" 'Info-history) 2923 (define-key Info-mode-map "L" 'Info-history)
2899 (define-key Info-mode-map "m" 'Info-menu) 2924 (define-key Info-mode-map "m" 'Info-menu)
2900 (define-key Info-mode-map "n" 'Info-next) 2925 (define-key Info-mode-map "n" 'Info-next)
2901 (define-key Info-mode-map "p" 'Info-prev) 2926 (define-key Info-mode-map "p" 'Info-prev)
2902 (define-key Info-mode-map "q" 'Info-exit) 2927 (define-key Info-mode-map "q" 'Info-exit)
2928 (define-key Info-mode-map "r" 'Info-history-forward)
2903 (define-key Info-mode-map "s" 'Info-search) 2929 (define-key Info-mode-map "s" 'Info-search)
2904 (define-key Info-mode-map "S" 'Info-search-case-sensitively) 2930 (define-key Info-mode-map "S" 'Info-search-case-sensitively)
2905 ;; For consistency with Rmail. 2931 ;; For consistency with Rmail.
@@ -2952,8 +2978,10 @@ if point is in a menu item description, follow that menu item."
2952 :help "Search for another occurrence of regular expression"] 2978 :help "Search for another occurrence of regular expression"]
2953 ["Go to Node..." Info-goto-node 2979 ["Go to Node..." Info-goto-node
2954 :help "Go to a named node"] 2980 :help "Go to a named node"]
2955 ["Last" Info-last :active Info-history 2981 ["Back in history" Info-history-back :active Info-history
2956 :help "Go to the last node you were at"] 2982 :help "Go back in history to the last node you were at"]
2983 ["Forward in history" Info-history-forward :active Info-history-forward
2984 :help "Go forward in history"]
2957 ["History" Info-history :active Info-history-list 2985 ["History" Info-history :active Info-history-list
2958 :help "Go to menu of visited nodes"] 2986 :help "Go to menu of visited nodes"]
2959 ["Table of Contents" Info-toc 2987 ["Table of Contents" Info-toc
@@ -2981,7 +3009,8 @@ if point is in a menu item description, follow that menu item."
2981 (tool-bar-local-item-from-menu 'Info-prev "left_arrow" map Info-mode-map) 3009 (tool-bar-local-item-from-menu 'Info-prev "left_arrow" map Info-mode-map)
2982 (tool-bar-local-item-from-menu 'Info-next "right_arrow" map Info-mode-map) 3010 (tool-bar-local-item-from-menu 'Info-next "right_arrow" map Info-mode-map)
2983 (tool-bar-local-item-from-menu 'Info-up "up_arrow" map Info-mode-map) 3011 (tool-bar-local-item-from-menu 'Info-up "up_arrow" map Info-mode-map)
2984 (tool-bar-local-item-from-menu 'Info-last "undo" map Info-mode-map) 3012 (tool-bar-local-item-from-menu 'Info-history-back "back_arrow" map Info-mode-map)
3013 (tool-bar-local-item-from-menu 'Info-history-forward "fwd_arrow" map Info-mode-map)
2985 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map) 3014 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
2986 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map) 3015 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map)
2987 (tool-bar-local-item-from-menu 'Info-goto-node "jump_to" map Info-mode-map) 3016 (tool-bar-local-item-from-menu 'Info-goto-node "jump_to" map Info-mode-map)
@@ -3101,7 +3130,8 @@ Selecting other nodes:
3101 Picking a menu item causes another node to be selected. 3130 Picking a menu item causes another node to be selected.
3102\\[Info-directory] Go to the Info directory node. 3131\\[Info-directory] Go to the Info directory node.
3103\\[Info-follow-reference] Follow a cross reference. Reads name of reference. 3132\\[Info-follow-reference] Follow a cross reference. Reads name of reference.
3104\\[Info-last] Move to the last node you were at. 3133\\[Info-history-back] Move back in history to the last node you were at.
3134\\[Info-history-forward] Move forward in history to the node you returned from after using \\[Info-history-back].
3105\\[Info-history] Go to menu of visited nodes. 3135\\[Info-history] Go to menu of visited nodes.
3106\\[Info-toc] Go to table of contents of the current Info file. 3136\\[Info-toc] Go to table of contents of the current Info file.
3107\\[Info-top-node] Go to the Top node of this file. 3137\\[Info-top-node] Go to the Top node of this file.
@@ -3158,6 +3188,7 @@ Advanced commands:
3158 (make-local-variable 'Info-tag-table-buffer) 3188 (make-local-variable 'Info-tag-table-buffer)
3159 (setq Info-tag-table-buffer nil) 3189 (setq Info-tag-table-buffer nil)
3160 (make-local-variable 'Info-history) 3190 (make-local-variable 'Info-history)
3191 (make-local-variable 'Info-history-forward)
3161 (make-local-variable 'Info-index-alternatives) 3192 (make-local-variable 'Info-index-alternatives)
3162 (setq header-line-format 3193 (setq header-line-format
3163 (if Info-use-header-line 3194 (if Info-use-header-line
@@ -3369,7 +3400,7 @@ COMMAND must be a symbol or string."
3369 (message "Found %d other entr%s. Use %s to see %s." 3400 (message "Found %d other entr%s. Use %s to see %s."
3370 (1- num-matches) 3401 (1- num-matches)
3371 (if (> num-matches 2) "ies" "y") 3402 (if (> num-matches 2) "ies" "y")
3372 (substitute-command-keys "\\[Info-last]") 3403 (substitute-command-keys "\\[Info-history-back]")
3373 (if (> num-matches 2) "them" "it"))))) 3404 (if (> num-matches 2) "them" "it")))))
3374 (error "Couldn't find documentation for %s" command)))) 3405 (error "Couldn't find documentation for %s" command))))
3375 3406