unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to make (format "%S" ...) print nothing?
@ 2014-07-12 10:43 Thorsten Jolitz
  2014-07-12 14:30 ` W. Greenhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Jolitz @ 2014-07-12 10:43 UTC (permalink / raw)
  To: help-gnu-emacs


Hi List, 

I have a case where (format "%S" ...) is generally much more
convenient than (format "%s" ...), because it prints symbol args as
strings and string args as strings surrounded by double quotes, except
for this one situation:

Prints nothing:

#+begin_src emacs-lisp
(format "%s" "")
#+end_src

#+results:

but all of these print something

#+begin_src emacs-lisp
(format "%S" "")
#+end_src

#+results:
: ""

#+begin_src emacs-lisp
(format "%S" nil)
#+end_src

#+results:
: nil

#+begin_src emacs-lisp
(format "%S" ())
#+end_src

#+results:
: nil

Is there any way to use (format "%S"...) and have it print nothing
when given an empty string, an empty list or nil (or something else)?

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-12 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-12 10:43 How to make (format "%S" ...) print nothing? Thorsten Jolitz
2014-07-12 14:30 ` W. Greenhouse
2014-07-12 15:44   ` Thorsten Jolitz

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).