emacs-devel
[Top][All Lists]
Advanced

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

Re: Towards a cleaner build: eieio


From: Lars Ingebrigtsen
Subject: Re: Towards a cleaner build: eieio
Date: Mon, 17 Jun 2019 11:40:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> No, we probably don't care much in this particular instance, but it was
>> a really simple one to use as a test case.
>
> LGTM,

I've now rewritten the object-prints to be cl-print-objects (and had to
introduce a new method to get the output to be identical (probably not
very important, but...)), so I thought I was going to go ahead and
suppress this fallback method in eieio.el:

In toplevel form:
emacs-lisp/eieio.el:857:11:Warning: `object-print' is an obsolete function (as
    of 26.1); use `cl-print-object' instead.

But!  Somehow with-suppressed-warnings doesn't work in methods?

(cl-defmethod cl-print-object ((object eieio-default-superclass) stream)
  "Default printer for EIEIO objects."
  ;; Fallback to the old `object-print'.
  (princ (object-print object) stream))

I can work around this trivially, but it would be nice if that macro
worked here, too.  Are cl-defmethods compiled in such a way that the
bytecomp macrology magic is...  done in a different order so that that
doesn't work?

Hm...  with-no-warnings works...  *scratches head*

Oh!  This patch was needed to get that macro working here, and Emacs had
to be rebuilt for it to happen:

diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 9013c1f060..10190f4933 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -450,7 +450,7 @@ cl-defmethod
       `(progn
          ,(and (get name 'byte-obsolete-info)
                (or (not (fboundp 'byte-compile-warning-enabled-p))
-                   (byte-compile-warning-enabled-p 'obsolete))
+                   (byte-compile-warning-enabled-p 'obsolete name))
                (let* ((obsolete (get name 'byte-obsolete-info)))
                  (macroexp--warn-and-return
                   (macroexp--obsolete-warning name obsolete "generic function")


Now done.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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