Function: info-xref-subfile-p

info-xref-subfile-p is a byte-compiled function defined in info-xref.el.gz.

Signature

(info-xref-subfile-p FILENAME)

Documentation

Return t if FILENAME is an info subfile.

If removing the last "-<NUM>" from the filename gives a file which exists, then consider FILENAME a subfile. This is an imperfect test, probably ought to open up the purported top file and see what subfiles it says.

Source Code

;; Defined in /usr/src/emacs/lisp/info-xref.el.gz
(defun info-xref-subfile-p (filename)
  "Return t if FILENAME is an info subfile.
If removing the last \"-<NUM>\" from the filename gives a file
which exists, then consider FILENAME a subfile.  This is an
imperfect test, probably ought to open up the purported top file
and see what subfiles it says."
  (let ((nondir (file-name-nondirectory filename)))
    (and (string-match "\\`\\(\\([^-]*-\\)*[^-]*\\)-[0-9]+\\(.*\\)\\'" nondir)
         (file-exists-p (concat (file-name-directory filename)
                                (match-string 1 nondir)
                                (match-string 3 nondir))))))