From 538e85c63902c82983dcdd063b6c5c3d78359517 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 7 Jul 2011 16:35:28 -0400 Subject: [PATCH] Document some Info functions (Bug#1084). * lisp/info.el (info, Info-read-node-name-2, Info-read-node-name-1) (Info-read-node-name): Doc fix. --- lisp/ChangeLog | 3 +++ lisp/info.el | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d484c06207b..84514675b41 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-07-07 Chong Yidong + * 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) diff --git a/lisp/info.el b/lisp/info.el index 158f6929a7a..29daac566d1 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -621,7 +621,7 @@ in `Info-file-supports-index-cookies-list'." 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 @@ -1572,7 +1572,12 @@ If FORK is a string, it is the name to use for the 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)))) @@ -1602,10 +1607,9 @@ If FORK is a string, it is the name to use for the new buffer." (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) @@ -1618,7 +1622,6 @@ If FORK is a string, it is the name to use for the new buffer." (substring string 1) predicate code)) - ;; If a file name was given, then any node is fair game. ((string-match "\\`(" string) (cond @@ -1630,9 +1633,10 @@ If FORK is a string, it is the name to use for the new buffer." 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)))