emacs-diffs
[Top][All Lists]
Advanced

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

master f3df7916b2: Make Edebug specification for 'cl-defstruct' more len


From: Philipp Stephani
Subject: master f3df7916b2: Make Edebug specification for 'cl-defstruct' more lenient.
Date: Mon, 14 Mar 2022 06:01:28 -0400 (EDT)

branch: master
commit f3df7916b2b342380930082cf35bad6cb488a4dc
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Make Edebug specification for 'cl-defstruct' more lenient.
    
    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            |  3 ++-
 test/lisp/emacs-lisp/cl-macs-tests.el | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 4b231d8149..9fd3350ddd 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -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.
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el 
b/test/lisp/emacs-lisp/cl-macs-tests.el
index 036ee30966..19ede627a1 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -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



reply via email to

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