* elisp - only accepting input of known values
@ 2010-12-01 9:05 Gary
2010-12-01 11:54 ` Tassilo Horn
0 siblings, 1 reply; 6+ messages in thread
From: Gary @ 2010-12-01 9:05 UTC (permalink / raw)
To: help-gnu-emacs
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?
TIA.
--
Gary Please do NOT send me 'courtesy' replies off-list.
GNU Emacs 23.2.1
emacsclient 23.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: elisp - only accepting input of known values
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
0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2010-12-01 11:54 UTC (permalink / raw)
To: help-gnu-emacs
Gary <help-gnu-emacs@garydjones.name> 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?
Bye,
Tassilo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: elisp - only accepting input of known values
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
0 siblings, 2 replies; 6+ messages in thread
From: Gary @ 2010-12-01 13:29 UTC (permalink / raw)
To: help-gnu-emacs
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.
--
Gary Please do NOT send me 'courtesy' replies off-list.
GNU Emacs 23.2.1
emacsclient 23.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: elisp - only accepting input of known values
2010-12-01 13:29 ` Gary
@ 2010-12-01 15:40 ` Tassilo Horn
2010-12-01 15:41 ` Tyler Smith
1 sibling, 0 replies; 6+ messages in thread
From: Tassilo Horn @ 2010-12-01 15:40 UTC (permalink / raw)
To: help-gnu-emacs
Gary <help-gnu-emacs@garydjones.name> 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.
Wow, that is too specific. :-)
But if you mean completion in the minibuffer, have a look at
`completing-read'.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: elisp - only accepting input of known values
2010-12-01 13:29 ` Gary
2010-12-01 15:40 ` Tassilo Horn
@ 2010-12-01 15:41 ` Tyler Smith
2010-12-02 7:28 ` Gary
1 sibling, 1 reply; 6+ messages in thread
From: Tyler Smith @ 2010-12-01 15:41 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: elisp - only accepting input of known values
2010-12-01 15:41 ` Tyler Smith
@ 2010-12-02 7:28 ` Gary
0 siblings, 0 replies; 6+ messages in thread
From: Gary @ 2010-12-02 7:28 UTC (permalink / raw)
To: help-gnu-emacs
Tyler Smith wrote:
> Gary 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
Many thanks.
emacs
--
Gary (snowed in and frustrated in CH)
GNU Emacs 23.2.1 Please do NOT send me 'courtesy' replies off-list.
emacsclient 23.2
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-12-02 7:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-12-02 7:28 ` Gary
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).