From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: wkomornicki@hotmail.com Newsgroups: gmane.emacs.help Subject: Re: message in minibuffer Date: 19 Nov 2005 21:52:40 -0800 Organization: http://groups.google.com Message-ID: <1132465960.466513.6320@g49g2000cwa.googlegroups.com> References: <1132444322.535781.216800@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1132466199 24880 80.91.229.2 (20 Nov 2005 05:56:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 20 Nov 2005 05:56:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 20 06:56:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EdiAZ-00020x-D2 for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Nov 2005 06:55:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EdiAY-0007Zw-LH for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Nov 2005 00:55:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g49g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-NNTP-Posting-Host: 69.180.168.127 Original-X-Trace: posting.google.com 1132465965 17251 127.0.0.1 (20 Nov 2005 05:52:45 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 20 Nov 2005 05:52:45 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=69.180.168.127; posting-account=Awk3nAwAAAA71nzbKDqvB839gahwn0Bs Original-Xref: shelby.stanford.edu gnu.emacs.help:135587 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31184 Archived-At: 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.