diff options
| author | Richard M. Stallman | 1993-05-24 21:45:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-24 21:45:20 +0000 |
| commit | 9daefb36fa8227ef08527c11709b7986123410ca (patch) | |
| tree | a4e4dd1ee5db5e37cd0786920a7085991e7af561 | |
| parent | 7ee260fe399f7b761f2b693884ef565abd7fa1b7 (diff) | |
| download | emacs-9daefb36fa8227ef08527c11709b7986123410ca.tar.gz emacs-9daefb36fa8227ef08527c11709b7986123410ca.zip | |
(cd): Set cd-path to a list.
| -rw-r--r-- | lisp/files.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/files.el b/lisp/files.el index 6a207dbec7b..32ef61a6277 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -246,7 +246,10 @@ Not actually set up until the first time you you use it.") | |||
| 246 | (setq cd-path (concat cd-path ":")) | 246 | (setq cd-path (concat cd-path ":")) |
| 247 | (while (setq cd-colon (string-match ":" cd-path cd-start)) | 247 | (while (setq cd-colon (string-match ":" cd-path cd-start)) |
| 248 | (setq cd-list | 248 | (setq cd-list |
| 249 | (nconc cd-list (list (substitute-in-file-name (file-name-as-directory (substring cd-path cd-start cd-colon)))))) | 249 | (nconc cd-list |
| 250 | (list (substitute-in-file-name | ||
| 251 | (file-name-as-directory | ||
| 252 | (substring cd-path cd-start cd-colon)))))) | ||
| 250 | (setq cd-start (+ cd-colon 1))) | 253 | (setq cd-start (+ cd-colon 1))) |
| 251 | cd-list))) | 254 | cd-list))) |
| 252 | 255 | ||
| @@ -260,8 +263,7 @@ Not actually set up until the first time you you use it.") | |||
| 260 | (error "%s is not a directory" dir) | 263 | (error "%s is not a directory" dir) |
| 261 | (if (file-executable-p dir) | 264 | (if (file-executable-p dir) |
| 262 | (setq default-directory dir) | 265 | (setq default-directory dir) |
| 263 | (error "Cannot cd to %s: Permission denied" dir))) | 266 | (error "Cannot cd to %s: Permission denied" dir)))) |
| 264 | ) | ||
| 265 | 267 | ||
| 266 | (defun cd (dir) | 268 | (defun cd (dir) |
| 267 | "Make DIR become the current buffer's default directory. | 269 | "Make DIR become the current buffer's default directory. |
| @@ -273,7 +275,7 @@ colon-separated list of directories when resolving a relative cd." | |||
| 273 | (cd-absolute (expand-file-name dir)) | 275 | (cd-absolute (expand-file-name dir)) |
| 274 | (if (null cd-path) | 276 | (if (null cd-path) |
| 275 | (let ((trypath (parse-colon-path (getenv "CDPATH")))) | 277 | (let ((trypath (parse-colon-path (getenv "CDPATH")))) |
| 276 | (setq cd-path (or trypath "./")))) | 278 | (setq cd-path (or trypath (list "./"))))) |
| 277 | (if (not (catch 'found | 279 | (if (not (catch 'found |
| 278 | (mapcar | 280 | (mapcar |
| 279 | (function (lambda (x) | 281 | (function (lambda (x) |