Function: woman-parse-colon-path

woman-parse-colon-path is a byte-compiled function defined in woman.el.gz.

Signature

(woman-parse-colon-path PATHS)

Documentation

Explode search path string PATHS into a list of directory names.

Allow Cygwin colon-separated search paths on Microsoft platforms. Replace null components by calling woman-parse-man.conf. As a special case, if PATHS is nil then replace it by calling woman-parse-man.conf.

Source Code

;; Defined in /usr/src/emacs/lisp/woman.el.gz
(defun woman-parse-colon-path (paths)
  "Explode search path string PATHS into a list of directory names.
Allow Cygwin colon-separated search paths on Microsoft platforms.
Replace null components by calling `woman-parse-man.conf'.
As a special case, if PATHS is nil then replace it by calling
`woman-parse-man.conf'."
  ;; Based on suggestions by Jari Aalto and Eli Zaretskii.
  ;; parse-colon-path returns nil for a null path component and
  ;; an empty substring of MANPATH denotes the default list.
  (if (memq system-type '(windows-nt ms-dos))
      (cond ((null paths)
	     (mapcar #'woman-Cyg-to-Win (woman-parse-man.conf)))
	    ((string-search ";" paths)
	     ;; Assume DOS-style path-list...
	     (mapcan			; splice list into list
	      (lambda (x)
		(if x
		    (list x)
		  (mapcar #'woman-Cyg-to-Win (woman-parse-man.conf))))
	      (parse-colon-path paths)))
	    ((string-match-p "\\`[a-zA-Z]:" paths)
	     ;; Assume single DOS-style path...
	     (list paths))
	    (t
	     ;; Assume UNIX/Cygwin-style path-list...
	     (mapcan			; splice list into list
	      (lambda (x)
		(mapcar #'woman-Cyg-to-Win
			(if x (list x) (woman-parse-man.conf))))
	      (let ((path-separator ":"))
		(parse-colon-path paths)))))
    ;; Assume host-default-style path-list...
    (mapcan				; splice list into list
     (lambda (x) (if x (list x) (woman-parse-man.conf)))
     (parse-colon-path (or paths "")))))