unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* find-file-existing
@ 2006-09-28 16:10 martin rudalics
  0 siblings, 0 replies; only message in thread
From: martin rudalics @ 2006-09-28 16:10 UTC (permalink / raw)


`find-file-existing' is currently defined as:

(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))

The wildcards argument is misleading.  I'd rewrite this as:

(defun find-file-existing (filename)
   "Edit the existing file FILENAME.
Like \\[find-file] but do not process wildcards and only allow a file
that exists."
   (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)))

Obviously, one could do wildcards matching as well, but maybe it's not
worth the trouble.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-28 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-28 16:10 find-file-existing martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).