diff options
author | Eli Zaretskii <eliz@gnu.org> | 2006-09-30 10:02:22 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2006-09-30 10:02:22 +0000 |
commit | 63c8abc42a2b43fdc2f049f27f095379c2aebc8f (patch) | |
tree | cc433a602cdea10f4f5b575384466bc27c5a3a3b /lisp/files.el | |
parent | 00fa402402044dac8314b50d1608a24c45b6bb3a (diff) | |
download | emacs-63c8abc42a2b43fdc2f049f27f095379c2aebc8f.tar.gz |
(find-file-existing): Modified to not allow wildcards.
Diffstat (limited to 'lisp/files.el')
-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." (mapcar 'switch-to-buffer (cdr value)))) (switch-to-buffer-other-frame value)))) -(defun find-file-existing (filename &optional wildcards) - "Edit the existing file FILENAME. -Like \\[find-file] but only allow a file that exists." - (interactive (find-file-read-args "Find existing file: " t)) - (unless (file-exists-p filename) (error "%s does not exist" filename)) - (find-file filename wildcards) - (current-buffer)) +(defun find-file-existing (filename) + "Edit the existing file FILENAME. +Like \\[find-file] but only allow a file that exists, and do not allow +file names with wildcards." + (interactive (nbutlast (find-file-read-args "Find existing file: " t))) + (if (and (not (interactive-p)) (not (file-exists-p filename))) + (error "%s does not exist" filename) + (find-file filename) + (current-buffer))) (defun find-file-read-only (filename &optional wildcards) "Edit file FILENAME but don't allow changes. |