When saving changes using customize
Emacs serializes lists space separated. This makes for example the package-selected-packages
variable extremely long and hard to scan over.
Is it possible to make Emacs serialize lists more like it does with alists (like package-archives
below)? That is, one element per line?
Basically, I want this:
;;;; Custom mode ;;;;
(custom-set-variables
…
'(package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/")))
'(package-quickstart t)
'(package-selected-packages '(ace-jump-mode add-node-modules-path … yaml-mode yatemplate))
'(projectile-keymap-prefix "p")
…
)
… to turn into this:
;;;; Custom mode ;;;;
(custom-set-variables
…
'(package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/")))
'(package-quickstart t)
'(package-selected-packages
'(ace-jump-mode
add-node-modules-path
…
yaml-mode
yatemplate))
'(projectile-keymap-prefix "p")
…
)
pp
inserts newlines when printing long lists – rpluim Nov 27 '20 at 09:33pp
itself but various functions inpp.el
. I've replacedpp.el
with "functions from library pp.el, such as pp-to-string and pp-display-expression". Functionpp
does include newlines, but you might not see them, depending on what you do with its return value. – Drew Dec 03 '20 at 17:13pp-display-expression
takes two arguments. Did you meanpp-to-string
? – rpluim Dec 04 '20 at 10:13BUFFER
arg. And the answer already mentionedpp-to-string
(as well aspp-display-expression
). The point is to pretty-print, using functions frompp.el
. There is more than one way to pretty-print a Lisp value. – Drew Dec 04 '20 at 18:09