Use cl-with-gensyms in ert-with-message-capture

* lisp/emacs-lisp/ert-x.el (ert-with-message-capture): Use
cl-with-gensyms.
This commit is contained in:
Stefan Kangas 2025-02-24 00:45:20 +01:00
parent ae8522af41
commit 45f5f718a0

View file

@ -329,9 +329,7 @@ This is useful for separating the issuance of messages by the
code under test from the behavior of the *Messages* buffer."
(declare (debug (symbolp body))
(indent 1))
(let ((g-message-advice (gensym))
(g-print-advice (gensym))
(g-collector (gensym)))
(cl-with-gensyms (g-message-advice g-print-advice g-collector)
`(let* ((,var "")
(,g-collector (lambda (msg) (setq ,var (concat ,var msg))))
(,g-message-advice (ert--make-message-advice ,g-collector))