unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to make a selection box for input parameters?
@ 2003-06-06 20:26 szhu
  0 siblings, 0 replies; 2+ messages in thread
From: szhu @ 2003-06-06 20:26 UTC (permalink / raw)


Hi, I'd like to write a command that takes one parameter, which comes from
a pre-defined list such as ("red","blue","yellow",etc.) Is there an easy interface to let the
user pick, e.g. use the up-down arrow key? (sort of like a drop-down selection box.)

Thanks.

Shunhui

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to make a selection box for input parameters?
       [not found] <mailman.7500.1054931280.21513.help-gnu-emacs@gnu.org>
@ 2003-06-06 22:50 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2003-06-06 22:50 UTC (permalink / raw)


szhu@SonicWALL.com wrote:

> Hi, I'd like to write a command that takes one parameter, which comes from
> a pre-defined list such as ("red","blue","yellow",etc.) Is there an easy interface to let the
> user pick, e.g. use the up-down arrow key? (sort of like a drop-down selection box.)

Read the Completion nodes in the Emacs manual (under Minibuffer) and in the

Emacs Lisp manual (under Minibuffers), then try out this example:

(defun foo-bar (bar)
   "Do foo to BAR."
   (interactive (list (completing-read "Bar: " '(("red") ("blue") ("yellow"))
				      nil t)))
   (foo bar))

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-06 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-06 20:26 how to make a selection box for input parameters? szhu
     [not found] <mailman.7500.1054931280.21513.help-gnu-emacs@gnu.org>
2003-06-06 22:50 ` Kevin Rodgers

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).