]> git.eshelyaron.com Git - emacs.git/commitdiff
Make Edebug specification for 'cl-defstruct' more lenient.
authorPhilipp Stephani <phst@google.com>
Mon, 14 Mar 2022 09:59:03 +0000 (10:59 +0100)
committerPhilipp Stephani <phst@google.com>
Mon, 14 Mar 2022 09:59:03 +0000 (10:59 +0100)
For example, 'xref-item' uses the list form of ':noinline'.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Accept ':noinline' and
':named' with an argument.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/edebug): New
unit test.

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

index 4b231d814962cc2a2940a422fe34fcdfc20df382..9fd3350ddd77d345bf2abb07dabbb3d145ac19f9 100644 (file)
@@ -2911,7 +2911,8 @@ To see the documentation for a defined struct type, use
                              [":include" symbolp &rest sexp] ;; Not finished.
                              [":print-function" sexp]
                              [":type" symbolp]
-                             [":named"]
+                             [":noinline" &optional sexp]
+                             [":named" &optional sexp]
                              [":initial-offset" natnump])])]
              [&optional stringp]
              ;; All the above is for the following def-form.
index 036ee30966be58a72463cc0c2acf44035ade60c7..19ede627a13008d41c20465ab6d73b33ab43e2cb 100644 (file)
@@ -709,4 +709,22 @@ collection clause."
       ;; Just make sure the forms can be instrumented.
       (eval-buffer))))
 
+(ert-deftest cl-defstruct/edebug ()
+  "Check that we can instrument `cl-defstruct' forms."
+  (with-temp-buffer
+    (dolist (form '((cl-defstruct cl-defstruct/edebug/1)
+                    (cl-defstruct (cl-defstruct/edebug/2
+                                   :noinline))
+                    (cl-defstruct (cl-defstruct/edebug/3
+                                   (:noinline t)))
+                    (cl-defstruct (cl-defstruct/edebug/4
+                                   :named))
+                    (cl-defstruct (cl-defstruct/edebug/5
+                                   (:named t)))))
+      (print form (current-buffer)))
+    (let ((edebug-all-defs t)
+          (edebug-initial-mode 'Go-nonstop))
+      ;; Just make sure the forms can be instrumented.
+      (eval-buffer))))
+
 ;;; cl-macs-tests.el ends here