Subject: Re: bug#54606: 27.1; next/previous image command in image-mode triggers tramp connections for all remote dired buffers

From: Michael Albinus <[email-masked]>
Date: Wed, 30 Mar 2022 13:51:57 +0200

Phil Sainty <[email-masked]> writes:

Hi Phil,

> I've just tested with this, and it solves the immediate problem, but
> it's slow.  In my test case it's taking ~2s to switch between images,
> whereas it takes only a fraction of a second when I'm ignoring remote
> dired buffers by adding (not (file-remote-p default-directory)) to
> the conditions.
>
> I have 15 remote dired buffers (about half of which are using multi-
> hops), which isn't a small number but also isn't big, so I think that
> `non-essential' seems inadequate here (unless this is significantly
> more efficient in newer versions).

There is also a change in Tramp of Emacs master, which is relevant in
this context. Do you have a chance to test that Emacs version?

Otherwise, does the appended patch for Emacs 27 make a difference? I
haven't tested it with Emacs 27, though.

> -Phil

Best regards, Michael.

*** /tmp/ediffwcSDZb	2022-03-30 13:50:29.736061472 +0200
--- /home/albinus/src/emacs-27/lisp/net/tramp-sh.el	2022-03-30 13:50:18.051914192 +0200
***************
*** 4958,4963 ****
--- 4958,4964 ----
      ;; If Tramp opens the same connection within a short time frame,
      ;; there is a problem.  We shall signal this.
      (unless (or (process-live-p p)
+                 (and (processp p) (not non-essential))
  		(not (tramp-file-name-equal-p
  		      vec (car tramp-current-connection)))
  		(time-less-p