all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: defcustom :type (file :must-match t)
Date: Tue, 20 Dec 2005 16:12:19 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICIEJEDAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <200512202356.jBKNudP11728@raven.dms.auburn.edu>

       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.

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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICIEJEDAAA.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.