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

From: Gemini Lasswell <[email-masked]>
Date: Sun, 26 Aug 2018 10:39:55 -0700

This bug report is against the feature/tramp-thread-safe branch,
162353c45c.

Continuous typing during an asynchronous find-file will result in
garbled input because the cursor periodically jumps backwards.

To reproduce, with emacs -Q, *scratch* as the current buffer,
and a remote machine with the Emacs source tree:

C-x & C-x C-f scp:server:src/emacs/lisp/emacs-lisp/b*.el RET

Then type "The rain in Spain falls mainly on the plain." or other
sentence of your choice, over and over.  Stop when the message about
checking vc-registered appears in the echo area.

Result: There will be a pause before the first typed text appears, then
Emacs will start showing the typed text normally, except periodically
the cursor will jump backwards so text will be inserted in the wrong
place.

After the first vc-registered message, Emacs will stop responding to
input until after a buffer for one of the opened files is displayed.

I'm running Emacs on a laptop which is using my cell phone's mobile
hotspot to connect to a machine on my home network, meaning there is
significant latency.

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.28)
 of 2018-08-21 built on sockeye
Repository revision: 162353c45cf7ae8c5626a5062c247a793e30e7d0
System Description: NixOS 18.03.git.bd06547 (Impala)

Recent messages:

Tramp: Checking ‘vc-registered’ for /scp:chinook:/home/gem/src/emacs/master/lisp/emacs-lisp/bytecomp.el...done

Tramp: Checking ‘vc-registered’ for /scp:chinook:/home/gem/src/emacs/master/lisp/emacs-lisp/backquote.el...done

Tramp: Checking ‘vc-registered’ for /scp:chinook:/home/gem/src/emacs/master/lisp/emacs-lisp/byte-run.el...done

Tramp: Checking ‘vc-registered’ for /scp:chinook:/home/gem/src/emacs/master/lisp/emacs-lisp/benchmark.el...done
Undo!
C-x M-x is undefined
Quit
Configured using:
 'configure --prefix=/home/gem/src/emacs/tramp/bin --with-modules
 --with-x-toolkit=gtk3 --with-xft --config-cache'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES THREADS LCMS2 GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils vc-git diff-mode easymenu easy-mmode
files-x tramp-sh tramp-cache tramp trampver tramp-compat tramp-loaddefs
ucs-normalize shell pcomplete comint ansi-color ring parse-time
format-spec advice auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib term/xterm xterm time-date
elec-pair mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 231578 10507)
 (symbols 48 22696 1)
 (strings 32 37905 1930)
 (string-bytes 1 1127065)
 (vectors 16 38578)
 (vector-slots 8 747585 13268)
 (floats 8 72 538)
 (intervals 56 347 0)
 (buffers 992 24))