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

From: Phil Sainty <[email-masked]>
Date: Thu, 31 Mar 2022 00:43:23 +1300

On 2022-03-30 02:09, Michael Albinus wrote:
> Lars Ingebrigtsen <[email-masked]> writes:
>> Phil Sainty <[email-masked]> writes:
>>> That call to (file-truename default-directory) for each dired
>>> buffer can cause tramp to spin up for closed connections for
>>> entirely irrelevant dired buffers.
>> 
>> Hm.  Would binding `non-essential' around that call fix the issue?
> 
> That's my expectation. It's on my TODO to test, but I'm occupied yet.
> Hope to fix this later this week.

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

-Phil