GNU bug report logs - #63311
30.0.50; [PATCH] smtpmail-send-it split

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Fri, 5 May 2023 15:10:01 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Full log


Message #35 received at 63311 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 63311 <at> debbugs.gnu.org
Subject: Re: bug#63311: 30.0.50; [PATCH] smtpmail-send-it split
Date: Fri, 12 May 2023 10:09:41 +0300
> 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 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.