Function: info-initialize
info-initialize is a byte-compiled function defined in info.el.gz.
Signature
(info-initialize)
Documentation
Initialize Info-directory-list, if that hasn't been done yet.
Source Code
;; Defined in /usr/src/emacs/lisp/info.el.gz
Info-default-directory-list)))) ;; )))
(defun info-initialize ()
"Initialize `Info-directory-list', if that hasn't been done yet."
(unless Info-directory-list
(let ((path (getenv "INFOPATH"))
(sep (regexp-quote path-separator)))
(setq Info-directory-list
(prune-directory-list
(if path
(if (string-match-p (concat sep "\\'") path)
(append (split-string (substring path 0 -1) sep)
(Info-default-dirs))
(split-string path sep))
(Info-default-dirs))))
;; For a self-contained (ie relocatable) NS build, AFAICS we
;; always want the included info directory to be at the head of
;; the search path, unless it's already in INFOPATH somewhere.
;; It's at the head of Info-default-directory-list,
;; but there's no way to get it at the head of Info-directory-list
;; except by doing it here.
(and path
(featurep 'ns)
(let ((dir (expand-file-name "../info" data-directory)))
(and (file-directory-p dir)
(not (member dir (split-string path ":" t)))
(push dir Info-directory-list)))))))