How to convert list to string in Emacs Lisp

jcubic picture jcubic · Sep 24, 2013 · Viewed 14.8k times · Source

How can I convert a list to string so I can call insert or message with it? I need to display c-offsets-alist but I got Wrong type argument: char-or-string-p for insert or Wrong type argument: stringp for message.

Answer

juanleon picture juanleon · Sep 24, 2013

I am not sure of what you are trying to achieve, but format converts "stuff" to strings. For instance:

(format "%s" your-list)

will return a representation of your list. message uses format internally, so

(message "%s" your-list)

will print it