2011-07-07 Chong Yidong <cyd@stupidchicken.com>
+ * info.el (info, Info-read-node-name-2, Info-read-node-name-1)
+ (Info-read-node-name): Doc fix (Bug#1084).
+
* thingatpt.el (forward-thing, bounds-of-thing-at-point)
(thing-at-point, beginning-of-thing, end-of-thing, in-string-p)
(end-of-sexp, beginning-of-sexp)
Optional argument FILE-OR-NODE specifies the file to examine;
the default is the top-level directory of Info.
Called from a program, FILE-OR-NODE may specify an Info node of the form
-`(FILENAME)NODENAME'.
+\"(FILENAME)NODENAME\".
Optional argument BUFFER specifies the Info buffer name;
the default buffer name is *info*. If BUFFER exists,
just switch to BUFFER. Otherwise, create a new buffer
(defvar Info-read-node-completion-table)
(defun Info-read-node-name-2 (dirs suffixes string pred action)
- "Virtual completion table for file names input in Info node names."
+ "Internal function used to complete Info node names.
+Return a completion table for Info files---the FILENAME part of a
+node named \"(FILENAME)NODENAME\". DIRS is a list of Info
+directories to search if FILENAME is not absolute; SUFFIXES is a
+list of valid filename suffixes for Info files. See
+`try-completion' for a description of the remaining arguments."
(setq suffixes (remove "" suffixes))
(when (file-name-absolute-p string)
(setq dirs (list (file-name-directory string))))
(push (if string-dir (concat string-dir file) file) names)))))
(complete-with-action action names string pred)))
-;; This function is used as the "completion table" while reading a node name.
-;; 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)
+ "Internal function used by `Info-read-node-name'.
+See `completing-read' for a description of arguments and usage."
(cond
;; First complete embedded file names.
((string-match "\\`([^)]*\\'" string)
(substring string 1)
predicate
code))
-
;; If a file name was given, then any node is fair game.
((string-match "\\`(" string)
(cond
code Info-read-node-completion-table string predicate))))
;; Arrange to highlight the proper letters in the completion list buffer.
-
-
(defun Info-read-node-name (prompt)
+ "Read an Info node name with completion, prompting with PROMPT.
+A node name can have the form \"NODENAME\", referring to a node
+in the current Info file, or \"(FILENAME)NODENAME\"."
(let* ((completion-ignore-case t)
(Info-read-node-completion-table (Info-build-node-completions))
(nodename (completing-read prompt 'Info-read-node-name-1 nil t)))