diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-12-21 11:13:07 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-12-21 11:13:40 -0500 |
commit | 476426168106dbcee67d8ea667e11ebe80c7aaed (patch) | |
tree | 7872441265781cbaf673b9f81235202975fd8d0c /test/lisp/emacs-lisp | |
parent | a1d08d2c13497937475bf453c66a22a61f4e8631 (diff) | |
download | emacs-476426168106dbcee67d8ea667e11ebe80c7aaed.tar.gz emacs-476426168106dbcee67d8ea667e11ebe80c7aaed.tar.bz2 emacs-476426168106dbcee67d8ea667e11ebe80c7aaed.zip |
(cl-flet, cl-labels): Fix bug#74870
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Wrap function
bodies in `cl-block`.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--test-flet-block): New test.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/cl-macs-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 4baf5428101..e1a521dca79 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -718,6 +718,16 @@ collection clause." (f lex-var))))) (should (equal (f nil) 'a))))) +(ert-deftest cl-macs--test-flet-block () + (should (equal (cl-block f1 + (cl-flet ((f1 (a) (cons (cl-return-from f1 a) 6))) + (cons (f1 5) 6))) + '(5 . 6))) + (should (equal (cl-block f1 + (cl-labels ((f1 (a) (cons (cl-return-from f1 a) 6))) + (cons (f1 7) 8))) + '(7 . 8)))) + (ert-deftest cl-flet/edebug () "Check that we can instrument `cl-flet' forms (bug#65344)." (with-temp-buffer |