From: Tyler Smith <tyler.smith@eku.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp - only accepting input of known values
Date: Wed, 01 Dec 2010 10:41:06 -0500 [thread overview]
Message-ID: <874oax33hp.fsf@guruji.demimonde> (raw)
In-Reply-To: id5ijr$67a$1@dough.gmane.org
Gary <help-gnu-emacs@garydjones.name> writes:
> Tassilo Horn wrote:
>> Gary writes:
>>
>>> Is it somehow possible to accept input from a set of known values (and
>>> only those values), possibly based on regex but I'm not married to
>>> that idea?
>>
>> What exactly do you mean with "input"? Input to what? A function?
>
> User input.
completing-read does this. The info file is here:
(info "(elisp)Minibuffer Completion")
The help reads, in part:
completing-read is a built-in function in `C source code'.
(completing-read PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH
INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)
Read a string in the minibuffer, with completion.
PROMPT is a string to prompt with; normally it ends in a colon and a space.
COLLECTION can be a list of strings, an alist, an obarray or a hash table.
COLLECTION can also be a function to do the completion itself.
PREDICATE limits completion to a subset of COLLECTION.
See `try-completion' and `all-completions' for more details
on completion, COLLECTION, and PREDICATE.
Tyler
next prev parent reply other threads:[~2010-12-01 15:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-01 9:05 elisp - only accepting input of known values Gary
2010-12-01 11:54 ` Tassilo Horn
2010-12-01 13:29 ` Gary
2010-12-01 15:40 ` Tassilo Horn
2010-12-01 15:41 ` Tyler Smith [this message]
2010-12-02 7:28 ` Gary
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=874oax33hp.fsf@guruji.demimonde \
--to=tyler.smith@eku.edu \
--cc=help-gnu-emacs@gnu.org \
/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.
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).