diff options
| author | Philipp Stephani | 2022-03-14 10:59:03 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2022-03-14 10:59:03 +0100 |
| commit | f3df7916b2b342380930082cf35bad6cb488a4dc (patch) | |
| tree | 812ec9d256f8e94cf4f8ee425ab5e8f863aa4ab6 | |
| parent | 637dde4aba921435f78d0de769ad74c4f3230aa6 (diff) | |
| download | emacs-f3df7916b2b342380930082cf35bad6cb488a4dc.tar.gz emacs-f3df7916b2b342380930082cf35bad6cb488a4dc.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 3 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-macs-tests.el | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 4b231d81496..9fd3350ddd7 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 | |||
| 2911 | [":include" symbolp &rest sexp] ;; Not finished. | 2911 | [":include" symbolp &rest sexp] ;; Not finished. |
| 2912 | [":print-function" sexp] | 2912 | [":print-function" sexp] |
| 2913 | [":type" symbolp] | 2913 | [":type" symbolp] |
| 2914 | [":named"] | 2914 | [":noinline" &optional sexp] |
| 2915 | [":named" &optional sexp] | ||
| 2915 | [":initial-offset" natnump])])] | 2916 | [":initial-offset" natnump])])] |
| 2916 | [&optional stringp] | 2917 | [&optional stringp] |
| 2917 | ;; All the above is for the following def-form. | 2918 | ;; 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 036ee30966b..19ede627a13 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." | |||
| 709 | ;; Just make sure the forms can be instrumented. | 709 | ;; Just make sure the forms can be instrumented. |
| 710 | (eval-buffer)))) | 710 | (eval-buffer)))) |
| 711 | 711 | ||
| 712 | (ert-deftest cl-defstruct/edebug () | ||
| 713 | "Check that we can instrument `cl-defstruct' forms." | ||
| 714 | (with-temp-buffer | ||
| 715 | (dolist (form '((cl-defstruct cl-defstruct/edebug/1) | ||
| 716 | (cl-defstruct (cl-defstruct/edebug/2 | ||
| 717 | :noinline)) | ||
| 718 | (cl-defstruct (cl-defstruct/edebug/3 | ||
| 719 | (:noinline t))) | ||
| 720 | (cl-defstruct (cl-defstruct/edebug/4 | ||
| 721 | :named)) | ||
| 722 | (cl-defstruct (cl-defstruct/edebug/5 | ||
| 723 | (:named t))))) | ||
| 724 | (print form (current-buffer))) | ||
| 725 | (let ((edebug-all-defs t) | ||
| 726 | (edebug-initial-mode 'Go-nonstop)) | ||
| 727 | ;; Just make sure the forms can be instrumented. | ||
| 728 | (eval-buffer)))) | ||
| 729 | |||
| 712 | ;;; cl-macs-tests.el ends here | 730 | ;;; cl-macs-tests.el ends here |