From: Morgan Smith Date: Thu, 18 Aug 2022 23:51:42 +0000 (+0200) Subject: Speed up image-dired-display-image X-Git-Tag: emacs-29.0.90~1447^2~56 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f1d0295bcf5ff5b2899831a5705051bca366c0e;p=emacs.git 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) --- 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))))