aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-09-30 10:02:22 +0000
committerEli Zaretskii2006-09-30 10:02:22 +0000
commit63c8abc42a2b43fdc2f049f27f095379c2aebc8f (patch)
treecc433a602cdea10f4f5b575384466bc27c5a3a3b
parent00fa402402044dac8314b50d1608a24c45b6bb3a (diff)
downloademacs-63c8abc42a2b43fdc2f049f27f095379c2aebc8f.tar.gz
emacs-63c8abc42a2b43fdc2f049f27f095379c2aebc8f.zip
(find-file-existing): Modified to not allow wildcards.
-rw-r--r--lisp/files.el16
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.
1122Like \\[find-file] but only allow a file that exists." 1122Like \\[find-file] but only allow a file that exists, and do not allow
1123 (interactive (find-file-read-args "Find existing file: " t)) 1123file 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.