diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-02-12 22:53:38 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-02-12 22:53:38 -0500 |
commit | ca0842347e5437bcaeeded4a7fd55e0e48ed4bad (patch) | |
tree | 7d9719864ae41a9a6f31e53ac4dfd8fa2a7e1416 /lisp/emacs-lisp/edebug.el | |
parent | 626911b704b3f144e9b8dbd187c394ed90e8411c (diff) | |
download | emacs-ca0842347e5437bcaeeded4a7fd55e0e48ed4bad.tar.gz emacs-ca0842347e5437bcaeeded4a7fd55e0e48ed4bad.tar.bz2 emacs-ca0842347e5437bcaeeded4a7fd55e0e48ed4bad.zip |
Edebug: Make it possible to debug `gv-expander`s in `declare`
Arrange for declarations to be able to specify their own specs via
the `edebug-declaration-spec` property.
* lisp/emacs-lisp/edebug.el: (edebug--get-declare-spec): New function.
(def-declarations): New spec element.
(defun, defmacro): Use it in their spec.
* lisp/emacs-lisp/gv.el (gv-expander, gv-setter):
Set `edebug-declaration-spec`.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-gv-expander): New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-use-gv-expander): New test case.
Diffstat (limited to 'lisp/emacs-lisp/edebug.el')
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 47b45614e71..394f47090ca 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2207,14 +2207,12 @@ into `edebug--cl-macrolet-defs' which is checked in `edebug-list-form-args'." ;; `defun' and `defmacro' are not special forms (any more), but it's ;; more convenient to define their Edebug spec here. (defun ( &define name lambda-list lambda-doc - [&optional ("declare" &rest sexp)] + [&optional ("declare" def-declarations)] [&optional ("interactive" &optional &or stringp def-form)] def-body)) - ;; FIXME: Improve `declare' so we can Edebug gv-expander and - ;; gv-setter declarations. (defmacro ( &define name lambda-list lambda-doc - [&optional ("declare" &rest sexp)] + [&optional ("declare" def-declarations)] def-body)) ;; function expects a symbol or a lambda or macro expression @@ -2243,6 +2241,12 @@ into `edebug--cl-macrolet-defs' which is checked in `edebug-list-form-args'." )) (put name 'edebug-form-spec spec)) +(defun edebug--get-declare-spec (head) + (get head 'edebug-declaration-spec)) + +(def-edebug-elem-spec 'def-declarations + '(&rest &or (&lookup symbolp edebug--get-declare-spec) sexp)) + (def-edebug-elem-spec 'lambda-list '(([&rest arg] [&optional ["&optional" arg &rest arg]] |