emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eieio, pretty printing, and edebug


From: Eric Abrahamsen
Subject: Re: eieio, pretty printing, and edebug
Date: Wed, 29 Oct 2014 16:40:41 -0700
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Eric Ludlam <address@hidden> writes:

> On 10/28/2014 12:44 PM, Stefan Monnier wrote:
>>> Line 895 in eieio.el, were it not commented out, would fix this by
>>> having edebug print using the object-print generic, not prin1. I eval'ed
>>> the line and tried it, and it seemed to work fine.
>>
>>> How come it's currently commented out? Can I open a bug for this?
>>
>> `defalias' is clearly not right, since it hijacks the function.  But if
>> we change it to advice-add, I think it'd be OK to enable this
>> edebug help.
>>
>> I think it would also be good to add hooks to the native printing system
>> so that such tweaks can be done more reliably.  Ideally, these same
>> hooks could be used for things like desktop and savehist to replace
>> markers or other "non-printable" objects with alternative output.
>
> Hi,
>
> Related to debugging EIEIO classes, the `data-debug.el' extension
> which is a part of Emacs includes a nice way to browse large data
> structures. In it, data-debug-eval-expression is something I've bound
> to M-: for myself.  It shows the short version of the eval'd
> expression when it is short, and goes into a browser type buffer when
> it is particularly large.

That's an interesting library, thanks! Using the eval expression on
gnus-registry-db still causes Emacs to run out of memory, though :)

I've opened bug 18897 for this. I'd be happy to provide a patch, but I
don't quite see how advice-add with :override would be all that
different from the defalias.

Right now, edebug expressions are printed with
`edebug-safe-prin1-to-string', which calls `edebug-prin1-to-string',
which is an alias for `prin1-to-string'. I'd certainly consider printing
objects to be a part of the "safety" routine -- would it be unreasonable
to make edebug aware of eieio, and move most of the logic of
`eieio-edebug-prin1-to-string' into `edebug-safe-prin1-to-string',
guarded by a `featurep'?

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]