]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve Edebug symbols for inlined secondary methods (Bug#42671)
authorPhilipp Stephani <phst@google.com>
Sun, 2 Aug 2020 20:07:27 +0000 (22:07 +0200)
committerPhilipp Stephani <phst@google.com>
Sun, 2 Aug 2020 20:07:27 +0000 (22:07 +0200)
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Include qualifiers in
Edebug symbol name.

* test/lisp/emacs-lisp/cl-generic-tests.el
(cl-defgeneric/edebug/method): Adapt unit test.

lisp/emacs-lisp/cl-generic.el
test/lisp/emacs-lisp/cl-generic-tests.el

index 640eb6b06d4a9660e9a3fa4cf5b2abbce6c5c50d..02da07daaf40fbd0f788d1c5ceefa8aca86e9a2b 100644 (file)
@@ -220,7 +220,7 @@ DEFAULT-BODY, if present, is used as the body of a default method.
                                       ;; requires larger changes to
                                       ;; Edebug.
                                       :unique "cl-generic-:method@"
-                                      [&rest atom]
+                                      [&rest cl-generic-method-qualifier]
                                       cl-generic-method-args lambda-doc
                                       def-body)]]
                      def-body)))
index fc39e349523a3cd99964ba83b13880b2c6ec191f..5aa58782f369e328cee220869a8b2629e4e4f5f2 100644 (file)
@@ -256,7 +256,8 @@ Edebug symbols (Bug#42672)."
   (with-temp-buffer
     (dolist (form '((cl-defgeneric cl-defgeneric/edebug/method/1 (_)
                       (:method ((_ number)) 1)
-                      (:method ((_ string)) 2))
+                      (:method ((_ string)) 2)
+                      (:method :around ((_ number)) 3))
                     (cl-defgeneric cl-defgeneric/edebug/method/2 (_)
                       (:method ((_ number)) 3))))
       (print form (current-buffer)))
@@ -272,18 +273,19 @@ Edebug symbols (Bug#42672)."
            ;; Make generated symbols reproducible.
            (gensym-counter 10000))
       (eval-buffer)
-      (should (equal (reverse instrumented-names)
-                     ;; The generic function definitions come after
-                     ;; the method definitions because their body ends
-                     ;; later.
-                     ;; FIXME: We'd rather have names such as
-                     ;; `cl-defgeneric/edebug/method/1 ((_ number))',
-                     ;; but that requires further changes to Edebug.
-                     (list (intern "cl-generic-:method@10000 ((_ number))")
-                           (intern "cl-generic-:method@10001 ((_ string))")
-                           'cl-defgeneric/edebug/method/1
-                           (intern "cl-generic-:method@10002 ((_ number))")
-                           'cl-defgeneric/edebug/method/2))))))
+      (should (equal
+               (reverse instrumented-names)
+               ;; The generic function definitions come after the
+               ;; method definitions because their body ends later.
+               ;; FIXME: We'd rather have names such as
+               ;; `cl-defgeneric/edebug/method/1 ((_ number))', but
+               ;; that requires further changes to Edebug.
+               (list (intern "cl-generic-:method@10000 ((_ number))")
+                     (intern "cl-generic-:method@10001 ((_ string))")
+                     (intern "cl-generic-:method@10002 :around ((_ number))")
+                     'cl-defgeneric/edebug/method/1
+                     (intern "cl-generic-:method@10003 ((_ number))")
+                     'cl-defgeneric/edebug/method/2))))))
 
 (provide 'cl-generic-tests)
 ;;; cl-generic-tests.el ends here