From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Dec 2016 20:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 25295@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148304476023950 (code B ref -1); Thu, 29 Dec 2016 20:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Dec 2016 20:52:40 +0000 Received: from localhost ([127.0.0.1]:59420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMhgm-0006EE-1r for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMhgk-0006Dz-On for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMhge-0000iA-3C for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:33 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMhgd-0000i2-Vk for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMhgc-0001k7-Oz for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 15:52:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMhgX-0000dP-Tr for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 15:52:30 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:34408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMhgX-0000ch-Nz for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 15:52:25 -0500 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 3A9B7BC903 for ; Thu, 29 Dec 2016 20:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483044744; bh=kof4kKejEfEyu4q1Uw/QFq58sEN85aOsMUgo5FpFx+M=; h=From:To:Subject:Date:From; b=EYW/j4V6D840DHodMeGZIiXfJREyFkXM2Mc0V6oZGh9zivXPloSPdclUaXbZuyf8k jEOWgZ/gxcHQv4lAnxEB4e9AOSsFPChbgr0oWHZ4dIkikrnw5KheMeQN4RXDk8XcJa rxMd8uGL5E7n4RCnYOPchVxWGElIuD6e/52y+HQQ= From: Eric Abrahamsen Date: Thu, 29 Dec 2016 12:52:19 -0800 Message-ID: <87pokampa4.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) EIEIO class instances can either be represented using the read-only # style, or as vectors, dumping all the slot information. For large or recursive objects, this can take some time, and can also make for very large strings. In backtraces and edebug, in particular, this can make it very difficult to see what's happening. Objects have an `object-print' method which produces the # representation, but this appears to only sometimes be used in edebug, and never in backtraces. It would be great if object-print could always be used, or if there were an option to toggle this. In GNU Emacs 26.0.50.9 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.5) of 2016-12-26 built on clem Repository revision: 65b997b95e284e2edc1266663e39791f68d76ad7 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Recent messages: [6 times] mwheel-scroll: Beginning of buffer [5 times] Mark saved where search started Checking new news... Reading active file from Test via nngnorb...done Reading active file from archive via nnfolder...done Reading active file via nndraft...done Reading active file from MTester via nnmairix...done Checking new news...done Processing kill file /home/eric/.emacs.d/News/gmane.emacs.devel.KILL...done From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Dec 2016 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148304821429370 (code B ref 25295); Thu, 29 Dec 2016 21:51:02 +0000 Received: (at 25295) by debbugs.gnu.org; 29 Dec 2016 21:50:14 +0000 Received: from localhost ([127.0.0.1]:59447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMiaT-0007de-Rq for submit@debbugs.gnu.org; Thu, 29 Dec 2016 16:50:14 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:50519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMiaR-0007dV-Lr for 25295@debbugs.gnu.org; Thu, 29 Dec 2016 16:50:12 -0500 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 C279CBC903 for <25295@debbugs.gnu.org>; Thu, 29 Dec 2016 21:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483048211; bh=+c6t8mQ4cB1upGdU4skFcq526GtYtSXCQBzpWWDptXA=; h=From:To:Subject:References:Date:In-Reply-To:From; b=R56hSqwhjcDzuYPBCXXG4gOFyIW+2wq91pjHdVlUoLaxRx1dNhPgfYTS5njlo4ZGg hXq/CwW1ARfIFK4X8ikA7Kv8wGwlhAb8I7XbihJPEuUN91pOm4TXPdOsmcVDDXHGwG 4EJaiMhzr/TmFMlvQnkVqLAKn9fmaUU66712j2X0= From: Eric Abrahamsen References: <87pokampa4.fsf@ericabrahamsen.net> Date: Thu, 29 Dec 2016 13:50:09 -0800 In-Reply-To: (GNU bug Tracking System's message of "Thu, 29 Dec 2016 20:53:02 +0000") Message-ID: <8760m2mmlq.fsf@ericabrahamsen.net> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) I guess this would require going into print.c and adding another branch under the Lisp_Vectorlike case statement of object_print. Is this sort of C code allowed to call back up to the lisp object-print function? This is where I get lost... From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2016 03:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148306931429522 (code B ref 25295); Fri, 30 Dec 2016 03:42:02 +0000 Received: (at 25295) by debbugs.gnu.org; 30 Dec 2016 03:41:54 +0000 Received: from localhost ([127.0.0.1]:59493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMo4o-0007g1-FG for submit@debbugs.gnu.org; Thu, 29 Dec 2016 22:41:54 -0500 Received: from mail-it0-f47.google.com ([209.85.214.47]:37105) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMo4m-0007fi-8Y; Thu, 29 Dec 2016 22:41:52 -0500 Received: by mail-it0-f47.google.com with SMTP id o141so203802247itc.0; Thu, 29 Dec 2016 19:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ooSRxwvj/KwGElXaDelzKCQqFOVOWZqXZQri0Rxvi4Q=; b=dPOpkP5huNSah+yD3A7f8wrf3E1MiW15fsbJW1vnlbBrR3hI3VMeN5rRXojaQGOx68 +k7EXjk8TekHYSez2Mb7rTdxKJuWkpfZmoRTl8qJbXI23hWH4L+52fK6xujU7S0Xovk4 kuW142DN6/GYkNy0YM0nQM+bLtes+kdJEpGSN5MXCMAYRR81eWTPLjont+OOcwGyCi4h 3qLUM7M+CLahukm9/UvlMZBpGxKYAOG3VwrCGdCyk0R16vO5aI1DGfBvuuvGNgCfnfqO J7vFCKspDS++sdamGAJxoaY1079OEAP63CJtQY4Ic+dukbpOVnhd6De6IrbeUs7083+g HhIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=ooSRxwvj/KwGElXaDelzKCQqFOVOWZqXZQri0Rxvi4Q=; b=EclJrRN/R1kwvYLuZnrllpYSvxuY2Ha1QBUVPQWh1ajNPf1OsrmiV0JZbf4wy0vMk2 MqyeQSoUsWnPE2GAQAlq3DpTC6sTu1e3Fo6Oxjh223EnA006qCZjxdlfxrJfJTjNgBxI Zw3cSoPFMgV0EnJV5xhKzcS389/mkSaWa2lCWE8dDAAXXAD7WrrMeoI0TWwJYG6S2Lv3 SB8gltEjFpuym9VRLtMGw2nzMCsC13VYKrL3gWFGMb6FkBh0tu5g7sKZWSl08XX0ZzRS 9RHYJqFuREPZfXptQCvyfEb+yCzWxDum0xRQpMdYKg1V7Bm0iA6DZgPQYfzpFNPfq++p zd2Q== X-Gm-Message-State: AIkVDXKo8TWYxyO3B6x7NcrSpHwEHT9JdiXMON3HNQ0arEG8mofswtOq+SCLWpXDMVd8Cg== X-Received: by 10.36.11.65 with SMTP id 62mr34647870itd.118.1483069306604; Thu, 29 Dec 2016 19:41:46 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id o65sm26392672ioe.15.2016.12.29.19.41.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2016 19:41:45 -0800 (PST) From: npostavs@users.sourceforge.net References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> Date: Thu, 29 Dec 2016 22:42:48 -0500 In-Reply-To: <8760m2mmlq.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 29 Dec 2016 13:50:09 -0800") Message-ID: <87bmvu84lj.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) severity 25295 wishlist quit Eric Abrahamsen writes: > I guess this would require going into print.c and adding another branch > under the Lisp_Vectorlike case statement of object_print. You mean print_object? I thought the idea would be to change edebug and backtrace code to (optionally?) use object-print instead of print. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2016 07:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148308428727272 (code B ref 25295); Fri, 30 Dec 2016 07:52:01 +0000 Received: (at 25295) by debbugs.gnu.org; 30 Dec 2016 07:51:27 +0000 Received: from localhost ([127.0.0.1]:59531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMryJ-00075o-Ic for submit@debbugs.gnu.org; Fri, 30 Dec 2016 02:51:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMryI-00075Z-N3 for 25295@debbugs.gnu.org; Fri, 30 Dec 2016 02:51:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMry9-0007FD-PC for 25295@debbugs.gnu.org; Fri, 30 Dec 2016 02:51:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMry9-0007F7-La; Fri, 30 Dec 2016 02:51:17 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2042 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cMry8-0006Af-Nf; Fri, 30 Dec 2016 02:51:17 -0500 Date: Fri, 30 Dec 2016 09:51:14 +0200 Message-Id: <83inq1ua6l.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <8760m2mmlq.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Thu, 29 Dec 2016 13:50:09 -0800) References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Eric Abrahamsen > Date: Thu, 29 Dec 2016 13:50:09 -0800 > > I guess this would require going into print.c and adding another branch > under the Lisp_Vectorlike case statement of object_print. > > Is this sort of C code allowed to call back up to the lisp object-print > function? If that Lisp function will then call print.c again, that's not a good idea, since print.c internally uses a buffer by a certain fixed name. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2016 19:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net,Eli Zaretskii Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148312529730897 (code B ref 25295); Fri, 30 Dec 2016 19:15:01 +0000 Received: (at 25295) by debbugs.gnu.org; 30 Dec 2016 19:14:57 +0000 Received: from localhost ([127.0.0.1]:60613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cN2dl-00082H-5Y for submit@debbugs.gnu.org; Fri, 30 Dec 2016 14:14:57 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:39594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cN2di-000827-Oe for 25295@debbugs.gnu.org; Fri, 30 Dec 2016 14:14:55 -0500 Received: from [10.252.101.143] (unknown [198.134.93.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 25094BC903; Fri, 30 Dec 2016 19:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483125292; bh=ULppsvl00BXSvMPepwbf3kO3rOlj8wIrqhZzz90yh04=; h=In-Reply-To:References:Subject:From:Date:To:CC:From; b=X34JokQYy/GkYWjiMonZrDlmd5buRJe3+RiJ6wMwHTNkqMxxmIgHYeRPOMwV8jLRn fLGvvNkfiofxOartJsFQicTKGsud4B6FFTiWsiDROIGvBzArMazA//+mQmfR2LBXCQ Vb8E5F7BbnvmTpCHVhhz9khp+1jZjabsZRFWn0F4= User-Agent: K-9 Mail for Android In-Reply-To: <87bmvu84lj.fsf@users.sourceforge.net> (npostavs's message of "Thu, 29 Dec 2016 22:42:48 -0500") References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87bmvu84lj.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 From: Eric Abrahamsen Date: Fri, 30 Dec 2016 11:14:49 -0800 Message-ID: <01696DFE-7C0E-4FAC-8893-B6826DF7BCA8@ericabrahamsen.net> X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 12/29/16 22:42 PM, npostavs@users.sourceforge.net wrote: > You mean print_object? I thought the idea would be to change edebug and > backtrace code to (optionally?) use object-print instead of print. I do mean print_object, sorry. (And sorry I keep replying to you only!) On 12/30/16 09:51 AM, Eli Zaretskii wrote: >> From: Eric Abrahamsen >> Date: Thu, 29 Dec 2016 13:50:09 -0800 >> >> I guess this would require going into print.c and adding another branch >> under the Lisp_Vectorlike case statement of object_print. >> >> Is this sort of C code allowed to call back up to the lisp object-print >> function? > > If that Lisp function will then call print.c again, that's not a good > idea, since print.c internally uses a buffer by a certain fixed name. `object-print' ends up using `format', which looks like it calls print.c functions, so I guess that's out. I don't know the right level at which to intervene. All other lisp objects get a hard-coded # Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Dec 2016 05:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: Eli Zaretskii , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148316328029477 (code B ref 25295); Sat, 31 Dec 2016 05:48:02 +0000 Received: (at 25295) by debbugs.gnu.org; 31 Dec 2016 05:48:00 +0000 Received: from localhost ([127.0.0.1]:60780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNCWO-0007fN-Hg for submit@debbugs.gnu.org; Sat, 31 Dec 2016 00:48:00 -0500 Received: from mail-it0-f50.google.com ([209.85.214.50]:34688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNCWN-0007fB-9i for 25295@debbugs.gnu.org; Sat, 31 Dec 2016 00:47:59 -0500 Received: by mail-it0-f50.google.com with SMTP id 75so64379010ite.1 for <25295@debbugs.gnu.org>; Fri, 30 Dec 2016 21:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XX1QcHPo8NyRLggo2G6mhgGgCmmOBDTyCob3TMgzWVI=; b=ZkUR0pK5OwupCj+lOjFF04vIGslj4/SNsnzkV2BOs3ZULmKj5RUDn0rmUn3eAT3rDu W5KKQkH7GzeQ50mKQFzHoLGl5J76xS+BDMSzmzAcCqlyIKiHz6MnX/WYdVM5YZW0lKk6 +fJ1aFbb8dxqDRHNwFSMuKbQfgWi1aCKbHdNUp2iQHpCFtRxzT0lWpnq0DFX0wDESZtw pAmZ2w29Jm482Pu7Z7kRtbxNktnDInOVv+rZnCf+qkfHi9n+Gqd14DLxF+xrDiakIJQO dBQHRMNl3NVwV1Vha22LBi5XvjUrrWTHDqNYBnccjgkckupLC1V7b6yV/wy/Gph1kEQ6 W5SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=XX1QcHPo8NyRLggo2G6mhgGgCmmOBDTyCob3TMgzWVI=; b=HvNExiAfNpzvDqCJHB1GTpwIg3Y0zYAS0Wrfzv0STsBYarXFO9tYtCGGzke9veYaE2 JCtcivY6hWZToGEmCKw9y8bXArFevKGuKqrzZh3xFI93C1SWbnLa5T+qETfwY3t+CZMw GSZwUzahyqXI25rL7lH3bARBxzSjv26bRDuwG3ud2NTAijzQn6VKV3wSx/QSDP07zAzL +tF2M9YW58DT6A6poIlwez4aPgUmlVjQ4Aazzj7aIpt+GvbooEgprpeDMJ6GQVMwPrWi UU8jTRoy/WK5wAXKL7IrMY4Vu3nrc6JyvePROgrxV6w8cPAYo2eAuD68iZajIQggm+z1 FeLQ== X-Gm-Message-State: AIkVDXLEH4LQrh7Bf1B7ci6E5/nGspVWGqlF0RaoCUPry6WYLHhK3khYRLQ7sqO2tp4ZFQ== X-Received: by 10.36.101.129 with SMTP id u123mr39817300itb.30.1483163273717; Fri, 30 Dec 2016 21:47:53 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id v74sm28259073ioi.2.2016.12.30.21.47.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Dec 2016 21:47:52 -0800 (PST) From: npostavs@users.sourceforge.net References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87bmvu84lj.fsf@users.sourceforge.net> <01696DFE-7C0E-4FAC-8893-B6826DF7BCA8@ericabrahamsen.net> Date: Sat, 31 Dec 2016 00:48:51 -0500 In-Reply-To: <01696DFE-7C0E-4FAC-8893-B6826DF7BCA8@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 30 Dec 2016 11:14:49 -0800") Message-ID: <87y3yw7inw.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) Eric Abrahamsen writes: > On 12/30/16 09:51 AM, Eli Zaretskii wrote: >>> From: Eric Abrahamsen >>> Date: Thu, 29 Dec 2016 13:50:09 -0800 >>> >>> I guess this would require going into print.c and adding another branch >>> under the Lisp_Vectorlike case statement of object_print. >>> >>> Is this sort of C code allowed to call back up to the lisp object-print >>> function? >> >> If that Lisp function will then call print.c again, that's not a good >> idea, since print.c internally uses a buffer by a certain fixed name. > > `object-print' ends up using `format', which looks like it calls print.c > functions, so I guess that's out. > > I don't know the right level at which to intervene. All other lisp > objects get a hard-coded # print.c, only eieio objects "fake it" with a user-overrideable lisp > function. I suspect eieio objects won't be considered "fundamental" on > the same level as markers, buffers, etc., so maybe they don't belong in > print_object (plus the above problem of calling lisp-c-lisp-c). > > I don't see how we could hijack at the lisp level, though. Functions > like `eval-expression' and `backtrace--print-frame' simply toss whole > lisp structures to prin1, there's no way to know that there's an eieio > object somewhere in that structure. > I think the only way to integrate `object-print' with the existing `print' functions, would be to make it follow the same protocol. That is, currently `object-print' is really `object-to-string', it should be changed (or perhaps a new function (e.g., `print-object') would be a better idea, so as not to break existing code too much) to accept a PRINTCHARFUN argument, and print to it. > Personally, I'd be willing to lose the ability to customize object > representations with `object-print', if it meant that print_object could > produce a # C test like INSTANCEP or what have you. > That's easier, of course, but a non-customized representation would be pretty uninformative. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Dec 2016 18:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: Eli Zaretskii , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148321061010338 (code B ref 25295); Sat, 31 Dec 2016 18:57:01 +0000 Received: (at 25295) by debbugs.gnu.org; 31 Dec 2016 18:56:50 +0000 Received: from localhost ([127.0.0.1]:33476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNOpl-0002gg-VF for submit@debbugs.gnu.org; Sat, 31 Dec 2016 13:56:50 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:41254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNOpk-0002gY-Ii for 25295@debbugs.gnu.org; Sat, 31 Dec 2016 13:56:48 -0500 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 865DDBC903; Sat, 31 Dec 2016 18:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483210606; bh=wNfv5LBvo4q7SpmzeaHrpEB64MTMTbFU3GEpR7mvFbI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=tM9aEJ9EgDNifvt1OSDcunep1lUulpE4RZXuj8Hi29RTAv9HURuD6QAHCfsQXASe8 aX9xL/7hQoLOJegj1JDuZ9KisMBOn1K9cI9Jyq66qF+XaGrQDWUdl60wnfnqz2N1QS O9M1i8F9URP7huATxGI2Dqh6snHnWF5PSojbSJBs= From: Eric Abrahamsen References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87bmvu84lj.fsf@users.sourceforge.net> <01696DFE-7C0E-4FAC-8893-B6826DF7BCA8@ericabrahamsen.net> <87y3yw7inw.fsf@users.sourceforge.net> Date: Sat, 31 Dec 2016 10:56:44 -0800 In-Reply-To: <87y3yw7inw.fsf@users.sourceforge.net> (npostavs's message of "Sat, 31 Dec 2016 00:48:51 -0500") Message-ID: <87d1g8apw3.fsf@ericabrahamsen.net> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 12/31/16 00:48 AM, npostavs@users.sourceforge.net wrote: > Eric Abrahamsen writes: [...] >> I don't see how we could hijack at the lisp level, though. Functions >> like `eval-expression' and `backtrace--print-frame' simply toss whole >> lisp structures to prin1, there's no way to know that there's an eieio >> object somewhere in that structure. >> > > I think the only way to integrate `object-print' with the existing > `print' functions, would be to make it follow the same protocol. That > is, currently `object-print' is really `object-to-string', it should be > changed (or perhaps a new function (e.g., `print-object') would be a > better idea, so as not to break existing code too much) to accept a > PRINTCHARFUN argument, and print to it. The problem is that pretty much all of the printing happens at the C level. Whole lisp structures are sent directly to C, and it's the C code that recurses through them and decides how to print everything it finds inside. Lisp code never gets a chance (except in a few very specific situations). For example: when an error is raised, `backtrace--print-frame' gets all the contents of the error as a single argument. It simply punts that to `prin1', and then it's done. There's no chance to pick apart that single argument and see if there is an object inside. `eval-expression' essentially does the same thing. >> Personally, I'd be willing to lose the ability to customize object >> representations with `object-print', if it meant that print_object could >> produce a #> C test like INSTANCEP or what have you. >> > > That's easier, of course, but a non-customized representation would be > pretty uninformative. Having looked at the code, I'm not too optimistic about achieving the ideal solution. Getting eval-expression and backtraces to stop exploding seems like enough for now. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Dec 2016 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org, Eli Zaretskii Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148321214512655 (code B ref 25295); Sat, 31 Dec 2016 19:23:02 +0000 Received: (at 25295) by debbugs.gnu.org; 31 Dec 2016 19:22:25 +0000 Received: from localhost ([127.0.0.1]:33493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNPEX-0003I1-01 for submit@debbugs.gnu.org; Sat, 31 Dec 2016 14:22:25 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:36667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNPEV-0003Hn-I8 for 25295@debbugs.gnu.org; Sat, 31 Dec 2016 14:22:23 -0500 Received: by mail-it0-f41.google.com with SMTP id 75so230427471ite.1 for <25295@debbugs.gnu.org>; Sat, 31 Dec 2016 11:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vWg3o02LiDMG37o41mac6gMI4aPkwWUwnf7XBMtVkvs=; b=i1hqAQGZZZRr9mvIQcdK1e+eJZz8I5P5apLL8b0nqKTXoquOIlvyu67hXyZMY//D21 fN269bzQfrkDvrwiYaZ/DLsfPolJOtlzM+yekDDsJ8EnaX6yrw0dMKzimE2yar573QRS TQRFysq3byMzlYb/fMt7nGO22wYYn+jKPE2dqb3A9qp4wu91vXg1ze6Yn7f12euUdwGt 1wA81BdJ9HF2fIbmHYZFefGFYae2CAT0/GW8NylW6dPrYadYl4jiLJa5YFlbXI3RtF6u Z/JD7dKO6Ch/hE1NCuo0njBZyXWRsu+7S6Y5J22uhVSKq/pKqmE4SLQLT+RlHGmOvYvu pY9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=vWg3o02LiDMG37o41mac6gMI4aPkwWUwnf7XBMtVkvs=; b=rI/ZPiI43Qni2M+dLqCJdf7RCFLZvdVX74HlUCBpyhVzz3eom5FjbLB33VAOO0HaLi WCaM3dmK42QV+DY/6y1Iopa1y3304O/AY96KF5cZKULhO6MkQqhG9hOFTF3lMar/lDEa PEBm/nDaAlyQy0o9OFwoACPF8lkT/K6GwqTdgTZm7hYTcNLgfdNC9cH9EJfJKfPYYTnp kxctlT2uwGPZ+fyJRWiY35FGznUtpLlUTlN8hAT6PyA3aqWEPr9mJ01mwf57wyFpgt8r 97HO9YXWn2kJtv4aQ41UnLrz58pse0GcMW/SvQiE4P90VaY6GdwGVAzxfYmT/HdV3yat VrbQ== X-Gm-Message-State: AIkVDXIgTBePzndKDvtuK8Co7/bmC43445NnPKUuDkkisa8L62XlAOfhXgecKve0DaxE2w== X-Received: by 10.36.57.75 with SMTP id l72mr45278507ita.11.1483212137594; Sat, 31 Dec 2016 11:22:17 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id n102sm29153457ioi.38.2016.12.31.11.22.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 31 Dec 2016 11:22:17 -0800 (PST) From: npostavs@users.sourceforge.net References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87bmvu84lj.fsf@users.sourceforge.net> <01696DFE-7C0E-4FAC-8893-B6826DF7BCA8@ericabrahamsen.net> <87y3yw7inw.fsf@users.sourceforge.net> <87d1g8apw3.fsf@ericabrahamsen.net> Date: Sat, 31 Dec 2016 14:23:18 -0500 In-Reply-To: <87d1g8apw3.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 31 Dec 2016 10:56:44 -0800") Message-ID: <87vatz7vix.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Eric Abrahamsen writes: > On 12/31/16 00:48 AM, npostavs@users.sourceforge.net wrote: >> Eric Abrahamsen writes: >> >> I think the only way to integrate `object-print' with the existing >> `print' functions, would be to make it follow the same protocol. That >> is, currently `object-print' is really `object-to-string', it should be >> changed (or perhaps a new function (e.g., `print-object') would be a >> better idea, so as not to break existing code too much) to accept a >> PRINTCHARFUN argument, and print to it. > > The problem is that pretty much all of the printing happens at the C > level. Whole lisp structures are sent directly to C, and it's the C code > that recurses through them and decides how to print everything it finds > inside. Lisp code never gets a chance (except in a few very specific > situations). > > For example: when an error is raised, `backtrace--print-frame' gets all > the contents of the error as a single argument. It simply punts that to > `prin1', and then it's done. There's no chance to pick apart that single > argument and see if there is an object inside. `eval-expression' > essentially does the same thing. > You would need to add a branch in print_object to detect eieio objects, same as for the other alternative. >>> Personally, I'd be willing to lose the ability to customize object >>> representations with `object-print', if it meant that print_object could >>> produce a #>> C test like INSTANCEP or what have you. >>> >> >> That's easier, of course, but a non-customized representation would be >> pretty uninformative. > > Having looked at the code, I'm not too optimistic about achieving the > ideal solution. Getting eval-expression and backtraces to stop exploding > seems like enough for now. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Acknowledgement (26.0.50; Represent eieio objects using object-print in backtraces and edebug) Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Dec 2016 20:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: 25295@debbugs.gnu.org, Eli Zaretskii Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148321753720665 (code B ref 25295); Sat, 31 Dec 2016 20:53:02 +0000 Received: (at 25295) by debbugs.gnu.org; 31 Dec 2016 20:52:17 +0000 Received: from localhost ([127.0.0.1]:33515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNQdU-0005ND-1P for submit@debbugs.gnu.org; Sat, 31 Dec 2016 15:52:17 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:39035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNQdS-0005N6-KQ for 25295@debbugs.gnu.org; Sat, 31 Dec 2016 15:52:14 -0500 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 B70C9BC903; Sat, 31 Dec 2016 20:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483217533; bh=PkBLSMXTAaeuUK4j6ZSwgGQLl5nDRFDe1prBzGwZeFI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=q7AY0DrNwVc38OX/8XPIVvZLwAFpcfGF9gTD+z2+f57UIm4KbZT9LLJxKlln7MvrN NIts7fQujKRx/klkO+PWxrOAk5Myg23F1jTf+J/9J6/IJhQo+5UXmO1V+JckW/+h3c Ts/b2a7tRyC5rA/PEi77J/LiRWtB1ODJ041Lzy+M= From: Eric Abrahamsen References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87bmvu84lj.fsf@users.sourceforge.net> <01696DFE-7C0E-4FAC-8893-B6826DF7BCA8@ericabrahamsen.net> <87y3yw7inw.fsf@users.sourceforge.net> <87d1g8apw3.fsf@ericabrahamsen.net> <87vatz7vix.fsf@users.sourceforge.net> Date: Sat, 31 Dec 2016 12:52:12 -0800 In-Reply-To: <87vatz7vix.fsf@users.sourceforge.net> (npostavs's message of "Sat, 31 Dec 2016 14:23:18 -0500") Message-ID: <87pok7akjn.fsf@ericabrahamsen.net> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 12/31/16 14:23 PM, npostavs@users.sourceforge.net wrote: > Eric Abrahamsen writes: > >> On 12/31/16 00:48 AM, npostavs@users.sourceforge.net wrote: >>> Eric Abrahamsen writes: >>> >>> I think the only way to integrate `object-print' with the existing >>> `print' functions, would be to make it follow the same protocol. That >>> is, currently `object-print' is really `object-to-string', it should be >>> changed (or perhaps a new function (e.g., `print-object') would be a >>> better idea, so as not to break existing code too much) to accept a >>> PRINTCHARFUN argument, and print to it. >> >> The problem is that pretty much all of the printing happens at the C >> level. Whole lisp structures are sent directly to C, and it's the C code >> that recurses through them and decides how to print everything it finds >> inside. Lisp code never gets a chance (except in a few very specific >> situations). >> >> For example: when an error is raised, `backtrace--print-frame' gets all >> the contents of the error as a single argument. It simply punts that to >> `prin1', and then it's done. There's no chance to pick apart that single >> argument and see if there is an object inside. `eval-expression' >> essentially does the same thing. >> > > You would need to add a branch in print_object to detect eieio objects, > same as for the other alternative. Well sure, that's what this whole thread started out with. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Jan 2017 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148346769924179 (code B ref 25295); Tue, 03 Jan 2017 18:22:02 +0000 Received: (at 25295) by debbugs.gnu.org; 3 Jan 2017 18:21:39 +0000 Received: from localhost ([127.0.0.1]:40555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOTiN-0006Hv-CS for submit@debbugs.gnu.org; Tue, 03 Jan 2017 13:21:39 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:30533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOTiL-0006Hi-89 for 25295@debbugs.gnu.org; Tue, 03 Jan 2017 13:21:38 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AdKQAu3EVY/+UVNJ1dGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUnAImAZZehhwEAgKCEUQQAQIBAQEBAQEBYiiEaAEBAQECAVYjBQsLNBIUGA0kiHoIrRSLRAEBAQEGAgEkixmKKQWPfIpqmxqGOpIPNiB4Ew6DXBwYgWMgiS0BAQE X-IPAS-Result: A0AdKQAu3EVY/+UVNJ1dGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUnAImAZZehhwEAgKCEUQQAQIBAQEBAQEBYiiEaAEBAQECAVYjBQsLNBIUGA0kiHoIrRSLRAEBAQEGAgEkixmKKQWPfIpqmxqGOpIPNiB4Ew6DXBwYgWMgiS0BAQE X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="285266613" Received: from 157-52-21-229.cpe.teksavvy.com (HELO pastel.home) ([157.52.21.229]) by smtp.teksavvy.com with ESMTP; 03 Jan 2017 13:21:31 -0500 Received: by pastel.home (Postfix, from userid 20848) id ED07D653BC; Tue, 3 Jan 2017 13:21:30 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> Date: Tue, 03 Jan 2017 13:21:30 -0500 In-Reply-To: <8760m2mmlq.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 29 Dec 2016 13:50:09 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I guess this would require going into print.c and adding another branch > under the Lisp_Vectorlike case statement of object_print. That's right. > Is this sort of C code allowed to call back up to the lisp object-print > function? This is where I get lost... The Elisp-level printer and the interaction between the C code and the Elisp ill have to be worked out, indeed. E.g. you probably won't want to have Elisp-level printer to just call `format` or `prin1` since that does more than just print (it sets up a printing destination, initializes the cycle-detection table, then checks for cycles, ...). This said, making `prin1` reentrant will probably be helpful. One more thing: there have already been other desires/needs to tweak the printing from Elisp. E.g. to special case printing of objects that can't be printed readably (e.g. buffers, markers, overlays, ...). Stefan PS: One more thing; currently cl-structs and EIEIO objects are represented as plain normal arrays (and they mostly use the same representation now, where the first field contains a symbol whose function cell contains `:quick-object-witness-check` and whose value cell is the actual class object, which is a cl-struct that inherits from cl--class). It'd be good to instead provide a new kind of array just for objects/records/structs (just like we have the `compiled-function` type which is basically a normal array just with a different tag). This would let us get rid of the "symbol with a :quick-object-witness-check" indirection and would make it easier for the print.c code to delegate to the Elisp-level printer since it wouldn't need to know about the hackish representation choices of EIEIO and cl-structs. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jan 2017 23:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148357322921625 (code B ref 25295); Wed, 04 Jan 2017 23:41:01 +0000 Received: (at 25295) by debbugs.gnu.org; 4 Jan 2017 23:40:29 +0000 Received: from localhost ([127.0.0.1]:41583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOvAT-0005cj-Ct for submit@debbugs.gnu.org; Wed, 04 Jan 2017 18:40:29 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:41813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOvAQ-0005ca-QI for 25295@debbugs.gnu.org; Wed, 04 Jan 2017 18:40:27 -0500 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 CB0A2BE9FD; Wed, 4 Jan 2017 23:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483573226; bh=Z0LIJFhDJdjAYlXZN2YQRef/CJvVJIoQpNw4WQmtyRk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jOQe3YTlKRpidQ0fSopkmpwZmUtFb75N7R8qLXNHs5drbet9IGpOTmrdRusX60FPS btCPO7a9Tgd5MwFaKfIZ25V9G8hxCglx42yOxcMbieUTGu1e+Uen7oGASSfTdy/Z43 AzAgOHWqLXnDeRCrVVfHSxPCHnQr/DiiHLut0DLc= From: Eric Abrahamsen References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> Date: Wed, 04 Jan 2017 15:40:24 -0800 In-Reply-To: (Stefan Monnier's message of "Tue, 03 Jan 2017 13:21:30 -0500") Message-ID: <87lguq5r87.fsf@ericabrahamsen.net> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 01/03/17 13:21 PM, Stefan Monnier wrote: >> I guess this would require going into print.c and adding another branch >> under the Lisp_Vectorlike case statement of object_print. > > That's right. > >> Is this sort of C code allowed to call back up to the lisp object-print >> function? This is where I get lost... > > The Elisp-level printer and the interaction between the C code and > the Elisp ill have to be worked out, indeed. > > E.g. you probably won't want to have Elisp-level printer to just call > `format` or `prin1` since that does more than just print (it sets up > a printing destination, initializes the cycle-detection table, then > checks for cycles, ...). > > This said, making `prin1` reentrant will probably be helpful. If an Elisp-level printer is available to users and developers, I think we'd have to assume they will throw any old thing in there, including `format' and `prin1'. Would making `prin1' reentrant solve all of the resulting problems? > One more thing: there have already been other desires/needs to tweak the > printing from Elisp. E.g. to special case printing of objects that > can't be printed readably (e.g. buffers, markers, overlays, ...). That's good! But the previous issue would still need to be resolved. > > Stefan > > > PS: One more thing; currently cl-structs and EIEIO objects are > represented as plain normal arrays (and they mostly use the same > representation now, where the first field contains a symbol whose > function cell contains `:quick-object-witness-check` and whose value > cell is the actual class object, which is a cl-struct that inherits > from cl--class). > > It'd be good to instead provide a new kind of array just for > objects/records/structs (just like we have the `compiled-function` type > which is basically a normal array just with a different tag). > This would let us get rid of the "symbol with > a :quick-object-witness-check" indirection and would make it easier for > the print.c code to delegate to the Elisp-level printer since it > wouldn't need to know about the hackish representation choices of EIEIO > and cl-structs. I really wish I could help, but I've never written a line of C, and in twenty minutes of looking through the sources earlier today, I couldn't even find where the array types were defined. It sounds like this would be Step One of solving the problem, but I would not be able to do it without some substantial hand-holding. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 01:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.1483581078399 (code B ref 25295); Thu, 05 Jan 2017 01:52:01 +0000 Received: (at 25295) by debbugs.gnu.org; 5 Jan 2017 01:51:18 +0000 Received: from localhost ([127.0.0.1]:41613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOxD4-00006N-BI for submit@debbugs.gnu.org; Wed, 04 Jan 2017 20:51:18 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:42465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOxD2-00006F-Vg for 25295@debbugs.gnu.org; Wed, 04 Jan 2017 20:51:17 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v051pEXc004218; Wed, 4 Jan 2017 20:51:15 -0500 Received: by ceviche.home (Postfix, from userid 20848) id AA9356625E; Wed, 4 Jan 2017 20:51:14 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> Date: Wed, 04 Jan 2017 20:51:14 -0500 In-Reply-To: <87lguq5r87.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 04 Jan 2017 15:40:24 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5909=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5909> : inlines <5617> : streams <1727689> : uri <2352659> X-Spam-Score: -4.5 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) > If an Elisp-level printer is available to users and developers, I think > we'd have to assume they will throw any old thing in there, including > `format' and `prin1'. Would making `prin1' reentrant solve all of the > resulting problems? Maybe the better solution would be to make `prin1` (and `format`, ..) signal errors. Instead, we could provide the printer with a special prin1-like function which basically "continues" the print job in the C code. >> One more thing: there have already been other desires/needs to tweak the >> printing from Elisp. E.g. to special case printing of objects that >> can't be printed readably (e.g. buffers, markers, overlays, ...). > That's good! But the previous issue would still need to be resolved. Yes, and they're largely independent: the printer you're talking about would be used when we don't want to print readably, whereas this case would apply to the situation where we want to print readably (in which case we don't want to go through custom pretty printers like the one you need). Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 02:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14835822802169 (code B ref 25295); Thu, 05 Jan 2017 02:12:02 +0000 Received: (at 25295) by debbugs.gnu.org; 5 Jan 2017 02:11:20 +0000 Received: from localhost ([127.0.0.1]:41617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOxWS-0000Yv-1F for submit@debbugs.gnu.org; Wed, 04 Jan 2017 21:11:20 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:57199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOxWQ-0000Yn-A5 for 25295@debbugs.gnu.org; Wed, 04 Jan 2017 21:11:18 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v052BGHM002719; Wed, 4 Jan 2017 21:11:16 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 0133E6625E; Wed, 4 Jan 2017 21:11:15 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> Date: Wed, 04 Jan 2017 21:11:15 -0500 In-Reply-To: (Stefan Monnier's message of "Wed, 04 Jan 2017 20:51:14 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5909=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5909> : inlines <5617> : streams <1727691> : uri <2352667> X-Spam-Score: -4.5 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) > Maybe the better solution would be to make `prin1` (and `format`, ..) > signal errors. Instead, we could provide the printer with a special > prin1-like function which basically "continues" the print job in the > C code. Actually, print.c is already setup to be (at least partially) reentrant (for the case `printcharfun` is a function), so maybe making it fully reentrant won't be too hard. But we'd still want to provide some ad-hoc prin1-like function which continues the print job rather than starting a new nested one; this is needed e.g. if the custom printer wants to print a value V but V has already been printed so it should be printed as a reference #NN# to the previous one. Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 04:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148359105521939 (code B ref 25295); Thu, 05 Jan 2017 04:38:01 +0000 Received: (at 25295) by debbugs.gnu.org; 5 Jan 2017 04:37:35 +0000 Received: from localhost ([127.0.0.1]:41672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOznz-0005hn-Ho for submit@debbugs.gnu.org; Wed, 04 Jan 2017 23:37:35 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:61089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOznx-0005ha-L6 for 25295@debbugs.gnu.org; Wed, 04 Jan 2017 23:37:34 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C4IAAu3EVY/96OSC1dGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUnAKXBYYiAoISQxABAgEBAQEBAQFiKIRpAQQBeQULCw0nEhQYMYh6CK0UKgKLGAEBAQEGAgEkixmKKQWPfIpqmxolhhWSDzYgeBMOhBCBYyCJLQEBAQ X-IPAS-Result: A0C4IAAu3EVY/96OSC1dGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUnAKXBYYiAoISQxABAgEBAQEBAQFiKIRpAQQBeQULCw0nEhQYMYh6CK0UKgKLGAEBAQEGAgEkixmKKQWPfIpqmxolhhWSDzYgeBMOhBCBYyCJLQEBAQ X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="285383848" Received: from unknown (HELO pastel.home) ([45.72.142.222]) by smtp.teksavvy.com with ESMTP; 04 Jan 2017 23:37:26 -0500 Received: by pastel.home (Postfix, from userid 20848) id ABF395FE97; Wed, 4 Jan 2017 23:37:26 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> Date: Wed, 04 Jan 2017 23:37:26 -0500 In-Reply-To: (Stefan Monnier's message of "Wed, 04 Jan 2017 21:11:15 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Actually, print.c is already setup to be (at least partially) reentrant > (for the case `printcharfun` is a function), so maybe making it fully > reentrant won't be too hard. But we'd still want to provide some ad-hoc > prin1-like function which continues the print job rather than starting > a new nested one; this is needed e.g. if the custom printer wants to > print a value V but V has already been printed so it should be printed > as a reference #NN# to the previous one. Looking further at the code, maybe this isn't even needed, since the print-number-table can survive calls to print. But that can get ugly when your printer code also want to call `print` for "unrelated" purposes (e.g. to print debug messages in a side buffer). And I'll stop thinking about interaction with concurrency. Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: eric@ericabrahamsen.net, 25295@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14836307591621 (code B ref 25295); Thu, 05 Jan 2017 15:40:02 +0000 Received: (at 25295) by debbugs.gnu.org; 5 Jan 2017 15:39:19 +0000 Received: from localhost ([127.0.0.1]:43985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPA8N-0000Q5-DD for submit@debbugs.gnu.org; Thu, 05 Jan 2017 10:39:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPA8L-0000Pq-Vi for 25295@debbugs.gnu.org; Thu, 05 Jan 2017 10:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPA8E-0007Go-HK for 25295@debbugs.gnu.org; Thu, 05 Jan 2017 10:39:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPA8E-0007Gk-Dq; Thu, 05 Jan 2017 10:39:10 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4907 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cPA8D-0005EE-MK; Thu, 05 Jan 2017 10:39:10 -0500 Date: Thu, 05 Jan 2017 17:39:26 +0200 Message-Id: <83bmvlecsx.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Stefan Monnier on Wed, 04 Jan 2017 23:37:26 -0500) References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Stefan Monnier > Date: Wed, 04 Jan 2017 23:37:26 -0500 > Cc: 25295@debbugs.gnu.org > > And I'll stop thinking about interaction with concurrency. There should be none, since only one thread running Lisp could be doing that at any given time. Right? From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jan 2017 00:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: eric@ericabrahamsen.net, 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14836633849068 (code B ref 25295); Fri, 06 Jan 2017 00:44:02 +0000 Received: (at 25295) by debbugs.gnu.org; 6 Jan 2017 00:43:04 +0000 Received: from localhost ([127.0.0.1]:44138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPIca-0002MC-AU for submit@debbugs.gnu.org; Thu, 05 Jan 2017 19:43:04 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:20949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPIcX-0002Le-NA for 25295@debbugs.gnu.org; Thu, 05 Jan 2017 19:43:02 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BpNQAu3EVY/96OSC1dGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUnAImAZZehhwEAgKCEUQQAQIBAQEBAQEBYihCEgGEFAEEAScvIxALNBIUGA0kiHoIrFc9i0QBAQEBBgIBJIsZiikFj3yKapJzAYgmhjqSDzYgeBMOhBCBYyCGMYJ8AQEB X-IPAS-Result: A0BpNQAu3EVY/96OSC1dGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUnAImAZZehhwEAgKCEUQQAQIBAQEBAQEBYihCEgGEFAEEAScvIxALNBIUGA0kiHoIrFc9i0QBAQEBBgIBJIsZiikFj3yKapJzAYgmhjqSDzYgeBMOhBCBYyCGMYJ8AQEB X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="285461992" Received: from 45-72-142-222.cpe.teksavvy.com (HELO pastel.home) ([45.72.142.222]) by smtp.teksavvy.com with ESMTP; 05 Jan 2017 19:42:55 -0500 Received: by pastel.home (Postfix, from userid 20848) id 7A4C15FBC2; Thu, 5 Jan 2017 19:42:55 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <83bmvlecsx.fsf@gnu.org> Date: Thu, 05 Jan 2017 19:42:55 -0500 In-Reply-To: <83bmvlecsx.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Jan 2017 17:39:26 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> And I'll stop thinking about interaction with concurrency. > There should be none, since only one thread running Lisp could be > doing that at any given time. Right? I'm thinking of prin1 -> enters print.c -> calls back the custom Elisp-side object-print -> which decides to accept-process-output -- Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jan 2017 07:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: eric@ericabrahamsen.net, 25295@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148368904828531 (code B ref 25295); Fri, 06 Jan 2017 07:51:01 +0000 Received: (at 25295) by debbugs.gnu.org; 6 Jan 2017 07:50:48 +0000 Received: from localhost ([127.0.0.1]:44405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPPIW-0007Q6-7w for submit@debbugs.gnu.org; Fri, 06 Jan 2017 02:50:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPPIT-0007Pq-TS for 25295@debbugs.gnu.org; Fri, 06 Jan 2017 02:50:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPPIL-0008Cp-NS for 25295@debbugs.gnu.org; Fri, 06 Jan 2017 02:50:40 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPPIL-0008Ck-KT; Fri, 06 Jan 2017 02:50:37 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4193 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cPPIK-0000jk-Uk; Fri, 06 Jan 2017 02:50:37 -0500 Date: Fri, 06 Jan 2017 09:50:55 +0200 Message-Id: <83o9zkd3ts.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Stefan Monnier on Thu, 05 Jan 2017 19:42:55 -0500) References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <83bmvlecsx.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Stefan Monnier > Cc: eric@ericabrahamsen.net, 25295@debbugs.gnu.org > Date: Thu, 05 Jan 2017 19:42:55 -0500 > > prin1 > -> enters print.c > -> calls back the custom Elisp-side object-print > -> which decides to accept-process-output This will cause problems without any threads as well, because the last line might cause timers to run. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2017 02:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eric Abrahamsen , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14876457449682 (code B ref 25295); Tue, 21 Feb 2017 02:56:02 +0000 Received: (at 25295) by debbugs.gnu.org; 21 Feb 2017 02:55:44 +0000 Received: from localhost ([127.0.0.1]:47981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg0cC-0002W6-Ic for submit@debbugs.gnu.org; Mon, 20 Feb 2017 21:55:44 -0500 Received: from mail-it0-f42.google.com ([209.85.214.42]:37504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg0cA-0002Vs-Dy for 25295@debbugs.gnu.org; Mon, 20 Feb 2017 21:55:42 -0500 Received: by mail-it0-f42.google.com with SMTP id 203so30166294ith.0 for <25295@debbugs.gnu.org>; Mon, 20 Feb 2017 18:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=c0a+aZovl+E7KKKml6ubCCdj5ZdoTgvI3KovkA4X1LQ=; b=XSOeNcL1CSZd8UkZjM7MXILBqynimiCD0ll6osNkc7YXVfWtrl+TGVtgbB1jrH7MV6 1FQrSatTYN1aMvytAUtb6cOeke85smYLee09usVtGOaYeuob9smZAmV4BwrDENsbUG9+ FuCIb1IYUhbOzS0TGS5MDiNNJ8TVUUc36RSReKR4TGiBgXNHM5+A/TLFcLbAqBbAPwIT JxaaXl69zJwfCiDp0fgoCofsYPcvtUC9A9VkNdJQLSNDAbdI3lRQqsz6vzcy5sXOHg9o QO6l73vEwGwFIdcF6fmuVzVcu51b7HUCSOWNl/PGFeDng7XdJ11MmXNAcSaYFcpP9rDI 3jvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=c0a+aZovl+E7KKKml6ubCCdj5ZdoTgvI3KovkA4X1LQ=; b=OIzUKicglCocbG6/3ywObGFyRGV/TLeaPiwdD3ySDjDGlGzSHnT+9tBt7UzPJrGjtT 2PEL2Jpac5ns8O2lYOXtAOxBr4cfkC8EE2Se4MD376VUwAeMtD40dukVaOV31AziFD8m b5MF9/8LDBr78XCmRUWgfuUG8RYzbJiTs5igE9c2XgZ8lBIg7+VLUf45K2s6DQnGHe1j ophjepm7Iu9w9qlMG+R1rDwbiz8MvjvutHmf4QfXoRALvtqajEN2CMdyuz5/ZQhskoH4 wNp6neX0qgogT8FuNU0xglaXGx41kV924PDNTKTp1WZvbQ8eCL3FmhPwQwww/Q8wyUS6 ed1A== X-Gm-Message-State: AMke39n5Oju4neoEKvszwflTx7zx4VkWvF4evjOaAxbPOsCMy0PpzAEMT3HrFgiW7zZzmg== X-Received: by 10.107.59.201 with SMTP id i192mr20420388ioa.196.1487645736510; Mon, 20 Feb 2017 18:55:36 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 62sm6969098itl.1.2017.02.20.18.55.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2017 18:55:35 -0800 (PST) From: npostavs@users.sourceforge.net References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> Date: Mon, 20 Feb 2017 21:56:47 -0500 In-Reply-To: (Stefan Monnier's message of "Wed, 04 Jan 2017 23:37:26 -0500") Message-ID: <878tp0i74g.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) Stefan Monnier writes: >> Actually, print.c is already setup to be (at least partially) reentrant >> (for the case `printcharfun` is a function), so maybe making it fully >> reentrant won't be too hard. But we'd still want to provide some ad-hoc >> prin1-like function which continues the print job rather than starting >> a new nested one; this is needed e.g. if the custom printer wants to >> print a value V but V has already been printed so it should be printed >> as a reference #NN# to the previous one. > > Looking further at the code, maybe this isn't even needed, since the > print-number-table can survive calls to print. But that can get ugly > when your printer code also want to call `print` for "unrelated" > purposes (e.g. to print debug messages in a side buffer). > And I'll stop thinking about interaction with concurrency. Can we allow overriding printing of primitive types too? I'm wanting that for e.g., printing byte code functions in nicer ways. Looking to Common Lisp for inspiration, there is generic function print-object[1], and also *print-pprint-dispatch* (an alist of type specifiers -> printer functions). Cycle detection state seems to be packed in with STREAM, which is convenient, although dispatching on STREAM becomes harder. [1]: http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/stagenfun_print-object.html [2]: http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_22-2-1-4.html From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2017 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: Eric Abrahamsen , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148769779624306 (code B ref 25295); Tue, 21 Feb 2017 17:24:02 +0000 Received: (at 25295) by debbugs.gnu.org; 21 Feb 2017 17:23:16 +0000 Received: from localhost ([127.0.0.1]:49139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgE9k-0006Jx-DB for submit@debbugs.gnu.org; Tue, 21 Feb 2017 12:23:16 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:53014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgE9i-0006Jp-Fz for 25295@debbugs.gnu.org; Tue, 21 Feb 2017 12:23:15 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v1LHNCvE005349; Tue, 21 Feb 2017 12:23:13 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 400206627C; Tue, 21 Feb 2017 12:23:12 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <878tp0i74g.fsf@users.sourceforge.net> Date: Tue, 21 Feb 2017 12:23:12 -0500 In-Reply-To: <878tp0i74g.fsf@users.sourceforge.net> (npostavs's message of "Mon, 20 Feb 2017 21:56:47 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 3 Rules triggered TRK_NCM1=0.1, EDT_SA_DN_PASS=0, RV5954=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5954> : inlines <5711> : streams <1733922> : uri <2380983> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Can we allow overriding printing of primitive types too? > I'm wanting that for e.g., printing byte code functions in nicer ways. Maybe we should just switch to an Elisp version of printing, in that case. We could keep the C code for the "print-readably" case only. The main question is whether it's fast enough. Stefan ;;; cl-print.el --- Generic printer facilies -*- lexical-binding: t; -*- ;; Copyright (C) 2017 Stefan Monnier ;; Author: Stefan Monnier ;; Keywords: ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;;; Code: ;;;###autoload (cl-defgeneric cl-print-object (object stream) "Dispatcher to print OBJECT on STREAM according to its type." (prin1 object stream)) (cl-defmethod cl-print-object ((object cons) stream) (let ((car (pop object))) (if (and (memq car '(\, quote \` \,@ \,.)) (consp object) (null (cdr object))) (progn (princ (if (eq car 'quote) '\' car) stream) (cl-print-object (car object) stream)) (princ "(" stream) (cl-print-object car stream) (while (consp object) (princ " " stream) (cl-print-object (pop object) stream)) (when object (princ " . ") (cl-print-object object stream)) (princ ")")))) (cl-defmethod cl-print-object ((object vector) stream) (princ "[" stream) (dotimes (i (length object)) (unless (zerop i) (princ " " stream)) (cl-print-object (aref object i) stream)) (princ "]" stream)) (cl-defmethod cl-print-object ((object compiled-function) stream) ;; FIXME: Give a prettier representation. (princ "#" stream)) (cl-defmethod cl-print-object ((object cl-structure-object) stream) (princ "#s(") (let* ((class (symbol-value (aref object 0))) (slots (cl--struct-class-slots class))) (princ (cl--struct-class-name class) stream) (dotimes (i (length slots)) (let ((slot (aref slots i))) (princ " :" stream) (princ (cl--slot-descriptor-name slot) stream) (princ " " stream) (cl-print-object (aref object (1+ i)) stream)))) (princ ")")) ;;; Circularity and sharing. ;; I don't try to support the `print-continuous-numbering', because ;; I think it's ill defined anyway: if an object appears only once in each call ;; its sharing can't be properly preserved! (defvar cl-print--number-index nil) (defvar cl-print--number-table nil) (cl-defmethod cl-print-object :around (object stream) ;; FIXME: Only put such an :around method on types where it's relevant. (let ((n (if cl-print--number-table (gethash object cl-print--number-table)))) (if (not (numberp n)) (cl-call-next-method) (if (> n 0) ;; Already printed. Just print a reference. (progn (princ "#" stream) (princ n stream) (princ "#" stream)) (puthash object (- n) cl-print--number-table) (princ "#" stream) (princ (- n) stream) (princ "=" stream) (cl-call-next-method))))) (defun cl-print--find-sharing (object table) (unless ;; Skip objects which don't have identity! (or (floatp object) (numberp object)) (let ((n (gethash object table))) (cond ((numberp n)) ;All done. (n ;Already seen, but only once. (let ((n (1+ cl-print--number-index))) (setq cl-print--number-index n) (puthash object (- n) table))) (t (puthash object t table) (pcase object (`(,car . ,cdr) (cl-print--find-sharing car table) (cl-print--find-sharing cdr table)) ((pred stringp) ;; We presumably won't print its text-properties. nil) ((pred arrayp) ;FIXME: Inefficient for char-tables! (dotimes (i (length object)) (cl-print--find-sharing (aref object i) table))))))))) ;;;###autoload (defun cl-prin1 (object &optional stream) (if (not print-circle) (cl-print-object object stream) (let ((cl-print--number-table (make-hash-table :test 'eq)) (cl-print--number-index 0)) (cl-print--find-sharing object cl-print--number-table) (cl-print-object object stream)))) (provide 'cl-print) ;;; cl-print.el ends here From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Feb 2017 16:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: eric@ericabrahamsen.net, 25295@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: rms@gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14877801649851 (code B ref 25295); Wed, 22 Feb 2017 16:17:01 +0000 Received: (at 25295) by debbugs.gnu.org; 22 Feb 2017 16:16:04 +0000 Received: from localhost ([127.0.0.1]:51359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgZaG-0002Yo-Gl for submit@debbugs.gnu.org; Wed, 22 Feb 2017 11:16:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgZaF-0002Y6-EU for 25295@debbugs.gnu.org; Wed, 22 Feb 2017 11:16:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgZa9-0007do-Ew for 25295@debbugs.gnu.org; Wed, 22 Feb 2017 11:15:58 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgZZn-0007Ni-Qp; Wed, 22 Feb 2017 11:15:35 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cgZZn-0005dC-6g; Wed, 22 Feb 2017 11:15:35 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman In-reply-to: (message from Stefan Monnier on Tue, 21 Feb 2017 12:23:12 -0500) References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <878tp0i74g.fsf@users.sourceforge.net> Message-Id: Date: Wed, 22 Feb 2017 11:15:35 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Most of the time, the speed of printing is not important. But I suspect there are cases where people print a lot of data and the speed of printing is crucial. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Feb 2017 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Richard Stallman Cc: eric@ericabrahamsen.net, 25295@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148779051225022 (code B ref 25295); Wed, 22 Feb 2017 19:09:01 +0000 Received: (at 25295) by debbugs.gnu.org; 22 Feb 2017 19:08:32 +0000 Received: from localhost ([127.0.0.1]:51520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgcHA-0006VW-JH for submit@debbugs.gnu.org; Wed, 22 Feb 2017 14:08:32 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgcH7-0006VI-Uq for 25295@debbugs.gnu.org; Wed, 22 Feb 2017 14:08:31 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v1MJ8SO6028992; Wed, 22 Feb 2017 14:08:28 -0500 Received: by pastel.home (Postfix, from userid 20848) id 5EBC16092E; Wed, 22 Feb 2017 14:08:28 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <878tp0i74g.fsf@users.sourceforge.net> Date: Wed, 22 Feb 2017 14:08:28 -0500 In-Reply-To: (Richard Stallman's message of "Wed, 22 Feb 2017 11:15:35 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5955=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5955> : inlines <5713> : streams <1734076> : uri <2381573> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Most of the time, the speed of printing is not important. > But I suspect there are cases where people print a lot of data > and the speed of printing is crucial. Indeed. I know `C-h v load-history` is often sluggish, for example, because of the size of the value. I've been trying my cl-print code and the speed is clearly inferior to the C code, but at least in the case of C-h v the main slowdown comes from the prettifying step that happens after printing (where we insert newlines and indent the result), so while it gets measurably slower, the impact might be tolerable. Clearly, for cases such as when the byte-compiler wants to print the result into a .elc file, or when we want to save an undo-log in a file, speed will be very important and my cl-print is unlikely to be good enough. That's why I was suggesting that maybe we should have 2 printers: a fast one in C for the `print-readably` case, and a slower but customizable one in Elisp for "human consumption". Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2017 07:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14884380624187 (code B ref 25295); Thu, 02 Mar 2017 07:02:01 +0000 Received: (at 25295) by debbugs.gnu.org; 2 Mar 2017 07:01:02 +0000 Received: from localhost ([127.0.0.1]:35236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjKjW-00015T-JG for submit@debbugs.gnu.org; Thu, 02 Mar 2017 02:01:02 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:9054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjKjT-00014o-Ny for 25295@debbugs.gnu.org; Thu, 02 Mar 2017 02:01:00 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BPBQAawrdY/zPujBhdGgEBAQECAQEBAQgBAQEBgycpQYQ4hVaFAnOQcykBlQuCDYYcBAICgjxAGAECAQEBAQEBAWIoQg4BhCABBAFWIwULCzQSFBgNJIoFCLNsixgBAQEBAQUCASWLO4o5BZBUi1SccIZgkzYfOIEBIRQILD6FBYFmIoF3iDwBAQE X-IPAS-Result: A0BPBQAawrdY/zPujBhdGgEBAQECAQEBAQgBAQEBgycpQYQ4hVaFAnOQcykBlQuCDYYcBAICgjxAGAECAQEBAQEBAWIoQg4BhCABBAFWIwULCzQSFBgNJIoFCLNsixgBAQEBAQUCASWLO4o5BZBUi1SccIZgkzYfOIEBIRQILD6FBYFmIoF3iDwBAQE X-IronPort-AV: E=Sophos;i="5.35,228,1484024400"; d="scan'208";a="294241305" Received: from 24-140-238-51.cpe.teksavvy.com (HELO pastel.home) ([24.140.238.51]) by smtp.teksavvy.com with ESMTP; 02 Mar 2017 02:00:53 -0500 Received: by pastel.home (Postfix, from userid 20848) id 84E266565E; Thu, 2 Mar 2017 02:00:53 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> Date: Thu, 02 Mar 2017 02:00:53 -0500 In-Reply-To: <87pokampa4.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 29 Dec 2016 12:52:19 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Objects have an `object-print' method which produces the # > representation, but this appears to only sometimes be used in edebug, > and never in backtraces. I've installed a cl-print.el package into Emacs's master branch which is like EIEIO's object-print but more thorough. This is now used in edebug, so it should hopefully fix the "only sometimes" part (and it additionally knows about cl-defstructs as well, rather than only EIEIO objects). Using it in backtraces should be a simple matter of applying the patch below. I haven't installed it because I'm afraid of the potential breakage and slowdown of using cl-prin1, so I'd rather wait and see how it fares in Edebug first. My experiments seem to indicate that it might be "good enough" but it might also suffer from the overhead of cl-generic (mostly the fact that a call to a generic-function ends up going through some &rest+apply which in cl-print's case end up generating a lot of garbage: in one of my tests, the cl-print code was twice slower than the C code but the added time was almost entirely spent in the GC and that seemed to come exclusively from the lists allocated for &rest. I.e. if we could change cl-generic so it doesn't use &rest+apply as much there's a chance it could potentially be about as fast as the C code). Stefan diff --git a/lisp/subr.el b/lisp/subr.el index ea159e733c..68bfceb8d2 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4660,10 +4660,10 @@ backtrace--print-frame (princ (if (plist-get flags :debug-on-exit) "* " " ")) (cond ((and evald (not debugger-stack-frame-as-list)) - (prin1 func) - (if args (prin1 args) (princ "()"))) + (cl-prin1 func) + (if args (cl-prin1 args) (princ "()"))) (t - (prin1 (cons func args)))) + (cl-prin1 (cons func args)))) (princ "\n")) (defun backtrace () From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2017 12:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eric Abrahamsen , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148845907210450 (code B ref 25295); Thu, 02 Mar 2017 12:52:02 +0000 Received: (at 25295) by debbugs.gnu.org; 2 Mar 2017 12:51:12 +0000 Received: from localhost ([127.0.0.1]:35454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjQCO-0002iU-85 for submit@debbugs.gnu.org; Thu, 02 Mar 2017 07:51:12 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:35235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjQCM-0002iH-KI for 25295@debbugs.gnu.org; Thu, 02 Mar 2017 07:51:10 -0500 Received: by mail-it0-f41.google.com with SMTP id 203so117782590ith.0 for <25295@debbugs.gnu.org>; Thu, 02 Mar 2017 04:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=CCi02wf1OPlhTyvc7DzD7TKprSKEE44KeFNmaKZNxpI=; b=OXUjs6HWKyu9aVxGKJ9Zo5GnxQXNH5Lo0iLI0QJmYaQt7tpIBAH42Ek2aBX+oF8u+h 1DzNRWAT6A3/zXRuuJ/XwM74DpIBrBlbieV/sE0MKGRKy+B8YH0orJW/+fy6nS2djHIv 6lnsQa3O1/vhf8KE7sZwMB3D5+lBzrcSPMILoY/llED1h/as8nKA0JtiTHcDLxYbsgP5 G2w1k9pjyLl0As18iXV3+8Yxht/PrfWvV0QJnaxtb/gs0SwaicPWknmaUirKC3G1VFVD qzzVoY0rPpep6jxr9inecCoaDS50nTitVzbajH2twoioT76gJXwmF/C8LMj6G+faOMrd qpqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=CCi02wf1OPlhTyvc7DzD7TKprSKEE44KeFNmaKZNxpI=; b=EHKmUIC/66SGmlO2c25D7RirssO0bewwNFTjshW+YVPIwexbF5RurTJPgxJqytERMP qEJu6hvlWQSg7sEOfpJcK2TCZVZpr+mGBXRXLYFmJ8fkI5MrfHn/ANtPYWK8re4BVFKo KLOroYxgVD3w+jNlkrhxMNCKZI0zfPdbR/VoribfH+XOda1JNPrBrhTrFiVQuvuaa0iy nIhJKitAWcVhQsjDVdQIu9SXzShAHvgNClGHnL/xq0KsjUGUOkQTs9GTUF1z0gtdjI/E mxndDkTO2gKKtNgVhTOPLPuCJZVYjzCic7JDVBcEWd38XF8jA8LzG/PWe80NvElnUtvT bJfA== X-Gm-Message-State: AMke39m4QYCyV0k8A/VQKvDMgHNR6E3sZHpm3k+0k2w5lIIQklGs9DNqZT1HB8rUoypUMw== X-Received: by 10.36.200.9 with SMTP id w9mr9742202itf.113.1488459064973; Thu, 02 Mar 2017 04:51:04 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l33sm1528370iod.8.2017.03.02.04.51.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Mar 2017 04:51:04 -0800 (PST) From: npostavs@users.sourceforge.net References: <87pokampa4.fsf@ericabrahamsen.net> Date: Thu, 02 Mar 2017 07:52:18 -0500 In-Reply-To: (Stefan Monnier's message of "Thu, 02 Mar 2017 02:00:53 -0500") Message-ID: <87innrc03h.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Stefan Monnier writes: > My experiments seem to indicate that it might > be "good enough" but it might also suffer from the overhead of > cl-generic (mostly the fact that a call to a generic-function ends up > going through some &rest+apply which in cl-print's case end up > generating a lot of garbage: in one of my tests, the cl-print code was > twice slower than the C code but the added time was almost entirely > spent in the GC and that seemed to come exclusively from the lists > allocated for &rest. I.e. if we could change cl-generic so it doesn't > use &rest+apply as much there's a chance it could potentially be about > as fast as the C code). I have an idea to use this for the pretty printer so it that produces the correct spacing while printing. I think this would end up faster than calling indent-sexp afterwards. But it would involve dispatching on STREAM, and according to the comments in cl-generic.el multiple dispatch adds more apply calls. Thoughts? From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2017 13:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: Eric Abrahamsen , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148846192714696 (code B ref 25295); Thu, 02 Mar 2017 13:39:02 +0000 Received: (at 25295) by debbugs.gnu.org; 2 Mar 2017 13:38:47 +0000 Received: from localhost ([127.0.0.1]:35488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjQwQ-0003oy-Q2 for submit@debbugs.gnu.org; Thu, 02 Mar 2017 08:38:46 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:51054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjQwO-0003oj-3y for 25295@debbugs.gnu.org; Thu, 02 Mar 2017 08:38:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0APCQASILhY/zPujBheGgEBAQECAQEBAQgBAQEBg1CEeYVWhXWQdCkBlxiGHAQCAoJGQxUBAgEBAQEBAQFiKIRxAQQBViMFCws0EhQYDYopCLN+ixUBAQEBAQUCASWLO4UghRkFkFSLVZQVAYhbhmCTNzUigQEhFAgshUOBZiKKMwEBAQ X-IPAS-Result: A0APCQASILhY/zPujBheGgEBAQECAQEBAQgBAQEBg1CEeYVWhXWQdCkBlxiGHAQCAoJGQxUBAgEBAQEBAQFiKIRxAQQBViMFCws0EhQYDYopCLN+ixUBAQEBAQUCASWLO4UghRkFkFSLVZQVAYhbhmCTNzUigQEhFAgshUOBZiKKMwEBAQ X-IronPort-AV: E=Sophos;i="5.35,231,1484024400"; d="scan'208";a="294266600" Received: from 24-140-238-51.cpe.teksavvy.com (HELO ceviche.home) ([24.140.238.51]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Mar 2017 08:38:20 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 8F62666286; Thu, 2 Mar 2017 08:38:18 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <87innrc03h.fsf@users.sourceforge.net> Date: Thu, 02 Mar 2017 08:38:18 -0500 In-Reply-To: <87innrc03h.fsf@users.sourceforge.net> (npostavs's message of "Thu, 02 Mar 2017 07:52:18 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I have an idea to use this for the pretty printer so it that produces > the correct spacing while printing. I think this would end up faster > than calling indent-sexp afterwards. But it would involve dispatching > on STREAM, and according to the comments in cl-generic.el multiple > dispatch adds more apply calls. Thoughts? No idea, how would that work? Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2017 17:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.14884761435213 (code B ref 25295); Thu, 02 Mar 2017 17:36:01 +0000 Received: (at 25295) by debbugs.gnu.org; 2 Mar 2017 17:35:43 +0000 Received: from localhost ([127.0.0.1]:36779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjUdj-0001M1-Lm for submit@debbugs.gnu.org; Thu, 02 Mar 2017 12:35:43 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:37311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjUdh-0001Ls-Tu for 25295@debbugs.gnu.org; Thu, 02 Mar 2017 12:35:42 -0500 Received: from localhost (71-212-6-137.tukw.qwest.net [71.212.6.137]) (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 4B1D3BE053; Thu, 2 Mar 2017 17:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1488476140; bh=WFpLAlmHmWy1gM4P+nvw+5s9881aYOxfQDYzmabylho=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=D9/Btz5/VMv7PEEmpSQvdcKhx6ct3AuTiTVudCnVGpIh89Qc0GAdFObHKjZcanVjl 8V1zmjt9GzPVUbPG80Jbt6oakSq8mrNsT7L/6190xzMi7dKQkg81s+NttB5ybCRNeg UjMHjLxPlp8pirSe1Z5S3np4rYY2RW5kB+WvLBXI= From: Eric Abrahamsen References: <87pokampa4.fsf@ericabrahamsen.net> Date: Thu, 02 Mar 2017 09:35:36 -0800 In-Reply-To: (Stefan Monnier's message of "Thu, 02 Mar 2017 02:00:53 -0500") Message-ID: <87y3wn8tuf.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 03/02/17 02:00 AM, Stefan Monnier wrote: >> Objects have an `object-print' method which produces the # >> representation, but this appears to only sometimes be used in edebug, >> and never in backtraces. > > I've installed a cl-print.el package into Emacs's master branch which is > like EIEIO's object-print but more thorough. This is now used in > edebug, so it should hopefully fix the "only sometimes" part (and it > additionally knows about cl-defstructs as well, rather than only EIEIO > objects). Very cool! How does this interact with the existing `object-print' method? That method seems to be getting called at some point, but I don't see where. Is the intention that we'd stop using that? From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2017 18:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148847952317414 (code B ref 25295); Thu, 02 Mar 2017 18:33:02 +0000 Received: (at 25295) by debbugs.gnu.org; 2 Mar 2017 18:32:03 +0000 Received: from localhost ([127.0.0.1]:36873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjVWF-0004Wc-Hz for submit@debbugs.gnu.org; Thu, 02 Mar 2017 13:32:03 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:56625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjVWD-0004QA-8p for 25295@debbugs.gnu.org; Thu, 02 Mar 2017 13:32:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AsBAAKZLhY/zPujBheGwEBAQMBAQEJAQEBg1CEeYVWhQJzkHYpAZULgg2GHAQCAoJMQBgBAgEBAQEBAQFiKIRxAQQBViMFCws0EhQYDSSKBQi0OosVAQEBAQEFAgElizuKOQWQVItVlBWIXIZgkzcfOIEBIRQILIVDgWYiijMBAQE X-IPAS-Result: A0AsBAAKZLhY/zPujBheGwEBAQMBAQEJAQEBg1CEeYVWhQJzkHYpAZULgg2GHAQCAoJMQBgBAgEBAQEBAQFiKIRxAQQBViMFCws0EhQYDSSKBQi0OosVAQEBAQEFAgElizuKOQWQVItVlBWIXIZgkzcfOIEBIRQILIVDgWYiijMBAQE X-IronPort-AV: E=Sophos;i="5.35,232,1484024400"; d="scan'208";a="294294001" Received: from 24-140-238-51.cpe.teksavvy.com (HELO pastel.home) ([24.140.238.51]) by smtp.teksavvy.com with ESMTP; 02 Mar 2017 13:31:54 -0500 Received: by pastel.home (Postfix, from userid 20848) id 586EF64D9D; Thu, 2 Mar 2017 13:31:54 -0500 (EST) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <87y3wn8tuf.fsf@ericabrahamsen.net> Date: Thu, 02 Mar 2017 13:31:54 -0500 In-Reply-To: <87y3wn8tuf.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 02 Mar 2017 09:35:36 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Very cool! How does this interact with the existing `object-print' > method? The default cl-print-object method for EIEIO objects calls object-print. So you can add methods to either of object-print or cl-print-object (modulo issues with ordering between methods if one is applied to cl-print-object and the other to object-print). > That method seems to be getting called at some point, but I > don't see where. Is the intention that we'd stop using that? Yes, object-print is now obsolete. Stefan From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2017 05:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eric Abrahamsen , 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.148921092426670 (code B ref 25295); Sat, 11 Mar 2017 05:43:02 +0000 Received: (at 25295) by debbugs.gnu.org; 11 Mar 2017 05:42:04 +0000 Received: from localhost ([127.0.0.1]:50182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmZn2-0006w5-Gj for submit@debbugs.gnu.org; Sat, 11 Mar 2017 00:42:04 -0500 Received: from mail-io0-f170.google.com ([209.85.223.170]:36485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmZn1-0006vZ-5f for 25295@debbugs.gnu.org; Sat, 11 Mar 2017 00:42:03 -0500 Received: by mail-io0-f170.google.com with SMTP id l7so60228992ioe.3 for <25295@debbugs.gnu.org>; Fri, 10 Mar 2017 21:42:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vBZn6/B+nort2ewdRTpLgVoK9zuYsA8IxvYJldE4+54=; b=jiu3/RuDO5L9fp3RXiXzFhO16MVGJk9BP0seCH+PC+nceiMaayPA2fMDNDMP1tUct8 9SzE1UHTjP2Ji0D9wQC8PjEpMpcnf5nfudpFYHWpYqCNgJkgYS8lKa2GVkqW+zGla0OF 020TDoWEMFSnlpgAjwFTIqG7GA0hPOIzFSFuslkBkzEO4W9cqbFsM5lmMNMbHGHbfriL RkSiN1spxF74I9MfDxznkO38l3z4Cll3UbAwe5KqcXKBZ2alDVLw4FYgVJyr8YqAYKIc 21FcT4+7lC3D4CITyq/P6mi5WPeDVJzdtvjiuwkGf4H3WxYDrh6/ac1FmDsnjr6G6OE+ fETA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=vBZn6/B+nort2ewdRTpLgVoK9zuYsA8IxvYJldE4+54=; b=SHmVT5EoB/vZBkohJSK5x2kOv9m1vGzNxiQOxqljrJtk3DZOqKXUBsVE+hPJAmO4dP 0k+Kw54RPsA4IQYJushPdXL5uKQnqqECeJpmKdHSnkNtkiQngWiGP2FijQouuS8D7bNL njw6KvWBgS3CQTrvlpcb02mfKE6ha/xiNYE7Q/xFC+pGQv1nYEnqqd5A3hdTPaW63Gqq l7d/AdedsV2FNzZxCkw4bugpwlFjFar8QlKjoAmySJ1Nd5ZVsL88qsjXQzD3f2yGsxhd 4LN2d7doZcBTsv41CoB3++lADZwn/cIZGr/K5KDlfkON6n3MPEt3inFDq4Azcdh9RrJ+ PM+w== X-Gm-Message-State: AMke39lbJUFlV0jinwoOJamrLSoFVWGafVmlNL8wDXoGtuGS0TpsKcKrfKLF3F1fObqGaA== X-Received: by 10.107.46.163 with SMTP id u35mr21299479iou.196.1489210917645; Fri, 10 Mar 2017 21:41:57 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 62sm965430itl.1.2017.03.10.21.41.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Mar 2017 21:41:57 -0800 (PST) From: npostavs@users.sourceforge.net References: <87pokampa4.fsf@ericabrahamsen.net> <87innrc03h.fsf@users.sourceforge.net> Date: Sat, 11 Mar 2017 00:43:14 -0500 In-Reply-To: (Stefan Monnier's message of "Thu, 02 Mar 2017 08:38:18 -0500") Message-ID: <87k27w8j2l.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Stefan Monnier writes: >> I have an idea to use this for the pretty printer so it that produces >> the correct spacing while printing. I think this would end up faster >> than calling indent-sexp afterwards. But it would involve dispatching >> on STREAM, and according to the comments in cl-generic.el multiple >> dispatch adds more apply calls. Thoughts? > > No idea, how would that work? I posted an initial draft at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25122#21, I'm not seeing as much speedup as I'd hoped, though I haven't tried optimizing it yet. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2017 21:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.150862190630489 (code B ref 25295); Sat, 21 Oct 2017 21:39:02 +0000 Received: (at 25295) by debbugs.gnu.org; 21 Oct 2017 21:38:26 +0000 Received: from localhost ([127.0.0.1]:54690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e61TN-0007vf-Us for submit@debbugs.gnu.org; Sat, 21 Oct 2017 17:38:26 -0400 Received: from mail.ericabrahamsen.net ([50.56.99.223]:48976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e61TK-0007vW-Fx for 25295@debbugs.gnu.org; Sat, 21 Oct 2017 17:38:22 -0400 Received: from localhost (71-212-71-66.tukw.qwest.net [71.212.71.66]) (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 6F406C06E0; Sat, 21 Oct 2017 21:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1508621901; bh=/hkLeDeIphJysTNsqOJ7h13dB2t5HMd/HhqLXExBLqg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=BsGWCP7/PDvuVP5vr//xml7AmyVec7fGRuV6Pv7aEVbIQ6xEnzz3G2FIxdBBSKUcK aqRT/QA04KYKNEpakfQgqhNiRlk9lceTPUDW1BXYjB+8YhhA2cGsG768OW5mDOfDOV Wv0WXcPu3Y/rByi0sf/12CxzUTxq829lhJ0K0qXQ= From: Eric Abrahamsen References: <87pokampa4.fsf@ericabrahamsen.net> Date: Sat, 21 Oct 2017 14:36:46 -0700 In-Reply-To: (Stefan Monnier's message of "Thu, 02 Mar 2017 02:00:53 -0500") Message-ID: <87efpww5ch.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 03/02/17 02:00 AM, Stefan Monnier wrote: >> Objects have an `object-print' method which produces the # >> representation, but this appears to only sometimes be used in edebug, >> and never in backtraces. > > I've installed a cl-print.el package into Emacs's master branch which is > like EIEIO's object-print but more thorough. This is now used in > edebug, so it should hopefully fix the "only sometimes" part (and it > additionally knows about cl-defstructs as well, rather than only EIEIO > objects). > > Using it in backtraces should be a simple matter of applying the patch > below. I haven't installed it because I'm afraid of the potential > breakage and slowdown of using cl-prin1, so I'd rather wait and see how > it fares in Edebug first. My experiments seem to indicate that it might > be "good enough" but it might also suffer from the overhead of > cl-generic (mostly the fact that a call to a generic-function ends up > going through some &rest+apply which in cl-print's case end up > generating a lot of garbage: in one of my tests, the cl-print code was > twice slower than the C code but the added time was almost entirely > spent in the GC and that seemed to come exclusively from the lists > allocated for &rest. I.e. if we could change cl-generic so it doesn't > use &rest+apply as much there's a chance it could potentially be about > as fast as the C code). > > > Stefan > > > diff --git a/lisp/subr.el b/lisp/subr.el > index ea159e733c..68bfceb8d2 100644 > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -4660,10 +4660,10 @@ backtrace--print-frame > (princ (if (plist-get flags :debug-on-exit) "* " " ")) > (cond > ((and evald (not debugger-stack-frame-as-list)) > - (prin1 func) > - (if args (prin1 args) (princ "()"))) > + (cl-prin1 func) > + (if args (cl-prin1 args) (princ "()"))) > (t > - (prin1 (cons func args)))) > + (cl-prin1 (cons func args)))) > (princ "\n")) > > (defun backtrace () How about we just apply this and see what happens? Developing with EIEIO is pretty painful -- oftentimes the *Messages* buffer is such a mess you can't even tell if there's been an error or not. I've been running the above patch, as well as an equivalent change in `eval-expression', and nothing bad has happened. Perhaps there's a slowdown, but from my own selfish point of view any slowdown is far, far preferable to the several seconds you need to wait for a class object to be spat out into *Messages*. BTW, this works in edebug but only at the top level: if a nested structure is printed, interior objects are still represented as the full struct. From unknown Fri Jun 13 10:46:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2017 03:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 25295@debbugs.gnu.org Received: via spool by 25295-submit@debbugs.gnu.org id=B25295.150864247219146 (code B ref 25295); Sun, 22 Oct 2017 03:22:02 +0000 Received: (at 25295) by debbugs.gnu.org; 22 Oct 2017 03:21:12 +0000 Received: from localhost ([127.0.0.1]:54834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e66p5-0004yk-RX for submit@debbugs.gnu.org; Sat, 21 Oct 2017 23:21:12 -0400 Received: from pmta21.teksavvy.com ([76.10.157.36]:33832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e66p3-0004yU-Dc for 25295@debbugs.gnu.org; Sat, 21 Oct 2017 23:21:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2EqZAD3DexZ/4AFNJ1cHAEBBAEBCgEBg15EgQ6JLoUUco5KAYF5MQGWCIIQhT8EAgKEO0sNAQIBAQEBAQEBA2gohR4BBAFWIwULCzQSFBgNJIorCK0cixUBAQEBAQUCJoMuiGqKegEEoWaWcAGJXodGlzVNC4FbNCEIMoMugxCBaiSLGQEBAQ X-IPAS-Result: A2EqZAD3DexZ/4AFNJ1cHAEBBAEBCgEBg15EgQ6JLoUUco5KAYF5MQGWCIIQhT8EAgKEO0sNAQIBAQEBAQEBA2gohR4BBAFWIwULCzQSFBgNJIorCK0cixUBAQEBAQUCJoMuiGqKegEEoWaWcAGJXodGlzVNC4FbNCEIMoMugxCBaiSLGQEBAQ X-IronPort-AV: E=Sophos;i="5.43,414,1503374400"; d="scan'208";a="6954530" Received: from 157-52-5-128.cpe.teksavvy.com (HELO pastel.home) ([157.52.5.128]) by smtp.teksavvy.com with ESMTP; 21 Oct 2017 23:21:03 -0400 Received: by pastel.home (Postfix, from userid 20848) id 506F9606AA; Sat, 21 Oct 2017 23:21:03 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <87efpww5ch.fsf@ericabrahamsen.net> Date: Sat, 21 Oct 2017 23:21:03 -0400 In-Reply-To: <87efpww5ch.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 21 Oct 2017 14:36:46 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > How about we just apply this and see what happens? AFAIK, that's exactly what's been done in Emacs-26 already. Stefan From unknown Fri Jun 13 10:46:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eric Abrahamsen Subject: bug#25295: closed (Re: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug) Message-ID: References: <8736t3yt7d.fsf@ericabrahamsen.net> <87pokampa4.fsf@ericabrahamsen.net> X-Gnu-PR-Message: they-closed 25295 X-Gnu-PR-Package: emacs Reply-To: 25295@debbugs.gnu.org Date: Thu, 18 Oct 2018 19:03:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1539889382-15004-1" This is a multi-part message in MIME format... ------------=_1539889382-15004-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25295: 26.0.50; Represent eieio objects using object-print in backtraces a= nd edebug which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25295@debbugs.gnu.org. --=20 25295: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25295 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1539889382-15004-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25295-done) by debbugs.gnu.org; 18 Oct 2018 19:02:02 +0000 Received: from localhost ([127.0.0.1]:57399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDDYY-0003LE-Dm for submit@debbugs.gnu.org; Thu, 18 Oct 2018 15:02:02 -0400 Received: from mail.ericabrahamsen.net ([50.56.99.223]:47015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDDYW-0003JX-Am for 25295-done@debbugs.gnu.org; Thu, 18 Oct 2018 15:02:00 -0400 Received: from localhost (unknown [207.109.85.82]) (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 9EE773F4E4 for <25295-done@debbugs.gnu.org>; Thu, 18 Oct 2018 19:01:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1539889319; bh=iHL+D08IpyJ96AtTLm/Xr0N8A5mHZgiszSaJI01DvG8=; h=From:To:Subject:References:Date:In-Reply-To:From; b=CO1KBDxjxZPweDFKzNOJS0n78DxtaHKeBTgo6/KzSJ4FISy6h0mY8vsH9f6fxTYYh NxYf097utv2kwGcIvKrqSASCQG3Gs0ktTRqY5ilXTothapn+vOXMu+7F7eXZax2/j6 lwl5M7GgCDxsYoVf7g2uxKW4CAirIusv5TnIvmng= From: Eric Abrahamsen To: 25295-done@debbugs.gnu.org Subject: Re: bug#25295: 26.0.50; Represent eieio objects using object-print in backtraces and edebug References: <87pokampa4.fsf@ericabrahamsen.net> <87efpww5ch.fsf@ericabrahamsen.net> Date: Thu, 18 Oct 2018 12:01:58 -0700 In-Reply-To: (Stefan Monnier's message of "Sat, 21 Oct 2017 23:21:03 -0400") Message-ID: <8736t3yt7d.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 25295-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is either done, or thoroughly out of date. On 10/21/17 23:21 PM, Stefan Monnier wrote: >> How about we just apply this and see what happens? > > AFAIK, that's exactly what's been done in Emacs-26 already. > > > Stefan ------------=_1539889382-15004-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Dec 2016 20:52:40 +0000 Received: from localhost ([127.0.0.1]:59420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMhgm-0006EE-1r for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMhgk-0006Dz-On for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMhge-0000iA-3C for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:33 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMhgd-0000i2-Vk for submit@debbugs.gnu.org; Thu, 29 Dec 2016 15:52:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMhgc-0001k7-Oz for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 15:52:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMhgX-0000dP-Tr for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 15:52:30 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:34408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMhgX-0000ch-Nz for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 15:52:25 -0500 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 3A9B7BC903 for ; Thu, 29 Dec 2016 20:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483044744; bh=kof4kKejEfEyu4q1Uw/QFq58sEN85aOsMUgo5FpFx+M=; h=From:To:Subject:Date:From; b=EYW/j4V6D840DHodMeGZIiXfJREyFkXM2Mc0V6oZGh9zivXPloSPdclUaXbZuyf8k jEOWgZ/gxcHQv4lAnxEB4e9AOSsFPChbgr0oWHZ4dIkikrnw5KheMeQN4RXDk8XcJa rxMd8uGL5E7n4RCnYOPchVxWGElIuD6e/52y+HQQ= From: Eric Abrahamsen To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Represent eieio objects using object-print in backtraces and edebug Date: Thu, 29 Dec 2016 12:52:19 -0800 Message-ID: <87pokampa4.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) EIEIO class instances can either be represented using the read-only # style, or as vectors, dumping all the slot information. For large or recursive objects, this can take some time, and can also make for very large strings. In backtraces and edebug, in particular, this can make it very difficult to see what's happening. Objects have an `object-print' method which produces the # representation, but this appears to only sometimes be used in edebug, and never in backtraces. It would be great if object-print could always be used, or if there were an option to toggle this. In GNU Emacs 26.0.50.9 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.5) of 2016-12-26 built on clem Repository revision: 65b997b95e284e2edc1266663e39791f68d76ad7 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Recent messages: [6 times] mwheel-scroll: Beginning of buffer [5 times] Mark saved where search started Checking new news... Reading active file from Test via nngnorb...done Reading active file from archive via nnfolder...done Reading active file via nndraft...done Reading active file from MTester via nnmairix...done Checking new news...done Processing kill file /home/eric/.emacs.d/News/gmane.emacs.devel.KILL...done ------------=_1539889382-15004-1--