diff options
author | Chong Yidong <[email protected]> | 2012-09-16 23:57:28 +0800 |
---|---|---|
committer | Chong Yidong <[email protected]> | 2012-09-16 23:57:28 +0800 |
commit | 1667e065d0720c65efc0c5385b9efb9f75b318c1 (patch) | |
tree | 5feebf2444df12fe98282525842ac8ac61296596 /lisp | |
parent | ba13e6168a07a085c0ca8e67c91640b84ee0c1fd (diff) |
* files.el (parse-colon-path): Use split-string.
Fixes: debbugs:12351
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 2 | ||||
-rw-r--r-- | lisp/files.el | 23 |
2 files changed, 9 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a7538e50d8..b444761e55 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-16 Chong Yidong <[email protected]> + * files.el (parse-colon-path): Use split-string (Bug#12351). + * window.el (special-display-popup-frame): Doc fix (Bug#8853). (display-buffer-function): Mark as obsolete. diff --git a/lisp/files.el b/lisp/files.el index 4acdb54208..289f5c6b0b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -658,22 +658,13 @@ Not actually set up until the first time you use it.") (defun parse-colon-path (search-path) "Explode a search path into a list of directory names. -Directories are separated by occurrences of `path-separator' -\(which is colon in GNU and GNU-like systems)." - ;; We could use split-string here. - (and search-path - (let (cd-list (cd-start 0) cd-colon) - (setq search-path (concat search-path path-separator)) - (while (setq cd-colon (string-match path-separator search-path cd-start)) - (setq cd-list - (nconc cd-list - (list (if (= cd-start cd-colon) - nil - (substitute-in-file-name - (file-name-as-directory - (substring search-path cd-start cd-colon))))))) - (setq cd-start (+ cd-colon 1))) - cd-list))) +Directories are separated by `path-separator' (which is colon in +GNU and Unix systems). Substitute environment variables into the +resulting list of directory names." + (when (stringp search-path) + (mapcar (lambda (f) + (substitute-in-file-name (file-name-as-directory f))) + (split-string search-path path-separator t)))) (defun cd-absolute (dir) "Change current directory to given absolute file name DIR." |