From: wkomornicki@hotmail.com
Subject: Re: message in minibuffer
Date: 19 Nov 2005 21:52:40 -0800 [thread overview]
Message-ID: <1132465960.466513.6320@g49g2000cwa.googlegroups.com> (raw)
In-Reply-To: <mailman.15965.1132445463.20277.help-gnu-emacs@gnu.org>
Drew:
Here is a sample piece of code
(defun foo ()
(let ((arg "abc"))
(message "Here is arg: %s" arg)))
I evaluate this in the minibuffer
Eval: (foo)
and get
"Here is arg: abc"
in the minibuffer. However if I evaluate it with
M-x foo
I get the output
Here is arg: abc
It seems that the quotation marks show up depending on how the function
is invoked. Why?
Drew Adams wrote:
> I am a newbie in writing lisp code. When my code displays a message in
> the minibuffer using the (message ...) syntax, I always have double
> quotes around the output. I have noticed in other packages that
> messages appear without the double quotes yet the code uses the same
> syntax
>
> How do I get rid of the double quotes in the mini-buffer?
>
> Post your code, so we can see what it does.
>
> `message' displays a literal string argument without double-quotes. However,
> if your string _contains_ double-quotes, then they will be shown by
> `message', as they are characters in the string itself.
>
> This will not display any double-quotes: (message "This is a message")
>
> This will display double-quotes: (message "\"Quoted message\"")
>
> If you are doing (message foo), then make sure the value of `foo' is not a
> string that contains double-quotes. In particular, be aware that if you set
> a string-valued variable `foo' using `set-variable' or Customize, you should
> not include double-quotes in the value you enter.
>
> Keep in mind also that the first argument to `message' is a format string.
> See function `format' for the proper use of `%' in format strings. If, for
> example, you use `%S' instead of `%s', then a string value will be displayed
> surrounded by double-quotes. For example:
>
> (setq foo "aaa")
>
> (message "Here is a string value: %S." foo) ->
>
> Here is a string value: "aaa".
>
> (message "Here is a string value: %s." foo) ->
>
> Here is a string value: aaa.
next prev parent reply other threads:[~2005-11-20 5:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-19 23:52 message in minibuffer wkomornicki
2005-11-20 0:10 ` Drew Adams
[not found] ` <mailman.15965.1132445463.20277.help-gnu-emacs@gnu.org>
2005-11-20 5:52 ` wkomornicki [this message]
2005-11-20 6:58 ` Drew Adams
[not found] ` <mailman.15984.1132469952.20277.help-gnu-emacs@gnu.org>
2005-11-20 20:15 ` wkomornicki
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1132465960.466513.6320@g49g2000cwa.googlegroups.com \
--to=wkomornicki@hotmail.com \
/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.
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).