all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.