unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* save-excursion and multi-thread?
@ 2021-09-26 17:41 Qiantan Hong
  2021-09-26 18:18 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Qiantan Hong @ 2021-09-26 17:41 UTC (permalink / raw)
  To: emacs-devel@gnu.org

I tried
(make-thread
 (lambda ()
   (save-excursion (goto-char (point-min)) (sleep-for 1))))
In *scratch*.

It seems that after the thread yields (because of sleep-for)
it doesn’t restore point position, and after 1 second
cursor is reseted to the original position, discarding
any of my movements during this 1 second.

Is this how save-excursion supposed to work?
It’s inconsistent with the behavior of special variable + dynamic bindings,
which works currently under multi-thread.

What’s the supposed way to have “thread-local” movements?

Best,
Qiantan


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

end of thread, other threads:[~2021-10-01 22:35 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-26 17:41 save-excursion and multi-thread? Qiantan Hong
2021-09-26 18:18 ` Eli Zaretskii
2021-09-26 18:28   ` Qiantan Hong
2021-09-26 18:53     ` Eli Zaretskii
2021-09-26 19:09       ` Qiantan Hong
2021-09-26 19:14         ` Eli Zaretskii
2021-09-26 19:13       ` Qiantan Hong
2021-09-26 19:16         ` Eli Zaretskii
2021-09-26 19:21           ` Qiantan Hong
2021-09-26 19:29             ` Eli Zaretskii
2021-09-26 19:42               ` Qiantan Hong
2021-09-26 19:45                 ` Qiantan Hong
2021-09-27  4:36                   ` Eli Zaretskii
2021-09-28 23:33                   ` Richard Stallman
2021-09-29  1:41                     ` dick
2021-09-29  2:59                       ` Qiantan Hong
2021-10-01 22:32                       ` Richard Stallman
2021-09-29 12:45                     ` Eli Zaretskii
2021-10-01 22:35                       ` Richard Stallman
2021-09-27  4:36                 ` Eli Zaretskii
2021-09-27  5:00                   ` Qiantan Hong
2021-09-27  5:54                     ` Eli Zaretskii
2021-09-27  6:14                       ` Qiantan Hong
2021-09-27 10:13                         ` Eli Zaretskii
2021-09-26 18:21 ` Tassilo Horn
2021-09-26 19:02   ` Eli Zaretskii
2021-09-27 19:35 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

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).