mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
(find-file-existing): Modified to not allow wildcards.
This commit is contained in:
parent
00fa402402
commit
63c8abc42a
1 changed files with 9 additions and 7 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue