GNU bug report logs -
#63311
30.0.50; [PATCH] smtpmail-send-it split
Previous Next
Full log
View this message in rfc822 format
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 63311 <at> 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?
This bug report was last modified 1 year and 221 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.