[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13115: prettier pretty-printing for eieio
From: |
Jonas Bernoulli |
Subject: |
bug#13115: prettier pretty-printing for eieio |
Date: |
Fri, 07 Dec 2012 17:54:51 +0100 |
User-agent: |
mu4e 0.9.9.5-dev4; emacs 24.3.50.1 |
Hello
The attached patch implements prettier pretty-printing in eieio.
* don't quote keywords and booleans
* don't insert needless newlines (empty lines, and before closing
parents)
* align values that are objects with the slot keyword instead of putting
it's beginning on the same line as the slot keyword.
* similar for lists of objects
Prettier pp:
,----
| (eieio-pp-demo "top"
| :keyword :keyword
| :boolean nil
| :object
| (eieio-pp-demo "subsub"
| :list '(a b c))
| :list '(a b c)
| :object-list
| (list
| (eieio-pp-demo "sub"
| :keyword :keyword
| :object
| (eieio-pp-demo "subsub"
| :list '(a b c))
| :list '(a b c))
| 'non-object
| (eieio-pp-demo "sub"
| :keyword :keyword
| :object
| (eieio-pp-demo "subsub"
| :list '(a b c))
| :list '(a b c))))
`----
Not so pretty pp:
,----
| (eieio-pp-demo "top"
| :keyword ':keyword
| :boolean 'nil
| :object (eieio-pp-demo "subsub"
| :list '(a b c)
| )
|
| :list '(a b c)
| :object-list (list
| (eieio-pp-demo "sub"
| :keyword ':keyword
| :object (eieio-pp-demo "subsub"
| :list '(a b c)
| )
|
| :list '(a b c)
| )
| 'non-object (eieio-pp-demo "sub"
| :keyword ':keyword
| :object (eieio-pp-demo "subsub"
| :list '(a b c)
| )
|
| :list '(a b c)
| )
| )
| )
`----
The demo code is also attached.
I have used this code to save the metadata extracted from all packages
on the Emacsmirror without any problems for several months now.
Please consider merging this, thanks
Jonas
prettier-eieio-pp.patch
Description: patch
eieio-pp-demo.el
Description: demo
- bug#13115: prettier pretty-printing for eieio,
Jonas Bernoulli <=