emacs/test/lisp/emacs-lisp
Stefan Monnier b939f7ad35 * Edebug: Generalize &lookup, use it for cl-macrolet and cl-generic
This allows the use of (declare (debug ...)) in the lexical macros
defined with `cl-macrolet`.  It also fixes the names used by Edebug
for the methods of `cl-generic` so it doesn't need to use gensym
and so they don't include the formal arg names any more.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op):
Rename from `edebug--handle-&-spec-op`.
(edebug--match-&-spec-op <&interpose>): Rename from `&lookup` and
generalize so it can let-bind dynamic variables around the rest of the parse.
(edebug-lexical-macro-ctx): Rename from `edebug--cl-macrolet-defs` and
make it into an alist.
(edebug-list-form-args): Use the specs from `edebug-lexical-macro-ctx`
when available.
(edebug--current-cl-macrolet-defs): Delete var.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): Delete functions.
(def-declarations): Use new `&interpose`.
(edebug--match-declare-arg): Rename from `edebug--get-declare-spec` and
adjust to new calling convention.

* lisp/subr.el (def-edebug-elem-spec): Fix docstring.
(eval-after-load): Use `declare`.

* lisp/emacs-lisp/cl-generic.el: Fix Edebug names so we don't need
gensym any more and we only include the specializers but not the formal
arg names.
(cl--generic-edebug-name): New var.
(cl--generic-edebug-remember-name, cl--generic-edebug-make-name): New funs.
(cl-defgeneric, cl-defmethod): Use them.

* lisp/emacs-lisp/cl-macs.el: Add support for `debug` declarations in
`cl-macrolet`.
(cl-declarations-or-string):
Fix use of `lambda-doc` and allow use of `declare`.
(edebug-lexical-macro-ctx): Declare var.
(cl--edebug-macrolet-interposer): New function.
(cl-macrolet): Use it to pass the right `lexical-macro-ctx` to the body.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Use new `&interpose`.
(pcase--edebug-match-pat-args): Rename from `pcase--get-edebug-spec` and
adjust to new calling convention.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method):
Adjust to the new names.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier)
(edebug-tests-cl-flet): Adjust to the new names.

* doc/lispref/edebug.texi (Specification List): Document &interpose.
2021-02-14 21:34:09 -05:00
..
bytecomp-resources Fix spurious "Lexical argument shadows the dynamic variable" due to inlining 2021-01-21 13:15:05 -05:00
edebug-resources * Edebug: Generalize &lookup, use it for cl-macrolet and cl-generic 2021-02-14 21:34:09 -05:00
eieio-tests Update copyright year to 2021 2021-01-01 01:13:56 -08:00
faceup-resources Update copyright year to 2021 2021-01-01 01:13:56 -08:00
faceup-tests Update copyright year to 2021 2021-01-01 01:13:56 -08:00
package-resources Update copyright year to 2021 2021-01-01 01:13:56 -08:00
shadow-resources Use lexical-binding in most remaining emacs-lisp tests 2020-04-30 12:09:51 +02:00
testcover-resources ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
backquote-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
backtrace-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
benchmark-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
bindat-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
bytecomp-tests.el Fix local defvar scoping error (bug#46387) 2021-02-10 14:47:40 +01:00
cconv-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
check-declare-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
checkdoc-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
cl-extra-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
cl-generic-tests.el * Edebug: Generalize &lookup, use it for cl-macrolet and cl-generic 2021-02-14 21:34:09 -05:00
cl-lib-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
cl-macs-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
cl-preloaded-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
cl-print-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
cl-seq-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
copyright-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
derived-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
easy-mmode-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
edebug-tests.el * Edebug: Generalize &lookup, use it for cl-macrolet and cl-generic 2021-02-14 21:34:09 -05:00
ert-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
ert-x-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
find-func-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
float-sup-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
generator-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
gv-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
hierarchy-tests.el Use lexical-binding in more tests 2020-08-29 22:41:51 +02:00
let-alist-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
lisp-mode-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
lisp-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
macroexp-tests.el * lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Break cycles 2021-02-10 16:06:24 -05:00
map-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
memory-report-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
nadvice-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
package-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
pcase-tests.el * lisp/emacs-lisp/pcase.el: Add support for not to pred 2021-01-16 14:21:57 -05:00
pp-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
regexp-opt-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
ring-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
rmc-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
rx-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
seq-tests.el Fix recently uncovered 'make check' failures 2021-01-23 23:38:19 +00:00
shadow-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
subr-x-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
syntax-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
tabulated-list-test.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
testcover-tests.el ; Minor license statement fixes 2021-02-08 09:10:57 +01:00
text-property-search-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
thunk-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
timer-tests.el Prefer skip-unless in more tests 2021-01-13 17:39:53 +01:00
unsafep-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
warnings-tests.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00