summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-04-30 02:08:56 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-04-30 02:08:56 +0000
commit365d2503ce8ab1d3f9cd813d14631c38e81bba06 (patch)
tree3fc267c5231de3b02f4400d22360de5ae20448fe /lisp/info.el
parent78b3d0f7204777ac38a8027283aea1503b01d024 (diff)
downloademacs-365d2503ce8ab1d3f9cd813d14631c38e81bba06.tar.gz
(Info-find-in-tag-table-1, Info-read-subfile): Use point-min.
(Info-read-node-name-1): Complete file names. (Info-complete-menu-item): Don't cons unnecessarily.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el49
1 files changed, 32 insertions, 17 deletions
diff --git a/lisp/info.el b/lisp/info.el
index e4211c134c6..4fe0970ea80 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -539,7 +539,7 @@ which the match was found."
(beginning-of-line)
(when (re-search-forward regexp nil t)
(list (string-equal "Ref:" (match-string 1))
- (1+ (read (current-buffer)))
+ (+ (point-min) (read (current-buffer)))
major-mode)))))
(defun Info-find-in-tag-table (marker regexp)
@@ -929,7 +929,7 @@ a case-insensitive match is tried."
thisfilepos thisfilename)
(search-forward ": ")
(setq thisfilename (buffer-substring beg (- (point) 2)))
- (setq thisfilepos (read (current-buffer)))
+ (setq thisfilepos (+ (point-min) (read (current-buffer))))
;; read in version 19 stops at the end of number.
;; Advance to the next line.
(forward-line 1)
@@ -1074,19 +1074,35 @@ If FORK is a string, it is the name to use for the new buffer."
;; It does completion using the alist in Info-read-node-completion-table
;; unless STRING starts with an open-paren.
(defun Info-read-node-name-1 (string predicate code)
- (let ((no-completion (and (> (length string) 0) (eq (aref string 0) ?\())))
- (cond ((eq code nil)
- (if no-completion
- string
- (try-completion string Info-read-node-completion-table predicate)))
- ((eq code t)
- (if no-completion
- nil
- (all-completions string Info-read-node-completion-table predicate)))
- ((eq code 'lambda)
- (if no-completion
- t
- (assoc string Info-read-node-completion-table))))))
+ (cond
+ ;; First complete embedded file names.
+ ((string-match "\\`([^)]*\\'" string)
+ (let ((file (substring string 1)))
+ (cond
+ ((eq code nil)
+ (let ((comp (try-completion file 'locate-file-completion
+ (cons Info-directory-list
+ (mapcar 'car Info-suffix-list)))))
+ (cond
+ ((eq comp t) (concat string ")"))
+ (comp (concat "(" comp)))))
+ ((eq code t) (all-completions file 'locate-file-completion
+ (cons Info-directory-list
+ (mapcar 'car Info-suffix-list))))
+ (t nil))))
+ ;; If a file name was given, then any node is fair game.
+ ((string-match "\\`(" string)
+ (cond
+ ((eq code nil) string)
+ ((eq code t) nil)
+ (t t)))
+ ;; Otherwise use Info-read-node-completion-table.
+ ((eq code nil)
+ (try-completion string Info-read-node-completion-table predicate))
+ ((eq code t)
+ (all-completions string Info-read-node-completion-table predicate))
+ (t
+ (test-completion string Info-read-node-completion-table predicate))))
(defun Info-read-node-name (prompt &optional default)
(let* ((completion-ignore-case t)
@@ -1443,8 +1459,7 @@ FOOTNOTENAME may be an abbreviation of the reference name."
(while
(progn
(while (re-search-forward pattern nil t)
- (push (cons (match-string-no-properties 1)
- (match-beginning 1))
+ (push (match-string-no-properties 1)
completions))
;; Check subsequent nodes if applicable.
(and Info-complete-next-re