From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Get a list with edit-and-eval-command
Date: Mon, 13 Feb 2012 21:08:26 -0700 [thread overview]
Message-ID: <jhcmlf$5o3$1@dough.gmane.org> (raw)
In-Reply-To: <2f113867-1467-4df7-b6b0-f8c13872a615@zimbra62-e11.priv.proxad.net>
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
prev parent reply other threads:[~2012-02-14 4:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9601423a-874e-4e7e-a2d7-a90c5ea80503@zimbra62-e11.priv.proxad.net>
2012-02-12 16:25 ` Get a list with edit-and-eval-command david.chappaz
2012-02-14 4:08 ` Kevin Rodgers [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='jhcmlf$5o3$1@dough.gmane.org' \
--to=kevin.d.rodgers@gmail.com \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.