From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: eieio, pretty printing, and edebug Date: Wed, 29 Oct 2014 16:40:41 -0700 Message-ID: <871tpqv406.fsf@ericabrahamsen.net> References: <87d29dz81x.fsf@ericabrahamsen.net> <5450531F.1060601@siege-engine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414625770 12538 80.91.229.3 (29 Oct 2014 23:36:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 23:36:10 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 30 00:36:03 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XjcmY-0004ci-9j for ged-emacs-devel@m.gmane.org; Thu, 30 Oct 2014 00:36:02 +0100 Original-Received: from localhost ([::1]:49540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjcmX-0005Ru-UF for ged-emacs-devel@m.gmane.org; Wed, 29 Oct 2014 19:36:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjcmP-0005Ri-5e for emacs-devel@gnu.org; Wed, 29 Oct 2014 19:35:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjcmI-0000kc-PY for emacs-devel@gnu.org; Wed, 29 Oct 2014 19:35:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:45883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjcmI-0000kF-JI for emacs-devel@gnu.org; Wed, 29 Oct 2014 19:35:46 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XjcmG-0004UE-Lq for emacs-devel@gnu.org; Thu, 30 Oct 2014 00:35:44 +0100 Original-Received: from c-76-28-195-250.hsd1.wa.comcast.net ([76.28.195.250]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Oct 2014 00:35:44 +0100 Original-Received: from eric by c-76-28-195-250.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Oct 2014 00:35:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-76-28-195-250.hsd1.wa.comcast.net User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:8Pt0d48k9mvf0yd3mPzJjd3QNnI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:176034 Archived-At: Eric Ludlam 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