Function: Info-read-node-name-2

Info-read-node-name-2 is a byte-compiled function defined in info.el.gz.

Signature

(Info-read-node-name-2 DIRS SUFFIXES STRING PRED ACTION)

Documentation

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.

Source Code

;; Defined in /usr/src/emacs/lisp/info.el.gz
(defun Info-read-node-name-2 (dirs suffixes string pred action)
  "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))
  (let ((names nil)
        (suffix (concat (regexp-opt suffixes t) "\\'")))
    (dolist (dir dirs)
      (when (file-directory-p dir)
        (dolist (file (directory-files dir))
          ;; If the file name has a standard suffix,
          ;; include it (without the suffix).
          (when (and (string-match suffix file)
                     ;; But exclude subfiles of split Info files.
                     (not (string-match "\\.info-[0-9]+" file))
                     ;; And exclude backup files.
                     (not (string-match "~\\'" file)))
            (push (substring file 0 (match-beginning 0))
                  names)))))
    (complete-with-action action (delete-dups (nreverse names))
                          string pred)))