unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51152: 29.0.50; Fix deletion of marked thumbnails
@ 2021-10-12  7:53 Peter Münster
  2021-10-12 12:32 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Münster @ 2021-10-12  7:53 UTC (permalink / raw)
  To: 51152


[-- 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 --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#51152: 29.0.50; Fix deletion of marked thumbnails
  2021-10-12  7:53 bug#51152: 29.0.50; Fix deletion of marked thumbnails Peter Münster
@ 2021-10-12 12:32 ` Lars Ingebrigtsen
  2021-10-12 14:51   ` Peter Münster
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-12 12:32 UTC (permalink / raw)
  To: Peter Münster; +Cc: 51152

Peter Münster <pm@a16n.net> writes:

> 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.

Thanks; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51152: 29.0.50; Fix deletion of marked thumbnails
  2021-10-12 12:32 ` Lars Ingebrigtsen
@ 2021-10-12 14:51   ` Peter Münster
  2021-10-12 15:16     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Münster @ 2021-10-12 14:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51152

[-- Attachment #1: Type: text/plain, Size: 159 bytes --]

On Tue, Oct 12 2021, Lars Ingebrigtsen wrote:

> Thanks; applied to Emacs 28.

Could you apply it to master too please?

Thanks,
-- 
           Peter

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51152: 29.0.50; Fix deletion of marked thumbnails
  2021-10-12 14:51   ` Peter Münster
@ 2021-10-12 15:16     ` Lars Ingebrigtsen
  2021-10-12 18:48       ` Peter Münster
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-12 15:16 UTC (permalink / raw)
  To: Peter Münster; +Cc: 51152

Peter Münster <pm@a16n.net> writes:

>> Thanks; applied to Emacs 28.
>
> Could you apply it to master too please?

All changes to emacs-28 will get merged to master (usually after a
couple of days).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51152: 29.0.50; Fix deletion of marked thumbnails
  2021-10-12 15:16     ` Lars Ingebrigtsen
@ 2021-10-12 18:48       ` Peter Münster
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Münster @ 2021-10-12 18:48 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51152

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

On Tue, Oct 12 2021, Lars Ingebrigtsen wrote:

> Peter Münster <pm@a16n.net> writes:
>
>>> Thanks; applied to Emacs 28.
>>
>> Could you apply it to master too please?
>
> All changes to emacs-28 will get merged to master (usually after a
> couple of days).

Ok, thanks. I use git://git.sv.gnu.org/emacs.git. Is this repository
updated? I don't find the commit in emacs-28...

-- 
           Peter

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-12 18:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12  7:53 bug#51152: 29.0.50; Fix deletion of marked thumbnails Peter Münster
2021-10-12 12:32 ` 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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).