Function: psg-list-env

psg-list-env is a byte-compiled function defined in bib-cite.el.

Signature

(psg-list-env ENV)

Documentation

Return a list of directory elements in ENV variable (w/o leading $) argument may consist of environment variable plus a trailing directory, e.g. HOME or HOME/bin (trailing directory not supported in dos or OS/2).

bib-dos-or-os2-variable affects:
  path separator used (: or ;)
  whether backslashes are converted to slashes

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/bib-cite.el
(defun psg-list-env (env)
  "Return a list of directory elements in ENV variable (w/o leading $)
argument may consist of environment variable plus a trailing directory, e.g.
HOME or HOME/bin (trailing directory not supported in dos or OS/2).

`bib-dos-or-os2-variable' affects:
  path separator used (: or ;)
  whether backslashes are converted to slashes"
  (if (not (getenv env))
      nil                               ;Because replace-regexp-in-string fails
    (let* ((value (if bib-dos-or-os2-variable
                      (replace-regexp-in-string "\\\\" "/" (getenv env) t t)
                    (getenv env)))
           (sep-char (or (and bib-dos-or-os2-variable ";") ":"))
           (entries (split-string value sep-char)))
      (cl-loop for x in entries if (bib-cite-file-directory-p x) collect x))))