Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
63c8abc4
Commit
63c8abc4
authored
Sep 30, 2006
by
Eli Zaretskii
Browse files
(find-file-existing): Modified to not allow wildcards.
parent
00fa4024
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
lisp/files.el
lisp/files.el
+9
-7
No files found.
lisp/files.el
View file @
63c8abc4
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment