Function: parse-colon-path
parse-colon-path is a byte-compiled function defined in files.el.gz.
Signature
(parse-colon-path SEARCH-PATH)
Documentation
Explode a search path into a list of directory names.
Directories are separated by path-separator(var)/path-separator(fun) (which is colon in
GNU and Unix systems). Substitute environment variables into the
resulting list of directory names. For an empty path element (i.e.,
a leading or trailing separator, or two adjacent separators), return
nil (meaning default-directory) as the associated list element.
Source Code
;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun parse-colon-path (search-path)
"Explode a search path into a list of directory names.
Directories are separated by `path-separator' (which is colon in
GNU and Unix systems). Substitute environment variables into the
resulting list of directory names. For an empty path element (i.e.,
a leading or trailing separator, or two adjacent separators), return
nil (meaning `default-directory') as the associated list element."
(when (stringp search-path)
(let ((spath (substitute-env-vars search-path)))
(mapcar (lambda (f)
(if (equal "" f) nil
(let ((dir (file-name-as-directory f)))
;; Previous implementation used `substitute-in-file-name'
;; which collapse multiple "/" in front. Do the same for
;; backward compatibility.
(if (string-match "\\`/+" dir)
(substring dir (1- (match-end 0))) dir))))
(split-string spath path-separator)))))