[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: defcustom :type (file :must-match t)
From: |
Drew Adams |
Subject: |
RE: defcustom :type (file :must-match t) |
Date: |
Tue, 20 Dec 2005 16:12:19 -0800 |
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>'."
So, in what sense _must_ the file-name value be the name of
an existing file? What am I missing?
In the sense that if Custom checks the type _in the minibuffer_ (as
opposed to in an editable field in a Custom buffer), say with
`customize-set-variable', the completion functions will prevent you
from entering a non-existent file name. If you insist, you can enter
such a name anyway, with C-M-c (but that will usually be a bad idea).
That is pretty weak enforcement. Most user modification will be in Customize
itself. Secondarily, I'd expect people might use `set-variable' more than
`customize-set-variable'. More importantly, :type is about controlling the
values users provide - regardless of how they input those values. Completion
against non-nil REQUIRE-MATCH in `completing-read' is hardly about :type
enforcement.
If this (completion) is the only way in which an existing file is checked,
then I would, at the least, clearly state that in the Elisp manual.
I'd also suggest that we either remove this :type altogether or (preferably)
look for a better way to enforce use of a file name that names an existing
file. The latter could be quite useful - we've never had anything like that
before.
:must-match and set-variable (was: Re: defcustom :type (file :must-match t)), Stuart D. Herring, 2005/12/21