help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get a list with edit-and-eval-command


From: Kevin Rodgers
Subject: Re: Get a list with edit-and-eval-command
Date: Mon, 13 Feb 2012 21:08:26 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18

On 2/12/12 9:25 AM, david.chappaz@free.fr wrote:
Hi all,

I'm trying to get an elisp object (more specifically a list) from the 
minibuffer, using the function edit-and-eval-command, as documented in
http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Object-from-Minibuffer

For example say I first evaluate:
(setq wildcard '("*.c" "*.h" "*.v"))

Next I am trying to do something like:
(setq newwildcard (edit-and-eval-command  "Enter an expression: " (format "%s" 
wildcard))

but it does not achieves what I really want, which is to provide as initial argument a valid lisp list [e.g. 
'("*.c" "*.h" "*.v")] so no error is generated if the user simply hits [Enter]. 
The above generates double quotes and misses the single quote, which causes the problem.

Can anyone give me some insight to do this properly ?

Do not pass a string as the COMMAND argument to edit-and-eval-command.

(edit-and-eval-command "Edit and eval: " '(quote ("*.c" "*.h" "*.v")))

or equivalently

(edit-and-eval-command "Edit and eval: " (quote '("*.c" "*.h" "*.v")))

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]