Subject: bug#57651: [PATCH] image-dired tweaks

From: Morgan Smith <[email-masked]>
Date: Wed, 07 Sep 2022 13:24:50 -0400

Hello!

Explanation in the commit message.  Rotation still works that same if
nothing is marked.

>From dd4b02bafd9590c4f5747aa2e3d16deceea07807 Mon Sep 17 00:00:00 2001
From: Morgan Smith <[email-masked]>
Date: Wed, 7 Sep 2022 13:17:12 -0400
Subject: [PATCH] image-dired tweaks

lisp/image/image-dired:
(image-dired--do-mark-command): Make movement behavior consistent
regardless of the value of `image-dired-marking-shows-next'

(image-dired-rotate-original-left, image-dired-rotate-original-right):
Rotate marked files if any
---
 lisp/image/image-dired.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 88f4ceaffb..e799f2e748 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -767,7 +767,7 @@ according to `image-dired-marking-shows-next'."
      ,(when maybe-next
         '(if image-dired-marking-shows-next
              (image-dired-display-next-thumbnail-original)
-           (image-dired-next-line)))))
+           (image-dired-forward-image)))))
 
 (defun image-dired-mark-thumb-original-file ()
   "Mark original image file in associated Dired buffer."
@@ -1126,7 +1126,8 @@ and a confirmation is needed before the original image files is
 overwritten.  This confirmation can be turned off using
 `image-dired-rotate-original-ask-before-overwrite'."
   (interactive nil image-dired-thumbnail-mode)
-  (image-dired-rotate-original "270"))
+  (image-dired--with-marked
+   (image-dired-rotate-original "270")))
 
 (defun image-dired-rotate-original-right ()
   "Rotate original image right (clockwise) 90 degrees.
@@ -1135,7 +1136,8 @@ and a confirmation is needed before the original image files is
 overwritten.  This confirmation can be turned off using
 `image-dired-rotate-original-ask-before-overwrite'."
   (interactive nil image-dired-thumbnail-mode)
-  (image-dired-rotate-original "90"))
+  (image-dired--with-marked
+   (image-dired-rotate-original "90")))
 
 (defun image-dired-display-next-thumbnail-original (&optional arg)
   "Move to the next image in the thumbnail buffer and display it.
-- 
2.37.2

Thanks,

Morgan