From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Towards a cleaner build: eieio Date: Sun, 16 Jun 2019 18:41:29 +0200 Message-ID: References: <83a7eo9nsh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="57270"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 16 18:48:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcYKP-000EoL-N1 for ged-emacs-devel@m.gmane.org; Sun, 16 Jun 2019 18:48:25 +0200 Original-Received: from localhost ([::1]:41550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcYKO-0003rF-NR for ged-emacs-devel@m.gmane.org; Sun, 16 Jun 2019 12:48:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36896) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcYJR-0002yo-N8 for emacs-devel@gnu.org; Sun, 16 Jun 2019 12:47:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcYDr-00069E-PC for emacs-devel@gnu.org; Sun, 16 Jun 2019 12:41:40 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:52328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcYDr-00067c-Iv for emacs-devel@gnu.org; Sun, 16 Jun 2019 12:41:39 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcYDi-0004Od-0P; Sun, 16 Jun 2019 18:41:33 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEXz7MrFp4/q1ramXFUj HSMCAQI9K2BQJUtHNV/SwKh+QkL////+//79/PM2L2ise2eM+jl0AAAB+klEQVQ4jcXST2jTUBwH 8OBO4np4KmgRzJKLDN3pFSK5DOVn1Et6WWE30YYwPXSMZRTFy6BCC8JsL/rAIVJxl0HnTsLL0Hsm lHgaWxliCWRgtGTowD/xVev6MtOb4O/weD8+fHn8fjyBDijhn4Ldu7Zarc3ExC7A1yRYswbANgyA YwPAxgBGIqgMTnGAEEHdWlRBa5/lYK5UnrTmrMv3Gdzi4V6pdA3AgmUxijrD1HH+ACGPFu4UreK3 sFyuyGKkLuw//nLSYom7Kugz0qVcbmIfXk0USwDLKnhPz+R4WCG1VUIeq9DunODBFjYEWRgZZoCU WKL5OtVspbYUfUdcikFvckXPJ0NGz4pfkuBZMINEtrArHLhylTxA5KhwWBaktEQIWfwNQzjjvYMg i6SoEcJuEAQfePAYIBTC5z68ZeDrXqMjRShc+tGHVZxp+3pQj6qRGJ4/3QcbZcwLhWAWi/UoBrQK Bd8szGI0HmEe1pQg8LVCvo5CHIPtLkDwHnehzIE7ykYipHZIkGW55rLjXG8OxdT8efPjGxdj3OBW MqTuWP5FbWrTdsPxMR5w/uHN68+NikNtZz0GN174U8c9+MT9q1+QrqxcNU5q5t531jl9WKcd+7Yx nWo2x+IJSvdo2jSmj1B6EJ7QDQ0g+zewRY6Ska0kOFj/FX4CJhHSYm8wf+0AAAAASUVORK5CYII= In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 16 Jun 2019 14:36:14 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237737 Archived-At: Lars Ingebrigtsen writes: > OK; I'll take a look at rewriting one of them to see how much work it > is... OK, here's my test case: (require 'semantic/db-el) (setq obj (semanticdb-table-emacs-lisp :major-mode "foo")) (object-print obj) => "#" (cl-print-object obj (current-buffer)) # So that's the way it is with an object-print method on the object. If I apply the following patch, I then get identical output: (cl-print-object obj (current-buffer)) # That's a kind of odd object-print, though, because it contains so little information. But I've followed the call-next-method chain up, and there's nothing added, so I think this change is correct? (Because the optional STRINGS is always nil; i.e., there are no actual direct calls to object-print.) If this looks reasonable to you, I can do the transforms for the other five instances of object-print in cedet. diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el index 5375623c13..b30553d95b 100644 --- a/lisp/cedet/semantic/db-el.el +++ b/lisp/cedet/semantic/db-el.el @@ -53,10 +53,9 @@ semanticdb-needs-refresh-p "Return nil, we never need a refresh." nil) -(cl-defmethod object-print ((obj semanticdb-table-emacs-lisp) &rest strings) - "Pretty printer extension for `semanticdb-table-emacs-lisp'. -Adds the number of tags in this file to the object print name." - (apply #'cl-call-next-method obj (cons " (proxy)" strings))) +(cl-defmethod cl-print-object ((obj semanticdb-table-emacs-lisp) stream) + "Pretty printer extension for `semanticdb-table-emacs-lisp'." + (princ (eieio-object-name obj " (proxy)") stream)) (defclass semanticdb-project-database-emacs-lisp (semanticdb-project-database eieio-singleton) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no