all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Peter Münster" <pm@a16n.net>
To: 51152@debbugs.gnu.org
Subject: bug#51152: 29.0.50; Fix deletion of marked thumbnails
Date: Tue, 12 Oct 2021 09:53:12 +0200	[thread overview]
Message-ID: <87tuhm1xxz.fsf@a16n.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 353 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Fix-deletion-of-marked-thumbnails.patch --]
[-- Type: text/x-patch, Size: 1693 bytes --]

From be6d927abe3502748d32f08df8547f79bb0ba819 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20M=C3=BCnster?= <pm@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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

             reply	other threads:[~2021-10-12  7:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  7:53 Peter Münster [this message]
2021-10-12 12:32 ` bug#51152: 29.0.50; Fix deletion of marked thumbnails Lars Ingebrigtsen
2021-10-12 14:51   ` Peter Münster
2021-10-12 15:16     ` Lars Ingebrigtsen
2021-10-12 18:48       ` Peter Münster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuhm1xxz.fsf@a16n.net \
    --to=pm@a16n.net \
    --cc=51152@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.