help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to make (format "%S" ...) print nothing?


From: Thorsten Jolitz
Subject: How to make (format "%S" ...) print nothing?
Date: Sat, 12 Jul 2014 12:43:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]