emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/cl-generic 9df20d2 2/5: * packages/cl-generic/cl-generi


From: Stefan Monnier
Subject: [elpa] externals/cl-generic 9df20d2 2/5: * packages/cl-generic/cl-generic.el (cl-defmethod): Fix handling of subclass.
Date: Tue, 1 Dec 2020 15:25:37 -0500 (EST)

branch: externals/cl-generic
commit 9df20d23ca49dc2e7137bf36be0505fccbc6e4bb
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * packages/cl-generic/cl-generic.el (cl-defmethod): Fix handling of 
subclass.
---
 cl-generic.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/cl-generic.el b/cl-generic.el
index 060cffc..df09449 100644
--- a/cl-generic.el
+++ b/cl-generic.el
@@ -89,14 +89,15 @@
       (while (not (listp args))
         (push args qualifiers)
         (setq args (pop body)))
-      (when (eq (car-safe (car args)) 'subclass)
-        ;; There's no exact equivalent to `subclass', but :static
-        ;; provides a superset which should work just as well in practice.
-        (push :static qualifiers)
-        (setcar args (cadr (car args))))
+      (let ((arg1 (car args)))
+        (when (eq (car-safe (car (cdr-safe arg1))) 'subclass)
+          ;; There's no exact equivalent to `subclass', but :static
+          ;; provides a superset which should work just as well in practice.
+          (push :static qualifiers)
+          (setf (cadr arg1) (cadr (cadr arg1)))))
       (let ((docstring (if (and (stringp (car body)) (cdr body)) (pop body))))
         `(defmethod ,name ,@qualifiers ,args
-           ,docstring
+           ,@(if docstring (list docstring))
            ;; We could just alias `cl-call-next-method' to `call-next-method',
            ;; and that would work, but then files compiled with this cl-generic
            ;; wouldn't work in Emacs-25 any more.



reply via email to

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