GNU bug report logs - #49987
27.2; Let image-dired-mouse-toggle-mark act on active region

Previous Next

Package: emacs;

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

Date: Tue, 10 Aug 2021 20:42:01 UTC

Severity: normal

Found in version 27.2

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49987 in the body.
You can then email your comments to 49987 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49987; Package emacs. (Tue, 10 Aug 2021 20:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Münster <pm <at> a16n.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 10 Aug 2021 20:42:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Münster <pm <at> a16n.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.2; Let image-dired-mouse-toggle-mark act on active region
Date: Tue, 10 Aug 2021 22:27:41 +0200
[Message part 1 (text/plain, inline)]
Hi,

It would be nice, if one can toggle marks of all thumbnails in the
active region.

Here is a patch:

* lisp/image-dired.el (image-dired-mouse-toggle-mark): When region is
active, then toggle marks of all images within.


diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 2509ecf8f8..8a065f2e6f 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -2311,17 +2311,32 @@ non-nil."
       (image-dired-track-original-file))
   (image-dired-display-thumb-properties))
 
-(defun image-dired-mouse-toggle-mark (event)
-  "Use mouse EVENT to toggle dired mark for thumbnail.
+(defun image-dired-mouse-toggle-mark-1 ()
+  "Toggle dired mark for current thumbnail.
 Track this in associated dired buffer if `image-dired-track-movement' is
 non-nil."
-  (interactive "e")
-  (mouse-set-point event)
-  (goto-char (posn-point (event-end event)))
   (if image-dired-track-movement
       (image-dired-track-original-file))
   (image-dired-toggle-mark-thumb-original-file))
 
+(defun image-dired-mouse-toggle-mark (event)
+  "Use mouse EVENT to toggle dired mark for thumbnail.
+Toggle marks of all thumbnails in region, if it's active.
+Track this in associated dired buffer if `image-dired-track-movement' is
+non-nil."
+  (interactive "e")
+  (if (use-region-p)
+      (let ((end (region-end)))
+        (save-excursion
+          (goto-char (region-beginning))
+          (while (<= (point) end)
+            (when (image-dired-image-at-point-p)
+              (image-dired-mouse-toggle-mark-1))
+            (forward-char))))
+    (mouse-set-point event)
+    (goto-char (posn-point (event-end event)))
+    (image-dired-mouse-toggle-mark-1)))
+
 (defun image-dired-dired-display-properties ()
   "Display properties for dired file in the echo area."
   (interactive)

What do think about that?

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49987; Package emacs. (Wed, 11 Aug 2021 11:41:05 GMT) Full text and rfc822 format available.

Message #8 received at 49987 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Peter Münster <pm <at> a16n.net>
Cc: 49987 <at> debbugs.gnu.org
Subject: Re: bug#49987: 27.2; Let image-dired-mouse-toggle-mark act on
 active region
Date: Wed, 11 Aug 2021 13:40:07 +0200
Peter Münster <pm <at> a16n.net> writes:

> It would be nice, if one can toggle marks of all thumbnails in the
> active region.

Makes sense to me; applied to Emacs 28.

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




bug marked as fixed in version 28.1, send any further explanations to 49987 <at> debbugs.gnu.org and Peter Münster <pm <at> a16n.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 11 Aug 2021 11:41:06 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Sep 2021 11:24:10 GMT) Full text and rfc822 format available.

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

Previous Next


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