From 8f1d0295bcf5ff5b2899831a5705051bca366c0e Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Fri, 19 Aug 2022 01:51:42 +0200 Subject: [PATCH] Speed up image-dired-display-image * lisp/image-dired.el (image-dired-display-image): Open file literally so we don't run image-mode twice. (Bug#57281) --- lisp/image-dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 93cce33c2ba..9f12354111c 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1978,8 +1978,8 @@ based on `image-mode'." (cur-win (selected-window))) (when buf (kill-buffer buf)) - (when-let ((buf (find-file-other-window file))) - (display-buffer buf) + (when-let ((buf (find-file-noselect file nil t))) + (pop-to-buffer buf) (rename-buffer image-dired-display-image-buffer) (image-dired-display-image-mode) (select-window cur-win)))) -- 2.39.2