469 |
that really does change some file names to canonicalize certain |
that really does change some file names to canonicalize certain |
470 |
patterns and to guarantee valid names." |
patterns and to guarantee valid names." |
471 |
filename) |
filename) |
472 |
|
|
473 |
|
(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) |
474 |
|
"Read directory name, prompting with PROMPT and completing in directory DIR. |
475 |
|
Value is not expanded---you must call `expand-file-name' yourself. |
476 |
|
Default name to DEFAULT-DIRNAME if user enters a null string. |
477 |
|
(If DEFAULT-DIRNAME is omitted, the current buffer's directory is used, |
478 |
|
except that if INITIAL is specified, that combined with DIR is used.) |
479 |
|
Fourth arg MUSTMATCH non-nil means require existing directory's name. |
480 |
|
Non-nil and non-t means also require confirmation after completion. |
481 |
|
Fifth arg INITIAL specifies text to start with. |
482 |
|
DIR defaults to current buffer's directory default." |
483 |
|
(unless dir |
484 |
|
(setq dir default-directory)) |
485 |
|
(unless default-dirname |
486 |
|
(setq default-dirname |
487 |
|
(if initial (concat dir initial) default-directory))) |
488 |
|
(read-file-name prompt dir default-dirname mustmatch initial |
489 |
|
'file-directory-p)) |
490 |
|
|
491 |
|
|
492 |
(defun pwd () |
(defun pwd () |
493 |
"Show the current default directory." |
"Show the current default directory." |
536 |
If your environment includes a `CDPATH' variable, try each one of that |
If your environment includes a `CDPATH' variable, try each one of that |
537 |
colon-separated list of directories when resolving a relative directory name." |
colon-separated list of directories when resolving a relative directory name." |
538 |
(interactive |
(interactive |
539 |
(list (read-file-name "Change default directory: " |
(list (read-directory-name "Change default directory: " |
540 |
default-directory default-directory |
default-directory default-directory |
541 |
(and (member cd-path '(nil ("./"))) |
(and (member cd-path '(nil ("./"))) |
542 |
(null (getenv "CDPATH")))))) |
(null (getenv "CDPATH")))))) |