From 59e7fe6d0c6988687b53c279941c9ebb3f887eed Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 21 Jan 2015 14:39:06 -0500 Subject: * lisp/emacs-lisp/eieio*.el: Fix up warnings and improve compatibility Fixes: debbugs:19645 * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add support for `declare'. (cl--generic-setf-rewrite): Setup the setf expander right away. (cl-defmethod): Make sure the setf expander is setup before we expand the body. (cl-defmethod): Silence byte-compiler warnings. (cl-generic-define-method): Shuffle code to change return value. (cl--generic-method-info): New function, extracted from cl--generic-describe. (cl--generic-describe): Use it. * lisp/emacs-lisp/eieio-speedbar.el: * lisp/emacs-lisp/eieio-datadebug.el: * lisp/emacs-lisp/eieio-custom.el: * lisp/emacs-lisp/eieio-base.el: Use cl-defmethod. * lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Avoid no-next-method errors when there's a `before' but no `primary'. (next-method-p): Return nil rather than signal an error. (eieio-defgeneric): Remove bogus (fboundp 'method). * lisp/emacs-lisp/eieio-opt.el: Adapt to cl-generic. (eieio--specializers-apply-to-class-p): New function. (eieio-all-generic-functions): Use it. (eieio-method-documentation): Use it as well as cl--generic-method-info. Change format of return value. (eieio-help-class): Adapt accordingly. * lisp/emacs-lisp/eieio.el: Use cl-defmethod. (defclass): Generate cl-defmethod calls; use setf methods for :accessor. (eieio-object-name-string): Declare as obsolete. * test/automated/cl-generic-tests.el (setf cl--generic-2): Make sure the setf can be used already in the body of the method. --- test/automated/eieio-test-methodinvoke.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/automated/eieio-test-methodinvoke.el') diff --git a/test/automated/eieio-test-methodinvoke.el b/test/automated/eieio-test-methodinvoke.el index 3918fb904fe..da5f59a4654 100644 --- a/test/automated/eieio-test-methodinvoke.el +++ b/test/automated/eieio-test-methodinvoke.el @@ -292,6 +292,7 @@ (defmethod initialize-instance :after ((this eitest-Ja) &rest slots) ;(message "+Ja") + ;; FIXME: Using next-method-p in an after-method is invalid! (when (next-method-p) (call-next-method)) ;(message "-Ja") @@ -302,6 +303,7 @@ (defmethod initialize-instance :after ((this eitest-Jb) &rest slots) ;(message "+Jb") + ;; FIXME: Using next-method-p in an after-method is invalid! (when (next-method-p) (call-next-method)) ;(message "-Jb") -- cgit v1.2.1