all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#37594: Menu rearrangement
@ 2019-10-02 21:27 Juri Linkov
  2019-10-03 17:09 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2019-10-02 21:27 UTC (permalink / raw)
  To: 37594

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

Tags: patch

The most suitable place for the new tab commands is below
window and frame commands in the File menu.

Since this makes the menu too long, this patch moves the
print related commands into a new submenu.

Also it adds new menu items for two new commands,
and renames 'grep' to 'rgrep' that is more user-friendly.

Finally, it advertises easier to understand bindings C-x <right>
and C-x <left> instead of XF86Forward and XF86Back that are
too confusing for users as these questions indicate
https://stackoverflow.com/questions/21239706/which-keys-are-xf86back-and-xf86forward-in-emacs


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: menu-rearrangement.patch --]
[-- Type: text/x-diff, Size: 8205 bytes --]

diff --git a/lisp/bindings.el b/lisp/bindings.el
index 0be1458798..4c5450f050 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -933,9 +933,11 @@ esc-map
 (define-key ctl-x-map [right] 'next-buffer)
 (define-key ctl-x-map [C-right] 'next-buffer)
 (define-key global-map [XF86Forward] 'next-buffer)
+(put 'next-buffer :advertised-binding [?\C-x right])
 (define-key ctl-x-map [left] 'previous-buffer)
 (define-key ctl-x-map [C-left] 'previous-buffer)
 (define-key global-map [XF86Back] 'previous-buffer)
+(put 'previous-buffer :advertised-binding [?\C-x left])
 
 (let ((map minibuffer-local-map))
   (define-key map "\en"   'next-history-element)
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index b7967b858a..f5dbadce10 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -49,6 +49,36 @@ cua-enable-cua-keys
 ;; It gets modified in place when menu-bar-update-buffers is called.
 (defvar global-buffers-menu-map (make-sparse-keymap "Buffers"))
 
+(defvar menu-bar-print-menu
+  (let ((menu (make-sparse-keymap "Print")))
+    (bindings--define-key menu [ps-print-region]
+      '(menu-item "PostScript Print Region (B+W)" ps-print-region
+                  :enable mark-active
+                  :help "Pretty-print marked region in black and white to PostScript printer"))
+    (bindings--define-key menu [ps-print-buffer]
+      '(menu-item "PostScript Print Buffer (B+W)" ps-print-buffer
+                  :enable (menu-bar-menu-frame-live-and-visible-p)
+                  :help "Pretty-print current buffer in black and white to PostScript printer"))
+    (bindings--define-key menu [ps-print-region-faces]
+      '(menu-item "PostScript Print Region"
+                  ps-print-region-with-faces
+                  :enable mark-active
+                  :help "Pretty-print marked region to PostScript printer"))
+    (bindings--define-key menu [ps-print-buffer-faces]
+      '(menu-item "PostScript Print Buffer"
+                  ps-print-buffer-with-faces
+                  :enable (menu-bar-menu-frame-live-and-visible-p)
+                  :help "Pretty-print current buffer to PostScript printer"))
+    (bindings--define-key menu [print-region]
+      '(menu-item "Print Region" print-region
+                  :enable mark-active
+                  :help "Print region between mark and current position"))
+    (bindings--define-key menu [print-buffer]
+      '(menu-item "Print Buffer" print-buffer
+                  :enable (menu-bar-menu-frame-live-and-visible-p)
+                  :help "Print current buffer with page headings"))
+    menu))
+
 ;; Only declared obsolete (and only made a proper alias) in 23.3.
 (define-obsolete-variable-alias
   'menu-bar-files-menu 'menu-bar-file-menu "22.1")
@@ -63,6 +93,19 @@ menu-bar-file-menu
     (bindings--define-key menu [separator-exit]
       menu-bar-separator)
 
+    (unless (featurep 'ns)
+      (bindings--define-key menu [close-tab]
+        '(menu-item "Close Tab" tab-close
+                    :visible (fboundp 'tab-close)
+                    :help "Close currently selected tab"))
+      (bindings--define-key menu [make-tab]
+        '(menu-item "New Tab" tab-new
+                    :visible (fboundp 'tab-new)
+                    :help "Open a new tab"))
+
+      (bindings--define-key menu [separator-tab]
+        menu-bar-separator))
+
     ;; Don't use delete-frame as event name because that is a special
     ;; event.
     (bindings--define-key menu [delete-this-frame]
@@ -70,6 +113,10 @@ menu-bar-file-menu
                   :visible (fboundp 'delete-frame)
                   :enable (delete-frame-enabled-p)
                   :help "Delete currently selected frame"))
+    (bindings--define-key menu [make-frame-on-monitor]
+      '(menu-item "New Frame on Monitor..." make-frame-on-monitor
+                  :visible (fboundp 'make-frame-on-monitor)
+                  :help "Open a new frame on another monitor"))
     (bindings--define-key menu [make-frame-on-display]
       '(menu-item "New Frame on Display..." make-frame-on-display
                   :visible (fboundp 'make-frame-on-display)
@@ -102,32 +149,8 @@ menu-bar-file-menu
     (bindings--define-key menu [separator-window]
       menu-bar-separator)
 
-    (bindings--define-key menu [ps-print-region]
-      '(menu-item "PostScript Print Region (B+W)" ps-print-region
-                  :enable mark-active
-                  :help "Pretty-print marked region in black and white to PostScript printer"))
-    (bindings--define-key menu [ps-print-buffer]
-      '(menu-item "PostScript Print Buffer (B+W)" ps-print-buffer
-                  :enable (menu-bar-menu-frame-live-and-visible-p)
-                  :help "Pretty-print current buffer in black and white to PostScript printer"))
-    (bindings--define-key menu [ps-print-region-faces]
-      '(menu-item "PostScript Print Region"
-                  ps-print-region-with-faces
-                  :enable mark-active
-                  :help "Pretty-print marked region to PostScript printer"))
-    (bindings--define-key menu [ps-print-buffer-faces]
-      '(menu-item "PostScript Print Buffer"
-                  ps-print-buffer-with-faces
-                  :enable (menu-bar-menu-frame-live-and-visible-p)
-                  :help "Pretty-print current buffer to PostScript printer"))
-    (bindings--define-key menu [print-region]
-      '(menu-item "Print Region" print-region
-                  :enable mark-active
-                  :help "Print region between mark and current position"))
-    (bindings--define-key menu [print-buffer]
-      '(menu-item "Print Buffer" print-buffer
-                  :enable (menu-bar-menu-frame-live-and-visible-p)
-                  :help "Print current buffer with page headings"))
+    (bindings--define-key menu [print]
+      `(menu-item "Print" ,menu-bar-print-menu))
 
     (bindings--define-key menu [separator-print]
       menu-bar-separator)
@@ -1216,6 +1239,12 @@ menu-bar-showhide-menu
                                   (frame-visible-p
                                    (symbol-value 'speedbar-frame))))))
 
+    (bindings--define-key menu [showhide-tab-line-mode]
+      '(menu-item "Window Tab Line" global-tab-line-mode
+                  :help "Turn window-local tab-lines on/off"
+                  :visible (fboundp 'global-tab-line-mode)
+                  :button (:toggle . global-tab-line-mode)))
+
     (bindings--define-key menu [showhide-window-divider]
       `(menu-item "Window Divider" ,menu-bar-showhide-window-divider-menu
                   :visible (memq (window-system) '(x w32))))
@@ -1242,13 +1271,14 @@ menu-bar-showhide-menu
                               (frame-parameter (menu-bar-frame-for-menubar)
                                                'menu-bar-lines)))))
 
-    (bindings--define-key menu [showhide-tab-bar]
-      '(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame
-                  :help "Turn tab bar on/off"
-                  :button
-                  (:toggle . (menu-bar-positive-p
-                              (frame-parameter (menu-bar-frame-for-menubar)
-                                               'tab-bar-lines)))))
+    (unless (featurep 'ns)
+      (bindings--define-key menu [showhide-tab-bar]
+        '(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame
+                    :help "Turn tab bar on/off"
+                    :button
+                    (:toggle . (menu-bar-positive-p
+                                (frame-parameter (menu-bar-frame-for-menubar)
+                                                 'tab-bar-lines))))))
 
     (if (and (boundp 'menu-bar-showhide-tool-bar-menu)
              (keymapp menu-bar-showhide-tool-bar-menu))
@@ -1698,8 +1728,8 @@ menu-bar-tools-menu
     (bindings--define-key menu [compile]
       '(menu-item "Compile..." compile
                   :help "Invoke compiler or Make, view compilation errors"))
-    (bindings--define-key menu [grep]
-      '(menu-item "Search Files (Grep)..." grep
+    (bindings--define-key menu [rgrep]
+      '(menu-item "Search Files (Recursive Grep)..." rgrep
                   :help "Search files for strings or regexps (with Grep)"))
     menu))
 \f

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

end of thread, other threads:[~2020-01-20 23:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-02 21:27 bug#37594: Menu rearrangement Juri Linkov
2019-10-03 17:09 ` Eli Zaretskii
2019-10-03 22:43   ` Juri Linkov
2019-10-04  7:37     ` Eli Zaretskii
2019-11-27 22:36       ` Juri Linkov
2020-01-15  0:04         ` Juri Linkov
2020-01-15 16:14           ` Eli Zaretskii
2020-01-15 23:30             ` Juri Linkov
2020-01-16 14:40               ` Eli Zaretskii
     [not found]                 ` <87h80vdj58.fsf@mail.linkov.net>
2020-01-17  8:20                   ` Eli Zaretskii
2020-01-20  0:15                     ` Juri Linkov
2020-01-20 17:11                       ` Eli Zaretskii
2020-01-20 23:10                         ` Juri Linkov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.