unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Thread and closure
@ 2023-05-04 12:02 Manuel Giraud via Users list for the GNU Emacs text editor
  2023-05-04 13:48 ` Manuel Giraud via Users list for the GNU Emacs text editor
  2023-05-04 23:33 ` Emanuel Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Manuel Giraud via Users list for the GNU Emacs text editor @ 2023-05-04 12:02 UTC (permalink / raw)
  To: gnu-emacs-help

Hi,

Is it possible in Emacs to have lisp threads to works with closures?
With the following example, 'M-x closure' displays a message but 'M-x
threaded-closure' does not:

--8<---------------cut here---------------start------------->8---
(defun closure ()
  (interactive)
  (let ((my-message "Hello world"))
    (funcall #'(lambda ()
		 (message "%s" my-message)))))

(defun threaded-closure ()
  (interactive)
  (let ((my-message "Hello world"))
    (make-thread #'(lambda ()
		     (message "%s" my-message)))))
--8<---------------cut here---------------end--------------->8---

Best regards,
-- 
Manuel Giraud



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-13 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-04 12:02 Thread and closure Manuel Giraud via Users list for the GNU Emacs text editor
2023-05-04 13:48 ` Manuel Giraud via Users list for the GNU Emacs text editor
2023-05-04 23:33 ` Emanuel Berg
2023-05-05 13:40   ` Manuel Giraud via Users list for the GNU Emacs text editor
2023-05-13 13:08     ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).