# HG changeset patch # User Juri Linkov # Date 1135374720 0 # Node ID 0c0bb618627a8819599a82bd7a4e39dfb64c2064 # Parent 8eda669e26197767f05f7130c295f7c04e41de6c (info-other-window, info): Rename function argument `file' to `file-or-node'. (Info-complete-menu-item): Use local variable `complete-nodes' to keep the global value of `Info-complete-nodes' unchanged for subsequent completions. (info-tool-bar-map): Put `Info-index' icon just before `Info-search'. diff -r 8eda669e2619 -r 0c0bb618627a lisp/info.el --- a/lisp/info.el Fri Dec 23 21:50:38 2005 +0000 +++ b/lisp/info.el Fri Dec 23 21:52:00 2005 +0000 @@ -521,22 +521,22 @@ (Info-default-dirs))))))) ;;;###autoload -(defun info-other-window (&optional file) +(defun info-other-window (&optional file-or-node) "Like `info' but show the Info buffer in another window." (interactive (if current-prefix-arg (list (read-file-name "Info file name: " nil nil t)))) (let (same-window-buffer-names same-window-regexps) - (info file))) + (info file-or-node))) ;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)") ;;;###autoload (put 'info 'info-file "emacs") ;;;###autoload -(defun info (&optional file buffer) +(defun info (&optional file-or-node buffer) "Enter Info, the documentation browser. -Optional argument FILE specifies the file to examine; +Optional argument FILE-OR-NODE specifies the file to examine; the default is the top-level directory of Info. -Called from a program, FILE may specify an Info node of the form +Called from a program, FILE-OR-NODE may specify an Info node of the form `(FILENAME)NODENAME'. Optional argument BUFFER specifies the Info buffer name; the default buffer name is *info*. If BUFFER exists, @@ -559,15 +559,15 @@ (pop-to-buffer (or buffer "*info*")) (if (and buffer (not (eq major-mode 'Info-mode))) (Info-mode)) - (if file + (if file-or-node ;; If argument already contains parentheses, don't add another set ;; since the argument will then be parsed improperly. This also ;; has the added benefit of allowing node names to be included ;; following the parenthesized filename. (Info-goto-node - (if (and (stringp file) (string-match "(.*)" file)) - file - (concat "(" file ")"))) + (if (and (stringp file-or-node) (string-match "(.*)" file-or-node)) + file-or-node + (concat "(" file-or-node ")"))) (if (zerop (buffer-size)) (Info-directory)))) @@ -2260,7 +2260,8 @@ (let ((pattern (concat "\n\\* +\\(" (regexp-quote string) Info-menu-entry-name-re "\\):" Info-node-spec-re)) - completions) + completions + (complete-nodes Info-complete-nodes)) ;; Check the cache. (if (and (equal (nth 0 Info-complete-cache) Info-current-file) (equal (nth 1 Info-complete-cache) Info-current-node) @@ -2281,9 +2282,9 @@ (or (and Info-complete-next-re (setq nextnode (Info-extract-pointer "next" t)) (string-match Info-complete-next-re nextnode)) - (and Info-complete-nodes - (setq Info-complete-nodes (cdr Info-complete-nodes) - nextnode (car Info-complete-nodes))))) + (and complete-nodes + (setq complete-nodes (cdr complete-nodes) + nextnode (car complete-nodes))))) (Info-goto-node nextnode)) ;; Go back to the start node (for the next completion). (unless (equal Info-current-node orignode) @@ -3192,8 +3193,8 @@ (tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map) (tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map) (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map) + (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map) (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map) - (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map) (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map) map)))