all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Pretty-printing lists (adding newlines and indent)
@ 2009-12-31 15:43 Teemu Likonen
  2009-12-31 16:25 ` Teemu Likonen
  0 siblings, 1 reply; 2+ messages in thread
From: Teemu Likonen @ 2009-12-31 15:43 UTC (permalink / raw)
  To: help-gnu-emacs

Is there an easy way to pretty-print lists in Emacs Lisp? I mean adding
newlines and indents like in the inferior-emacs-lisp-mode (M-x ielm):

    ELISP> '((a1 a2) (b1 (1 2 3 4 5)) (c1 c2))
    ((a1 a2)
     (b1
      (1 2 3 4 5))
     (c1 c2))    

I have a potentially big multi-level hierarchical list data which I'd
like to PRIN1 to a buffer. Having the whole list as a single line is
ugly and unreadable.


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

* Re: Pretty-printing lists (adding newlines and indent)
  2009-12-31 15:43 Pretty-printing lists (adding newlines and indent) Teemu Likonen
@ 2009-12-31 16:25 ` Teemu Likonen
  0 siblings, 0 replies; 2+ messages in thread
From: Teemu Likonen @ 2009-12-31 16:25 UTC (permalink / raw)
  To: help-gnu-emacs

On 2009-12-31 17:43 (+0200), Teemu Likonen wrote:

> Is there an easy way to pretty-print lists in Emacs Lisp? I mean
> adding newlines and indents [...]

I found it myself: PP and PP-TO-STRING functions do exactly what I want.


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

end of thread, other threads:[~2009-12-31 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-31 15:43 Pretty-printing lists (adding newlines and indent) Teemu Likonen
2009-12-31 16:25 ` Teemu Likonen

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.