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

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 30 Mar 2022 14:03:26 +0200

Phil Sainty <[email-masked]> writes:

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

Perhaps the n/p commands should just be changed.  It's really unusual to
have several dired buffers open to the same directory, and the dired
buffer we're interested in is usually the one we were in when we started
to view the image.

So perhaps image-mode should just note the dired buffer it's "called
from" (or determine that on startup), and then save that in a
buffer-local variable, and just use that buffer?  (Recomputing the
buffer if it's killed.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no