unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: defcustom :type (file :must-match t)
Date: Tue, 20 Dec 2005 15:21:16 -0800	[thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBAEBFCOAA.drew.adams@oracle.com> (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.

             reply	other threads:[~2005-12-20 23:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-20 23:21 Drew Adams [this message]
2005-12-20 23:56 ` defcustom :type (file :must-match t) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MEEKKIABFKKDFJMPIOEBAEBFCOAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).