diff options
| author | Eli Zaretskii | 2006-09-30 10:02:22 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-09-30 10:02:22 +0000 |
| commit | 63c8abc42a2b43fdc2f049f27f095379c2aebc8f (patch) | |
| tree | cc433a602cdea10f4f5b575384466bc27c5a3a3b | |
| parent | 00fa402402044dac8314b50d1608a24c45b6bb3a (diff) | |
| download | emacs-63c8abc42a2b43fdc2f049f27f095379c2aebc8f.tar.gz emacs-63c8abc42a2b43fdc2f049f27f095379c2aebc8f.zip | |
(find-file-existing): Modified to not allow wildcards.
| -rw-r--r-- | lisp/files.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/files.el b/lisp/files.el index 5af68f6014e..3e2cf2ee92d 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1117,13 +1117,15 @@ expand wildcards (if any) and visit multiple files." | |||
| 1117 | (mapcar 'switch-to-buffer (cdr value)))) | 1117 | (mapcar 'switch-to-buffer (cdr value)))) |
| 1118 | (switch-to-buffer-other-frame value)))) | 1118 | (switch-to-buffer-other-frame value)))) |
| 1119 | 1119 | ||
| 1120 | (defun find-file-existing (filename &optional wildcards) | 1120 | (defun find-file-existing (filename) |
| 1121 | "Edit the existing file FILENAME. | 1121 | "Edit the existing file FILENAME. |
| 1122 | Like \\[find-file] but only allow a file that exists." | 1122 | Like \\[find-file] but only allow a file that exists, and do not allow |
| 1123 | (interactive (find-file-read-args "Find existing file: " t)) | 1123 | file names with wildcards." |
| 1124 | (unless (file-exists-p filename) (error "%s does not exist" filename)) | 1124 | (interactive (nbutlast (find-file-read-args "Find existing file: " t))) |
| 1125 | (find-file filename wildcards) | 1125 | (if (and (not (interactive-p)) (not (file-exists-p filename))) |
| 1126 | (current-buffer)) | 1126 | (error "%s does not exist" filename) |
| 1127 | (find-file filename) | ||
| 1128 | (current-buffer))) | ||
| 1127 | 1129 | ||
| 1128 | (defun find-file-read-only (filename &optional wildcards) | 1130 | (defun find-file-read-only (filename &optional wildcards) |
| 1129 | "Edit file FILENAME but don't allow changes. | 1131 | "Edit file FILENAME but don't allow changes. |