From: Michael Albinus Date: Fri, 1 Apr 2022 07:01:35 +0000 (+0200) Subject: More robust checks for directory buffers in image-mode X-Git-Tag: emacs-29.0.90~1931^2~840 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2429b9d8c902a26656e0d600abc1b3740208fa3c;p=emacs.git More robust checks for directory buffers in image-mode * lisp/image-mode.el (image-mode--directory-buffers): Apply more robust checks for directory buffers. (Bug#54606) --- diff --git a/lisp/image-mode.el b/lisp/image-mode.el index d7dfb4336b9..721f2f2bbd8 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -1196,8 +1196,9 @@ replacing the current Image mode buffer." "Return an alist of type/buffer for all \"parent\" buffers to image FILE. This is normally a list of Dired buffers, but can also be archive and tar mode buffers." - (let ((buffers nil) - (dir (file-name-directory file))) + (let* ((non-essential t) ; Do not block for remote buffers. + (buffers nil) + (dir (file-name-directory file))) (cond ((and (boundp 'tar-superior-buffer) tar-superior-buffer) @@ -1212,6 +1213,8 @@ tar mode buffers." (dolist (buffer (buffer-list)) (with-current-buffer buffer (when (and (derived-mode-p 'dired-mode) + (equal (file-remote-p dir) + (file-remote-p default-directory)) (equal (file-truename dir) (file-truename default-directory))) (push (cons 'dired (current-buffer)) buffers))))