unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* defcustom :type (file :must-match t)
@ 2005-12-20 23:21 Drew Adams
  2005-12-20 23:56 ` Luc Teirlinck
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2005-12-20 23:21 UTC (permalink / raw)


I don't understand the customization type `(file :must-match t)'. The Elisp
manual says only this: "The value must be a file name for an existing file,
and you can do completion with `M-<TAB>'."

I don't see where/when/how this existence criterion is enforced.  At what
point is it checked and an error raised if you try to use a name that
corresponds to no file?

I am able to create a defcustom with a file name (with complete path) that
does not correspond to an existing file. I am able to customize the file
name in Customize, providing a name that doesn't correspond to an existing
file. I am able to set for the current session and even save such a nonsense
value.

So, in what sense _must_ the file-name value be the name of an existing
file? What am I missing?

The last phrase is, in any case, unclear: "and you can do completion with
`M-<TAB>'"? When/where can you do this? Does this mean in Customize, when
"you" are typing a new file name? With `set-variable' also? When "you" are
typing the defcustom? The Elisp manual is for programmers, and this section
of the manual tells "you" how to define a file-name :type, so I would guess
that the "you" here is not an end user of Customize but a programmer writing
a defcustom. But trial and error shows that "you" is the Customize end user,
and only Customize is meant, not also `set-variable'. This should be cleared
up.

If the only "must" check for existence is that provided by file-name
completion (e.g. REQUIRE-MATCH arg to `completing-read'), then this whole
entry should be rewritten to say that. Currently, it gives the impression
that `:type (file :must-match t)' will somehow, somewhere, somewhen, force
users to use file names that correspond to existing files.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-12-24 20:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-20 23:21 defcustom :type (file :must-match t) Drew Adams
2005-12-20 23:56 ` Luc Teirlinck
2005-12-21  0:12   ` Drew Adams
2005-12-21  4:08     ` Luc Teirlinck
2005-12-21  4:37       ` Luc Teirlinck
2005-12-21  5:06         ` Luc Teirlinck
2005-12-21 18:52       ` Richard M. Stallman
2005-12-22  2:07         ` Luc Teirlinck
2005-12-21 19:29   ` :must-match and set-variable (was: Re: defcustom :type (file :must-match t)) Stuart D. Herring
2005-12-24 20:12     ` :must-match and set-variable Juri Linkov

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