GNU bug report logs -
#63311
30.0.50; [PATCH] smtpmail-send-it split
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: 63311 <at> debbugs.gnu.org
>> Date: Wed, 10 May 2023 13:47:11 +0200
>>
>> So I guess, my question is how does one mix Lisp thread with
>> unwind-protect?
>
> I'm not sure I understand why you need to. The two unwind-protect
> handlers will run at different times and most probably will need to
> unwind different stuff, although there could be overlap. So why is it
> a problem to have two separate unwind forms?
I was not talking about two separate unwind forms. I was talking about
*thread* and unwind. Here is a minimal example that exhibits my
problem:
--8<---------------cut here---------------start------------->8---
(setq-local lexical-binding t)
(defun my-problem ()
(interactive)
(let ((buf (generate-new-buffer "*foo*")))
(with-current-buffer buf
(insert "secret message"))
(unwind-protect
(make-thread #'(lambda ()
(with-current-buffer buf
(sit-for 10)
(message (buffer-string)))))
(kill-buffer buf))))
--8<---------------cut here---------------end--------------->8---
The thread won't have a chance to do its job since the buffer will
already be dead.
--
Manuel Giraud
This bug report was last modified 1 year and 220 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.