]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix point movement in image-dired
authorPeter Münster <pm@a16n.net>
Tue, 12 Oct 2021 12:31:58 +0000 (14:31 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 13 Oct 2021 11:41:32 +0000 (13:41 +0200)
* lisp/image-dired.el (image-dired-thumb-file-marked-p): Don't
move point in associated dired buffer.
(image-dired-delete-marked): Revert "Fix deletion of associated image"
because it was wrong and introduced another problem (bug#51152).

lisp/image-dired.el

index 3ca47300a996d889bb212c7e14c3050d83140d89..4e6a410c1141dc73528a454754a5860a83b74135 100644 (file)
@@ -2314,18 +2314,19 @@ non-nil."
         (dired-buf (image-dired-associated-dired-buffer)))
     (when (and dired-buf file-name)
       (with-current-buffer dired-buf
-        (when (dired-goto-file file-name)
-          (image-dired-dired-file-marked-p))))))
+        (save-excursion
+          (when (dired-goto-file file-name)
+            (image-dired-dired-file-marked-p)))))))
 
 (defun image-dired-delete-marked ()
   "Delete current or marked thumbnails and associated images."
   (interactive)
-  (with-current-buffer (image-dired-associated-dired-buffer)
-    (dired-do-delete))
   (image-dired--with-marked
    (image-dired-delete-char)
    (backward-char))
-  (image-dired--line-up-with-method))
+  (image-dired--line-up-with-method)
+  (with-current-buffer (image-dired-associated-dired-buffer)
+    (dired-do-delete)))
 
 (defun image-dired-thumb-update-marks ()
   "Update the marks in the thumbnail buffer."