aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/info.el
diff options
context:
space:
mode:
authorRichard M. Stallman1996-02-12 20:57:39 +0000
committerRichard M. Stallman1996-02-12 20:57:39 +0000
commit920bdaabcce9864fc96c46e55ebcfe30cb727e2b (patch)
treee91b302a8ab7bbcbc11b25b6be1ca22451b6cfc6 /lisp/info.el
parent15f0cf78163b3e59f4e325c7555ea988f668f06a (diff)
downloademacs-920bdaabcce9864fc96c46e55ebcfe30cb727e2b.tar.gz
emacs-920bdaabcce9864fc96c46e55ebcfe30cb727e2b.zip
(Info-find-index-name): New subroutine, from Info-index-next.
Match any type of definition, not just Function and Command. (Info-index-next): Use Info-find-index-name. (Info-find-node, Info-index, Info-index-next): Use `...' in err msgs.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el32
1 files changed, 18 insertions, 14 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 54c383eb2ed..62d87b3a7c1 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -374,7 +374,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
374 (if (not (eq (current-buffer) (get-buffer "*info*"))) 374 (if (not (eq (current-buffer) (get-buffer "*info*")))
375 (setq guesspos 375 (setq guesspos
376 (Info-read-subfile guesspos)))) 376 (Info-read-subfile guesspos))))
377 (error "No such node: \"%s\"" nodename)))) 377 (error "No such node: `%s'" nodename))))
378 (goto-char (max (point-min) (- guesspos 1000))) 378 (goto-char (max (point-min) (- guesspos 1000)))
379 ;; Now search from our advised position (or from beg of buffer) 379 ;; Now search from our advised position (or from beg of buffer)
380 ;; to find the actual node. 380 ;; to find the actual node.
@@ -1328,7 +1328,7 @@ Give a blank topic name to go to the Index node itself."
1328 (or matches 1328 (or matches
1329 (progn 1329 (progn
1330 (Info-last) 1330 (Info-last)
1331 (error "No \"%s\" in index" topic))) 1331 (error "No `%s' in index" topic)))
1332 ;; Here it is a feature that assoc is case-sensitive. 1332 ;; Here it is a feature that assoc is case-sensitive.
1333 (while (setq found (assoc topic matches)) 1333 (while (setq found (assoc topic matches))
1334 (setq exact (cons found exact) 1334 (setq exact (cons found exact)
@@ -1353,24 +1353,28 @@ Give a blank topic name to go to the Index node itself."
1353 (forward-line (nth 3 (car Info-index-alternatives))) 1353 (forward-line (nth 3 (car Info-index-alternatives)))
1354 (forward-line 3) ; don't search in headers 1354 (forward-line 3) ; don't search in headers
1355 (let ((name (car (car Info-index-alternatives)))) 1355 (let ((name (car (car Info-index-alternatives))))
1356 (if (or (re-search-forward (format 1356 (Info-find-index-name name)))
1357 "\\(Function\\|Command\\): %s\\( \\|$\\)" 1357 (message "Found `%s' in %s. %s"
1358 (regexp-quote name)) nil t)
1359 (search-forward (format "`%s'" name) nil t)
1360 (and (string-match "\\`.*\\( (.*)\\)\\'" name)
1361 (search-forward
1362 (format "`%s'" (substring name 0 (match-beginning 1)))
1363 nil t))
1364 (search-forward name nil t))
1365 (beginning-of-line)
1366 (goto-char (point-min)))))
1367 (message "Found \"%s\" in %s. %s"
1368 (car (car Info-index-alternatives)) 1358 (car (car Info-index-alternatives))
1369 (nth 2 (car Info-index-alternatives)) 1359 (nth 2 (car Info-index-alternatives))
1370 (if (cdr Info-index-alternatives) 1360 (if (cdr Info-index-alternatives)
1371 "(Press `,' for more)" 1361 "(Press `,' for more)"
1372 "(Only match)"))) 1362 "(Only match)")))
1373 1363
1364(defun Info-find-index-name (name)
1365 "Move point to the place within the current node where NAME is defined."
1366 (if (or (re-search-forward (format
1367 "[a-zA-Z]+: %s\\( \\|$\\)"
1368 (regexp-quote name)) nil t)
1369 (search-forward (format "`%s'" name) nil t)
1370 (and (string-match "\\`.*\\( (.*)\\)\\'" name)
1371 (search-forward
1372 (format "`%s'" (substring name 0 (match-beginning 1)))
1373 nil t))
1374 (search-forward name nil t))
1375 (beginning-of-line)
1376 (goto-char (point-min))))
1377
1374(defun Info-undefined () 1378(defun Info-undefined ()
1375 "Make command be undefined in Info." 1379 "Make command be undefined in Info."
1376 (interactive) 1380 (interactive)