Subject: Re: bug#63311: 30.0.50; [PATCH] smtpmail-send-it split

From: Eli Zaretskii <[email-masked]>
Date: Fri, 12 May 2023 10:09:41 +0300

> From: Manuel Giraud <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 12 May 2023 08:24:36 +0200
> 
> (setq-local lexical-binding t)
> 
> (defun eli-solution ()
>   (interactive)
>   (let ((buf (generate-new-buffer "*foo*")))
>     (with-current-buffer buf
>       (insert "secret message"))
>     (let ((cleanup #'(lambda () (kill-buffer buf)))
> 	  thread)
>       (unwind-protect
> 	  (setf thread (make-thread #'(lambda ()
> 					(with-current-buffer buf
> 					  (sit-for 10)
> 					  (message (buffer-string))
> 					  (funcall cleanup)))))
> 	(unless (thread-live-p thread)
> 	  (funcall cleanup))))))

Yes, something like that.

> BTW, do you know a more elisp way of defining a function than
> "(let ((f #'(lambda…))))" form?

I'm not sure I understand: what's not ELisp'y about that?

And why not use defun instead?