GNU bug report logs - #32537
26.1.50; Tramp: Cursor jumps when typing during asynchronous find-file

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Sun, 26 Aug 2018 17:41:01 UTC

Severity: normal

Tags: fixed

Found in version 26.1.50

Fixed in version 27.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gemini Lasswell <gazally <at> runbox.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 32537 <at> debbugs.gnu.org
Subject: bug#32537: 26.1.50; Tramp: Cursor jumps when typing during asynchronous find-file
Date: Sat, 01 Sep 2018 17:24:49 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> OK, but this sounds strange to me, since AFAICT Tramp switches to its
> own buffer when it sends a script to the remote and waits for it to
> return the results (which is most probably when the main thread gets
> control and lets you type).
>
> Michael, how come Tramp moves point in the *scratch* buffer in this
> scenario?

Here's what I think the sequence of events was, in that last trace:

When tramp-sh-handle-file-attributes is called in Thread 10, its current
buffer is *scratch*.  Point in *scratch* is 256.

tramp-sh-handle-file-attributes enters its save-excursion form which
saves a marker pointing to 256 in *scratch* in the special binding stack
of Thread 10.

tramp-sh-handle-file-attributes then calls functions which switch to
Tramp's buffer, and which yield execution while waiting for the remote.

The main thread gains the global lock and handles 3 characters of
keyboard input, which all run self-insert-command in the main thread's
current buffer, *scratch*.  Point is now 259 but the marker in Thread
10's stack is still at 256.

The main thread yields in between keystrokes and Thread 10 resumes when
the response is received from the remote.  When its execution reaches
the end of the save-excursion form, save_excursion_restore sets the
current buffer and its point from the marker, to *scratch* and 256.







This bug report was last modified 6 years and 344 days ago.

Previous Next


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