unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus
@ 2021-10-27 19:36 Stefan Kangas
  2021-10-28  6:57 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2021-10-27 19:36 UTC (permalink / raw)
  To: 51446

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

    image-dired: Unreverse accidentally reversed menus

    * lisp/image-dired.el (image-dired-thumbnail-mode-map)
    (image-dired-display-image-mode-map, image-dired-minor-mode-map):
    In commits b905454680c7 and bed0373855ea, the menus were converted to
    use 'easy-menu-define', but they were reversed in the process.
    Unreverse the menus.

Eli and Lars, is the attached bug fix acceptable for 28.1?  This merely
reverses the menus and does nothing else.  The change as such is a
mechanical one, and after adjusting one two-line entry really just comes
down to a `reverse-region', so I think it should be safe.

[-- Attachment #2: 0001-image-dired-Unreverse-accidentally-reversed-menus.patch --]
[-- Type: text/x-diff, Size: 6567 bytes --]

From 210c1025981ec52a9c05087924f232db6dc6ff88 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Wed, 27 Oct 2021 21:28:02 +0200
Subject: [PATCH] image-dired: Unreverse accidentally reversed menus

* lisp/image-dired.el (image-dired-thumbnail-mode-map)
(image-dired-display-image-mode-map, image-dired-minor-mode-map):
In commits b905454680c7 and bed0373855ea, the menus were converted to
use 'easy-menu-define', but they were reversed in the process.
Unreverse the menus.
---
 lisp/image-dired.el | 76 ++++++++++++++++++++++-----------------------
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 9985e5a54b..329085c823 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1547,33 +1547,33 @@ image-dired-thumbnail-mode-map
     (easy-menu-define nil map
       "Menu for `image-dired-thumbnail-mode'."
       '("Image-Dired"
-        ["Quit" quit-window]
-        ["Delete thumbnail from buffer" image-dired-delete-char]
-        ["Delete marked images" image-dired-delete-marked]
-        ["Remove tag from current or marked thumbnails"
-         image-dired-tag-thumbnail-remove]
-        ["Tag current or marked thumbnails" image-dired-tag-thumbnail]
-        ["Comment thumbnail" image-dired-comment-thumbnail]
-        ["Refresh thumb" image-dired-refresh-thumb]
-        ["Dynamic line up" image-dired-line-up-dynamic]
-        ["Line up thumbnails" image-dired-line-up]
-
-        ["Rotate thumbnail left" image-dired-rotate-thumbnail-left]
-        ["Rotate thumbnail right" image-dired-rotate-thumbnail-right]
-        ["Rotate original left" image-dired-rotate-original-left]
-        ["Rotate original right" image-dired-rotate-original-right]
+        ["Display image" image-dired-display-thumbnail-original-image]
+        ["Display in external viewer" image-dired-thumbnail-display-external]
 
-        ["Toggle movement tracking on/off" image-dired-toggle-movement-tracking]
+        ["Mark original" image-dired-mark-thumb-original-file]
+        ["Unmark original" image-dired-unmark-thumb-original-file]
+        ["Flag original for deletion" image-dired-flag-thumb-original-file]
 
-        ["Jump to dired buffer" image-dired-jump-original-dired-buffer]
         ["Track original" image-dired-track-original-file]
+        ["Jump to dired buffer" image-dired-jump-original-dired-buffer]
 
-        ["Flag original for deletion" image-dired-flag-thumb-original-file]
-        ["Unmark original" image-dired-unmark-thumb-original-file]
-        ["Mark original" image-dired-mark-thumb-original-file]
+        ["Toggle movement tracking on/off" image-dired-toggle-movement-tracking]
 
-        ["Display in external viewer" image-dired-thumbnail-display-external]
-        ["Display image" image-dired-display-thumbnail-original-image]))
+        ["Rotate original right" image-dired-rotate-original-right]
+        ["Rotate original left" image-dired-rotate-original-left]
+        ["Rotate thumbnail right" image-dired-rotate-thumbnail-right]
+        ["Rotate thumbnail left" image-dired-rotate-thumbnail-left]
+
+        ["Line up thumbnails" image-dired-line-up]
+        ["Dynamic line up" image-dired-line-up-dynamic]
+        ["Refresh thumb" image-dired-refresh-thumb]
+        ["Comment thumbnail" image-dired-comment-thumbnail]
+        ["Tag current or marked thumbnails" image-dired-tag-thumbnail]
+        ["Remove tag from current or marked thumbnails"
+         image-dired-tag-thumbnail-remove]
+        ["Delete marked images" image-dired-delete-marked]
+        ["Delete thumbnail from buffer" image-dired-delete-char]
+        ["Quit" quit-window]))
     map)
   "Keymap for `image-dired-thumbnail-mode'.")
 
@@ -1606,9 +1606,9 @@ image-dired-display-image-mode-map
     (easy-menu-define nil map
       "Menu for `image-dired-display-image-mode-map'."
       '("Image-Dired"
-        ["Quit" quit-window]
+        ["Display original, full size" image-dired-display-current-image-full]
         ["Display original, sized to fit" image-dired-display-current-image-sized]
-        ["Display original, full size" image-dired-display-current-image-full]))
+        ["Quit" quit-window]))
     map)
   "Keymap for `image-dired-display-image-mode'.")
 
@@ -1675,25 +1675,25 @@ image-dired-minor-mode-map
     (easy-menu-define nil map
       "Menu for `image-dired-minor-mode'."
       '("Image-dired"
-        ["Copy with EXIF file name" image-dired-copy-with-exif-file-name]
-        ["Comment files" image-dired-dired-comment-files]
-        ["Mark tagged files" image-dired-mark-tagged-files]
-        ["Jump to thumbnail buffer" image-dired-jump-thumbnail-buffer]
+        ["Display thumb for next file" image-dired-next-line-and-display]
+        ["Display thumb for previous file" image-dired-previous-line-and-display]
+        ["Mark and display next" image-dired-mark-and-display-next]
 
-        ["Toggle movement tracking" image-dired-toggle-movement-tracking]
-        ["Toggle append browsing" image-dired-toggle-append-browsing]
-        ["Toggle display properties" image-dired-toggle-dired-display-properties]
+        ["Create thumbnails for marked files" image-dired-create-thumbs]
 
-        ["Display in external viewer" image-dired-dired-display-external]
-        ["Display image" image-dired-dired-display-image]
-        ["Display this thumbnail" image-dired-display-thumb]
         ["Display thumbnails append" image-dired-display-thumbs-append]
+        ["Display this thumbnail" image-dired-display-thumb]
+        ["Display image" image-dired-dired-display-image]
+        ["Display in external viewer" image-dired-dired-display-external]
 
-        ["Create thumbnails for marked files" image-dired-create-thumbs]
+        ["Toggle display properties" image-dired-toggle-dired-display-properties]
+        ["Toggle append browsing" image-dired-toggle-append-browsing]
+        ["Toggle movement tracking" image-dired-toggle-movement-tracking]
 
-        ["Mark and display next" image-dired-mark-and-display-next]
-        ["Display thumb for previous file" image-dired-previous-line-and-display]
-        ["Display thumb for next file" image-dired-next-line-and-display]))
+        ["Jump to thumbnail buffer" image-dired-jump-thumbnail-buffer]
+        ["Mark tagged files" image-dired-mark-tagged-files]
+        ["Comment files" image-dired-dired-comment-files]
+        ["Copy with EXIF file name" image-dired-copy-with-exif-file-name]))
     map)
   "Keymap for `image-dired-minor-mode'.")
 
-- 
2.30.2


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

* bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus
  2021-10-27 19:36 bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus Stefan Kangas
@ 2021-10-28  6:57 ` Eli Zaretskii
  2021-10-28  7:27   ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-10-28  6:57 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 51446

> From: Stefan Kangas <stefan@marxist.se>
> Date: Wed, 27 Oct 2021 12:36:05 -0700
> 
>     image-dired: Unreverse accidentally reversed menus
> 
>     * lisp/image-dired.el (image-dired-thumbnail-mode-map)
>     (image-dired-display-image-mode-map, image-dired-minor-mode-map):
>     In commits b905454680c7 and bed0373855ea, the menus were converted to
>     use 'easy-menu-define', but they were reversed in the process.
>     Unreverse the menus.
> 
> Eli and Lars, is the attached bug fix acceptable for 28.1?  This merely
> reverses the menus and does nothing else.  The change as such is a
> mechanical one, and after adjusting one two-line entry really just comes
> down to a `reverse-region', so I think it should be safe.

I don't understand: I seem to see the same order of the menu items in
Emacs 27 and on the current release branch, so what am I missing?





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

* bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus
  2021-10-28  6:57 ` Eli Zaretskii
@ 2021-10-28  7:27   ` Stefan Kangas
  2021-10-28  9:32     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2021-10-28  7:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51446

Eli Zaretskii <eliz@gnu.org> writes:

> I don't understand: I seem to see the same order of the menu items in
> Emacs 27 and on the current release branch, so what am I missing?

The regression was introduced in Emacs 26.1, in these commits:

    $ git tag --contain=bed0373855ea | head -3
    emacs-26.0.90
    emacs-26.0.91
    emacs-26.1
    $ git tag --contain=b905454680c7 | head -3
    emacs-26.0.90
    emacs-26.0.91
    emacs-26.1

It's the easy-to-make mistake of converting to easy-menu-define without
realizing that the order is not reversed there.





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

* bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus
  2021-10-28  7:27   ` Stefan Kangas
@ 2021-10-28  9:32     ` Eli Zaretskii
  2021-10-28 11:04       ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-10-28  9:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 51446

> From: Stefan Kangas <stefan@marxist.se>
> Date: Thu, 28 Oct 2021 00:27:18 -0700
> Cc: 51446@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I don't understand: I seem to see the same order of the menu items in
> > Emacs 27 and on the current release branch, so what am I missing?
> 
> The regression was introduced in Emacs 26.1, in these commits:
> 
>     $ git tag --contain=bed0373855ea | head -3
>     emacs-26.0.90
>     emacs-26.0.91
>     emacs-26.1
>     $ git tag --contain=b905454680c7 | head -3
>     emacs-26.0.90
>     emacs-26.0.91
>     emacs-26.1
> 
> It's the easy-to-make mistake of converting to easy-menu-define without
> realizing that the order is not reversed there.

Thanks.  I cannot invoke image-dired-minor-mode in Emacs 25, so I
cannot see the problem.  I don't really understand why the order of
the items in the menu matters in this case.  but it doesn't matter;
please go ahead and install the change.





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

* bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus
  2021-10-28  9:32     ` Eli Zaretskii
@ 2021-10-28 11:04       ` Stefan Kangas
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2021-10-28 11:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51446

close 51446 28.1
thanks

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks.  I cannot invoke image-dired-minor-mode in Emacs 25, so I
> cannot see the problem.  I don't really understand why the order of
> the items in the menu matters in this case.  but it doesn't matter;

I believe it should be enough to just say `M-x image-dired'.

As for why the fix matters, it's mostly just confusing to have
"Quit" at the top.

> please go ahead and install the change.

Thanks, pushed to emacs-28 (commit f52fa1c150).





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

end of thread, other threads:[~2021-10-28 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 19:36 bug#51446: [PATCH] image-dired: Unreverse accidentally reversed menus Stefan Kangas
2021-10-28  6:57 ` Eli Zaretskii
2021-10-28  7:27   ` Stefan Kangas
2021-10-28  9:32     ` Eli Zaretskii
2021-10-28 11:04       ` Stefan Kangas

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