# HG changeset patch # User Eli Zaretskii # Date 1159610542 0 # Node ID 206dafef27e7bc333dc2a70e87b3c6d7af3e7aaf # Parent 896cf485f027abd5f6e9c99dbe649cb489b50beb (find-file-existing): Modified to not allow wildcards. diff -r 896cf485f027 -r 206dafef27e7 lisp/files.el --- a/lisp/files.el Sat Sep 30 09:50:07 2006 +0000 +++ b/lisp/files.el Sat Sep 30 10:02:22 2006 +0000 @@ -1117,13 +1117,15 @@ (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.