diff options
| author | Richard M. Stallman | 1995-08-05 20:56:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-08-05 20:56:23 +0000 |
| commit | 03524be63ae2a8d72fce0652208a57f1fc788edb (patch) | |
| tree | 087b6d4d42e4d02343c5e62d5fa0fb4ac5ce24cd | |
| parent | a2964053573a757212e5a884475ee654a886bc15 (diff) | |
| download | emacs-03524be63ae2a8d72fce0652208a57f1fc788edb.tar.gz emacs-03524be63ae2a8d72fce0652208a57f1fc788edb.zip | |
(Info-read-node-name-1): New function.
(Info-read-node-name): Use Info-read-node-name-1
to avoid getting confused by spaces when text starts with (FILENAME).
| -rw-r--r-- | lisp/info.el | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lisp/info.el b/lisp/info.el index fd08a00e25e..6c079f9fc99 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -605,9 +605,28 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." | |||
| 605 | (Info-find-node (if (equal filename "") nil filename) | 605 | (Info-find-node (if (equal filename "") nil filename) |
| 606 | (if (equal nodename "") "Top" nodename)))) | 606 | (if (equal nodename "") "Top" nodename)))) |
| 607 | 607 | ||
| 608 | ;; This function is used as the "completion table" while reading a node name. | ||
| 609 | ;; It does completion using the alist in completion-table | ||
| 610 | ;; unless STRING starts with an open-paren. | ||
| 611 | (defun Info-read-node-name-1 (string predicate code) | ||
| 612 | (let ((no-completion (and (> (length string) 0) (eq (aref string 0) ?\()))) | ||
| 613 | (cond ((eq code nil) | ||
| 614 | (if no-completion | ||
| 615 | string | ||
| 616 | (try-completion string completion-table predicate))) | ||
| 617 | ((eq code t) | ||
| 618 | (if no-completion | ||
| 619 | nil | ||
| 620 | (all-completions string completion-table predicate))) | ||
| 621 | ((eq code 'lambda) | ||
| 622 | (if no-completion | ||
| 623 | t | ||
| 624 | (assoc string completion-table)))))) | ||
| 625 | |||
| 608 | (defun Info-read-node-name (prompt &optional default) | 626 | (defun Info-read-node-name (prompt &optional default) |
| 609 | (let* ((completion-ignore-case t) | 627 | (let* ((completion-ignore-case t) |
| 610 | (nodename (completing-read prompt (Info-build-node-completions)))) | 628 | (completion-table (Info-build-node-completions)) |
| 629 | (nodename (completing-read prompt 'Info-read-node-name-1))) | ||
| 611 | (if (equal nodename "") | 630 | (if (equal nodename "") |
| 612 | (or default | 631 | (or default |
| 613 | (Info-read-node-name prompt)) | 632 | (Info-read-node-name prompt)) |