]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix deletion of associated image
authorPeter Münster <pm@a16n.net>
Mon, 16 Aug 2021 22:19:08 +0000 (00:19 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 19 Aug 2021 13:03:23 +0000 (15:03 +0200)
* lisp/image-dired.el (image-dired-delete-marked): Treat original images
first, because point position is used when there are no marked files.

lisp/image-dired.el

index 1e1614af9b63906c12dc35d9078acac0de46403e..9455ab1ff08281b483e263c80538a035ef944e8a 100644 (file)
@@ -2313,14 +2313,14 @@ non-nil."
           (image-dired-dired-file-marked-p))))))
 
 (defun image-dired-delete-marked ()
-  "Delete marked thumbnails and associated images."
+  "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)
-  (with-current-buffer (image-dired-associated-dired-buffer)
-    (dired-do-delete)))
+  (image-dired--line-up-with-method))
 
 (defun image-dired-thumb-update-marks ()
   "Update the marks in the thumbnail buffer."