|
From: | Kevin Rodgers |
Subject: | Re: how to make a selection box for input parameters? |
Date: | Fri, 06 Jun 2003 16:50:52 -0600 |
User-agent: | Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
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:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
[Prev in Thread] | Current Thread | [Next in Thread] |