]> git.eshelyaron.com Git - emacs.git/commitdiff
Speed up image-dired-display-image
authorMorgan Smith <Morgan.J.Smith@outlook.com>
Thu, 18 Aug 2022 23:51:42 +0000 (01:51 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 19 Aug 2022 05:37:05 +0000 (07:37 +0200)
* 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

index 93cce33c2ba6a6d4a25172aab8dd8451450d0e89..9f12354111ca6e25f1311f555cd0db54244f4b01 100644 (file)
@@ -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))))