GNU bug report logs - #51152
29.0.50; Fix deletion of marked thumbnails

Previous Next

Package: emacs;

Reported by: Peter Münster <pm <at> a16n.net>

Date: Tue, 12 Oct 2021 07:54:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Peter Münster <pm <at> a16n.net>
To: 51152 <at> debbugs.gnu.org
Subject: bug#51152: 29.0.50; Fix deletion of marked thumbnails
Date: Tue, 12 Oct 2021 09:53:12 +0200
[Message part 1 (text/plain, inline)]
Hello,

Since there is no movement tracking involved, the original commit
bf64342a8ffd8777df10051037ca13ec4f6857a5 was not needed. In contrast, it
introduced another problem: after deletion of the original files,
image-dired--with-marked doesn't see the marks any more.

Please find attached a new patch.

Kind regards,
-- 
           Peter
[0001-Fix-deletion-of-marked-thumbnails.patch (text/x-patch, inline)]
From be6d927abe3502748d32f08df8547f79bb0ba819 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20M=C3=BCnster?= <pm <at> a16n.net>
Date: Tue, 12 Oct 2021 09:50:16 +0200
Subject: [PATCH] Fix deletion of marked thumbnails

* 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, see bug#xxx.
---
 lisp/image-dired.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index ec3f988bfb..921215c603 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -2323,18 +2323,19 @@ image-dired-thumb-file-marked-p
         (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."
-- 
2.31.1

[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.