aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/info.el66
2 files changed, 40 insertions, 34 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f508d70515f..691a611178c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12000-08-11 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * info.el (Info-find-emacs-command-nodes): Rewrite to use
4 technique similar to Info-index, instead of relying on specific
5 names of relevant Index nodes.
6 (Info-goto-emacs-command-node): Bind Info-history to nil when
7 going to the first node found by Info-find-emacs-command-nodes.
8
12000-08-11 eliz <eliz@is.elta.co.il> 92000-08-11 eliz <eliz@is.elta.co.il>
2 10
3 * menu-bar.el (menu-bar-help-menu): Add a :help string. 11 * menu-bar.el (menu-bar-help-menu): Add a :help string.
diff --git a/lisp/info.el b/lisp/info.el
index 62482127f85..eb71449e6c4 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2194,7 +2194,7 @@ The locations are of the format used in `Info-history', i.e.
2194\(FILENAME NODENAME BUFFERPOS\)." 2194\(FILENAME NODENAME BUFFERPOS\)."
2195 (let ((where '()) 2195 (let ((where '())
2196 (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command)) 2196 (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command))
2197 ":\\s *\\(.*\\)\\.$")) 2197 "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\.$"))
2198 (info-file "emacs")) ;default 2198 (info-file "emacs")) ;default
2199 ;; Determine which info file this command is documented in. 2199 ;; Determine which info file this command is documented in.
2200 (if (get command 'info-file) 2200 (if (get command 'info-file)
@@ -2213,36 +2213,30 @@ The locations are of the format used in `Info-history', i.e.
2213 (if (string-match regexp (symbol-name command)) 2213 (if (string-match regexp (symbol-name command))
2214 (setq info-file file file-list nil)) 2214 (setq info-file file file-list nil))
2215 (setq file-list (cdr file-list)))))) 2215 (setq file-list (cdr file-list))))))
2216 (save-excursion 2216 (Info-find-node info-file "Top")
2217 (condition-case nil 2217 (or (and (search-forward "\n* menu:" nil t)
2218 (Info-find-node info-file "Command Index") 2218 (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t))
2219 ;; Some manuals may not have a separate Command Index node, 2219 (error "Info file `%s' appears to lack an index" info-file))
2220 ;; so try other variations as well. 2220 (goto-char (match-beginning 1))
2221 (error 2221 ;; Bind Info-history to nil, to prevent the index nodes from
2222 (condition-case nil 2222 ;; getting into the node history.
2223 (Info-find-node info-file "Function Index") 2223 (let ((Info-history nil)
2224 (error 2224 (exact nil)
2225 (condition-case nil 2225 node found)
2226 (Info-find-node info-file "Function and Variable Index") 2226 (Info-goto-node (Info-extract-menu-node-name))
2227 (error 2227 (while
2228 (condition-case nil 2228 (progn
2229 (Info-find-node info-file "Concept Index") 2229 (goto-char (point-min))
2230 (error 2230 (while (re-search-forward cmd-desc nil t)
2231 (condition-case nil 2231 (setq where
2232 (Info-find-node info-file "Index") 2232 (cons (list Info-current-file
2233 (error 2233 (match-string-no-properties 2)
2234 (message "Info file `%s' seems to lack an Index"
2235 info-file)
2236 (sit-for 2)))))))))))
2237 ;; Take the index node off the Info history.
2238 (setq Info-history (cdr Info-history))
2239 (goto-char (point-max))
2240 (while (re-search-backward cmd-desc nil t)
2241 (setq where (cons (list Info-current-file
2242 (match-string-no-properties 1)
2243 0) 2234 0)
2244 where))) 2235 where)))
2245 where))) 2236 (and (setq node (Info-extract-pointer "next" t))
2237 (string-match "\\<Index\\>" node)))
2238 (Info-goto-node node)))
2239 where))
2246 2240
2247;;;###autoload 2241;;;###autoload
2248(defun Info-goto-emacs-command-node (command) 2242(defun Info-goto-emacs-command-node (command)
@@ -2262,13 +2256,17 @@ the variable `Info-file-list-for-emacs'."
2262 ;; FIXME It would be cool if this could use a buffer other 2256 ;; FIXME It would be cool if this could use a buffer other
2263 ;; than *info*. 2257 ;; than *info*.
2264 (pop-to-buffer "*info*") 2258 (pop-to-buffer "*info*")
2265 (Info-find-node (car (car where)) 2259 ;; Bind Info-history to nil, to prevent the last Index node
2266 (car (cdr (car where)))) 2260 ;; visited by Info-find-emacs-command-nodes from being
2261 ;; pushed onto the history.
2262 (let ((Info-history nil))
2263 (Info-find-node (car (car where))
2264 (car (cdr (car where)))))
2267 (if (> num-matches 1) 2265 (if (> num-matches 1)
2268 (progn 2266 (progn
2269 ;; Info-find-node already pushed (car where) onto 2267 ;; (car where) will be pushed onto Info-history
2270 ;; Info-history. Put the other nodes that were found on 2268 ;; when/if they go to another node. Put the other
2271 ;; the history. 2269 ;; nodes that were found on the history.
2272 (setq Info-history (nconc (cdr where) Info-history)) 2270 (setq Info-history (nconc (cdr where) Info-history))
2273 (message "Found %d other entr%s. Use %s to see %s." 2271 (message "Found %d other entr%s. Use %s to see %s."
2274 (1- num-matches) 2272 (1- num-matches)