diff options
| author | Jan Djärv | 2004-11-02 07:57:53 +0000 |
|---|---|---|
| committer | Jan Djärv | 2004-11-02 07:57:53 +0000 |
| commit | 46bfc73bed2e2b6b3cdfff43f82c6705fb89355c (patch) | |
| tree | fb8175d3c78aecf36b01e4749de6728af0411b84 /lisp/files.el | |
| parent | 95ec60bcbf3f89bd6c72c989a3510da8c0b96f9a (diff) | |
| download | emacs-46bfc73bed2e2b6b3cdfff43f82c6705fb89355c.tar.gz emacs-46bfc73bed2e2b6b3cdfff43f82c6705fb89355c.zip | |
* files.el (find-file-existing): New function.
* menu-bar.el (menu-bar-files-menu): Make "Open File..." call
find-file-existing. Add "New File..." that calls find-file.
* dired.el (dired-read-dir-and-switches): Call read-driectory-name
instead of read-file-name.
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index f10281a0d10..888f9dc81e9 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -977,6 +977,14 @@ expand wildcards (if any) and visit multiple files." | |||
| 977 | (mapcar 'switch-to-buffer (cdr value))) | 977 | (mapcar 'switch-to-buffer (cdr value))) |
| 978 | (switch-to-buffer-other-frame value)))) | 978 | (switch-to-buffer-other-frame value)))) |
| 979 | 979 | ||
| 980 | (defun find-file-existing (filename &optional wildcards) | ||
| 981 | "Edit the existing file FILENAME. | ||
| 982 | Like \\[find-file] but only allow files that exists." | ||
| 983 | (interactive (find-file-read-args "Find existing file: " t)) | ||
| 984 | (unless (file-exists-p filename) (error "%s does not exist" filename)) | ||
| 985 | (find-file filename wildcards) | ||
| 986 | (current-buffer)) | ||
| 987 | |||
| 980 | (defun find-file-read-only (filename &optional wildcards) | 988 | (defun find-file-read-only (filename &optional wildcards) |
| 981 | "Edit file FILENAME but don't allow changes. | 989 | "Edit file FILENAME but don't allow changes. |
| 982 | Like \\[find-file] but marks buffer as read-only. | 990 | Like \\[find-file] but marks buffer as read-only. |