Phil Sainty writes: Hi Phil, > In 27.1 this code is in `image-next-file'. In master it's now > `image-mode--directory-buffers', but the relevant code looks > the same: > > ;; Find a dired buffer. > (dolist (buffer (buffer-list)) > (with-current-buffer buffer > (when (and (derived-mode-p 'dired-mode) > (equal (file-truename dir) > (file-truename default-directory))) > > 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. I've reproduced the problem. As said already (?), it is similar to bug#54542. The solution there was to wrap the code in question by let-binding non-essential to t, and to enhance Tramp to behave accordingly. The Tramp change is already in the master branch, and also in the just released Tramp 2.5.2.3 on GNU ELPA. So I've applied the following change in master: