Subject: 28.0.50; Improvements to menu-bar Edit: add redo

From: Caio Henrique <[email-masked]>
Date: Thu, 10 Sep 2020 15:29:11 -0300

Hi,

After the recent discussions to improve discoverability of Emacs, I
analyzed the Emacs menu-bar and the menu bar of  other text
editors. They all have a "Redo" option close to the "Undo".

Here are some examples:

1. nano
When you launch nano on the terminal, you can see the text on the bottom
that says "M-E Redo", right bellow "Undo".

2. libreoffice write
When you open the Edit menu, you will find that the first option is "Undo"
and the second is "Redo".

3. Notepad++
Same as libreoffice write.

4. Visual Studio Code
Same as libreoffice write.

Here is my proposal:
I'm not used to the default undo system since I use undo-tree, but it
seems that Emacs 28 has added a function called undo-redo to the
simple.el file, right? My proposal is to add it to the menu-bar, right
bellow "Undo":

_____
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index bc094c9050..30d86c7f17 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -536,6 +536,12 @@ menu-bar-edit-menu
     (if (featurep 'ns)
         (bindings--define-key menu [separator-undo] menu-bar-separator))
 
+    (bindings--define-key menu [undo-redo]
+      '(menu-item "Redo" undo-redo
+                  :enable (and (not buffer-read-only)
+                           (undo--last-change-was-undo-p buffer-undo-list))
+                  :help "Undo last undo"))
+
     (bindings--define-key menu [undo]
       '(menu-item "Undo" undo
                   :enable (and (not buffer-read-only)
____

Cordially,
Caio Henrique