bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eli Zaretskii
Subject: bug#63311: 30.0.50; [PATCH] smtpmail-send-it split
Date: Fri, 12 May 2023 10:09:41 +0300

> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: 63311@debbugs.gnu.org
> 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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]