diff options
| author | Philipp Stephani | 2020-06-10 15:34:41 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2020-06-10 15:34:41 +0200 |
| commit | 73be4d1ed5b190bd93e9bad6aebe43d0dea0d7d3 (patch) | |
| tree | b9630e055af5343ae28f7eaa6e0d38a17a1b073f | |
| parent | 9e04d0f289cc74fe2453910287bdab37e4aa1d35 (diff) | |
| download | emacs-73be4d1ed5b190bd93e9bad6aebe43d0dea0d7d3.tar.gz emacs-73be4d1ed5b190bd93e9bad6aebe43d0dea0d7d3.zip | |
Allow destructuring in &aux sections when using edebug (Bug#40431)
* lisp/emacs-lisp/cl-macs.el (cl-lambda-list, cl-lambda-list1)
(cl-macro-list, cl-macro-list1): Allow arbitrary 'cl-lambda'
arguments in the &aux section.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-aux-edebug): New
regression test.
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 8 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-macs-tests.el | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 3317c580028..45e814e859c 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -199,7 +199,7 @@ The name is made by appending a number to PREFIX, default \"T\"." | |||
| 199 | [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] | 199 | [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] |
| 200 | &optional "&allow-other-keys"]] | 200 | &optional "&allow-other-keys"]] |
| 201 | [&optional ["&aux" &rest | 201 | [&optional ["&aux" &rest |
| 202 | &or (symbolp &optional def-form) symbolp]] | 202 | &or (cl-lambda-arg &optional def-form) cl-lambda-arg]] |
| 203 | . [&or arg nil]))) | 203 | . [&or arg nil]))) |
| 204 | 204 | ||
| 205 | (def-edebug-spec cl-&optional-arg | 205 | (def-edebug-spec cl-&optional-arg |
| @@ -219,7 +219,7 @@ The name is made by appending a number to PREFIX, default \"T\"." | |||
| 219 | [&optional ["&key" cl-&key-arg &rest cl-&key-arg | 219 | [&optional ["&key" cl-&key-arg &rest cl-&key-arg |
| 220 | &optional "&allow-other-keys"]] | 220 | &optional "&allow-other-keys"]] |
| 221 | [&optional ["&aux" &rest | 221 | [&optional ["&aux" &rest |
| 222 | &or (symbolp &optional def-form) symbolp]] | 222 | &or (cl-lambda-arg &optional def-form) cl-lambda-arg]] |
| 223 | . [&or arg nil]))) | 223 | . [&or arg nil]))) |
| 224 | 224 | ||
| 225 | (def-edebug-spec cl-type-spec sexp) | 225 | (def-edebug-spec cl-type-spec sexp) |
| @@ -402,7 +402,7 @@ and BODY is implicitly surrounded by (cl-block NAME ...). | |||
| 402 | arg]] | 402 | arg]] |
| 403 | &optional "&allow-other-keys"]] | 403 | &optional "&allow-other-keys"]] |
| 404 | [&optional ["&aux" &rest | 404 | [&optional ["&aux" &rest |
| 405 | &or (symbolp &optional def-form) symbolp]] | 405 | &or (cl-lambda-arg &optional def-form) cl-lambda-arg]] |
| 406 | [&optional "&environment" arg] | 406 | [&optional "&environment" arg] |
| 407 | ))) | 407 | ))) |
| 408 | 408 | ||
| @@ -421,7 +421,7 @@ and BODY is implicitly surrounded by (cl-block NAME ...). | |||
| 421 | arg]] | 421 | arg]] |
| 422 | &optional "&allow-other-keys"]] | 422 | &optional "&allow-other-keys"]] |
| 423 | [&optional ["&aux" &rest | 423 | [&optional ["&aux" &rest |
| 424 | &or (symbolp &optional def-form) symbolp]] | 424 | &or (cl-lambda-arg &optional def-form) cl-lambda-arg]] |
| 425 | . [&or arg nil]))) | 425 | . [&or arg nil]))) |
| 426 | 426 | ||
| 427 | ;;;###autoload | 427 | ;;;###autoload |
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 24bbad0cc6b..29ae95e2771 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el | |||
| @@ -601,4 +601,13 @@ collection clause." | |||
| 601 | collect y into result1 | 601 | collect y into result1 |
| 602 | finally return (equal (nreverse result) result1)))) | 602 | finally return (equal (nreverse result) result1)))) |
| 603 | 603 | ||
| 604 | (ert-deftest cl-macs-aux-edebug () | ||
| 605 | "Check that Bug#40431 is fixed." | ||
| 606 | (with-temp-buffer | ||
| 607 | (prin1 '(cl-defun cl-macs-aux-edebug-test-fun (&aux ((a . b) '(1 . 2))) | ||
| 608 | (list a b)) | ||
| 609 | (current-buffer)) | ||
| 610 | ;; Just make sure the function can be instrumented. | ||
| 611 | (edebug-defun))) | ||
| 612 | |||
| 604 | ;;; cl-macs-tests.el ends here | 613 | ;;; cl-macs-tests.el ends here |