GNU bug report logs - #13115
prettier pretty-printing for eieio

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Fri, 7 Dec 2012 16:56:01 UTC

Severity: wishlist

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13115 in the body.
You can then email your comments to 13115 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13115; Package emacs. (Fri, 07 Dec 2012 16:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonas Bernoulli <jonas <at> bernoul.li>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 07 Dec 2012 16:56:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: bug-gnu-emacs <at> gnu.org
Subject: prettier pretty-printing for eieio
Date: Fri, 07 Dec 2012 17:54:51 +0100
[Message part 1 (text/plain, inline)]
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 (text/x-diff, attachment)]
[eieio-pp-demo.el (application/emacs-lisp, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13115; Package emacs. (Wed, 12 Dec 2012 02:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 13115 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jonas Bernoulli <jonas <at> bernoul.li>
Cc: 13115 <at> debbugs.gnu.org
Subject: Re: bug#13115: prettier pretty-printing for eieio
Date: Tue, 11 Dec 2012 21:17:04 -0500
> The attached patch implements prettier pretty-printing in eieio.

Thanks, installed (with (bolp) instead of (looking-back "\n"),
especially since looking-back is grossly inefficient).


        Stefan




bug closed, send any further explanations to 13115 <at> debbugs.gnu.org and Jonas Bernoulli <jonas <at> bernoul.li> Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Wed, 12 Dec 2012 03:09:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Jan 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.