From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Improving representation of EIEIO objects in backtraces/error messages Date: Sun, 08 Jan 2017 09:24:38 -0800 Message-ID: <87wpe55usp.fsf@ericabrahamsen.net> References: <87ful6o8x4.fsf@ericabrahamsen.net> <7b792dd9-491a-b442-f837-e85326a6c924@siege-engine.com> <87wpefakpe.fsf@ericabrahamsen.net> <56e042cf-ee2d-03b0-ceba-f1483fa2b01c@siege-engine.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1483896338 24208 195.159.176.226 (8 Jan 2017 17:25:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Jan 2017 17:25:38 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 08 18:25:33 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQHDd-0004J1-CP for ged-emacs-devel@m.gmane.org; Sun, 08 Jan 2017 18:25:21 +0100 Original-Received: from localhost ([::1]:34168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQHDg-0001SN-4I for ged-emacs-devel@m.gmane.org; Sun, 08 Jan 2017 12:25:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQHD9-0001SH-9L for emacs-devel@gnu.org; Sun, 08 Jan 2017 12:24:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQHD6-00016e-0n for emacs-devel@gnu.org; Sun, 08 Jan 2017 12:24:51 -0500 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:59981) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQHD5-00014L-R6 for emacs-devel@gnu.org; Sun, 08 Jan 2017 12:24:47 -0500 Original-Received: from localhost (71-212-13-2.tukw.qwest.net [71.212.13.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id CCE51BE35C for ; Sun, 8 Jan 2017 17:24:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483896280; bh=ABUP0dO21Ykfzc/caIylSKGri202UUQgK+/+oLIOsZg=; h=From:To:Subject:References:Date:In-Reply-To:From; b=umJJGlkDlRdWdSgTadCOXffdZsA1XHHGkMSpSByWXNkEJIxLaUNCw4K48e2sNtCBz ye6AR0X25fTC1/Yq5I2WTkLFB4a17haNomQHRMH1uHkpbHGi4YD7OtDHO2AfAQ/bfo 2vcyscZi1HSMgtKJ/DHDc7LUbsyisRqkYILfHg1Y= In-Reply-To: <56e042cf-ee2d-03b0-ceba-f1483fa2b01c@siege-engine.com> (Eric Ludlam's message of "Sat, 7 Jan 2017 20:51:00 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 50.56.99.223 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:211165 Archived-At: Eric Ludlam writes: > On 12/31/2016 03:48 PM, Eric Abrahamsen wrote: >> Eric Ludlam writes: >> >>> On 12/29/2016 02:02 PM, Eric Abrahamsen wrote: > ... >>> CEDET includes a 'data-debug' package. If you enable that it provides a >>> way to navigate giant data structures as you might get with EIEIO. It >>> is also a part of Emacs now, though I'm not that familiar with how it >>> all was merged. >>> >>> I have this in my .emacs file to take advantage of it: >>> >>> (require 'data-debug) >>> (global-set-key "\M-:" 'data-debug-eval-expression) >> >> That's interesting, thanks! I'll play with it a bit, it might be nice to >> add the slot names in with the values. > > The slot names should be included in the display. At least they are > for me in my older Emacs. It may be that the eieio-support doesn't > work quite right after the EIEIO change in Emacs? > > In CEDET, eieio-datadebug is separate, but with EIEIO as a piece of > core emacs with Data Debug, maybe the current tenuous load should be > replaced by merging eieio-datadebug into data-debug. My mistake, I'd only loaded data-debug, not eieio-datadebug. The slots are showing now. > ... >>> In the CEDET repository, you can get cedet-edebug.el. It includes >>> these two snippets that bind "A" to data debug. >>> >>> ;;;###autoload >>> (add-hook 'edebug-setup-hook > [...] > >> These are all good for me as a developer, but I would also like to >> protect users from backtraces that might, ahem, arise from my code. Do >> you have any opinion on the discussion in >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25295 ? Anything would be >> welcome. > > I'm not familiar with Emacs C level expression printing. That's why I > just stopped using built ins and added my own top level commands to > get things done. > > The ideas represented in the thread where some special vector-form > could fork off to a special printer sounds like a pretty nice idea > though. That way more than just EIEIO objects could be simplified. > > In the above thread, someone mentioned giving up an object's ability > to customize it's print output. This is a super handy feature where > you can take some key differentiator of your object that is short to > put into the short form print output. Taking advantage of that > feature makes using the short print output even better. Of course, > the developer needs to implement the method to make it work. I > usually go add a new print-object method when I'm debugging so I can > figure out what's going on. That was me saying that -- I just meant that, if I had to choose between customizable object representation in *some* places, and non-customizable representation in *all* places, I would go with the latter. But with any luck we'll be able to get both. I agree that a customizable object-print is a very nice thing. Eric