all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.