unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 37594@debbugs.gnu.org
Subject: bug#37594: Menu rearrangement
Date: Fri, 04 Oct 2019 01:43:37 +0300	[thread overview]
Message-ID: <874l0ph146.fsf@mail.linkov.net> (raw)
In-Reply-To: <83k19l7o3g.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 03 Oct 2019 20:09:23 +0300")

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

>> 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.
>
> Please move the "Print" part after the New Frame, New Window, etc.

Moved in a new patch.

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

Only to keep the same menu size.

> People are accustomed to see "Grep".  If you think Rgrep
> is so useful as to warrant a menu item, let's add it.

Ok, added in a new patch.

> These changes should be in NEWS.

Added as well:


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

diff --git a/etc/NEWS b/etc/NEWS
index 00a01999a7..39cafb5142 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2094,6 +2094,9 @@ immediately.  Type 'M-x so-long-commentary' for full documentation.
 \f
 * Incompatible Lisp Changes in Emacs 27.1
 
+---
+** Print menu items in the File menu moved to submenu.
+
 ---
 ** Incomplete destructive splicing support has been removed.
 Support for Common Lisp style destructive splicing (",.") was
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index b7967b858a..f0ab5b41d5 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,25 @@ menu-bar-file-menu
     (bindings--define-key menu [separator-exit]
       menu-bar-separator)
 
+    (bindings--define-key menu [print]
+      `(menu-item "Print" ,menu-bar-print-menu))
+
+    (bindings--define-key menu [separator-print]
+      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 +119,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,36 +155,6 @@ 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 [separator-print]
-      menu-bar-separator)
-
     (bindings--define-key menu [recover-session]
       '(menu-item "Recover Crashed Session" recover-session
                   :enable
@@ -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,6 +1728,9 @@ 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 [rgrep]
+      '(menu-item "Recursive Grep..." rgrep
+                  :help "Interactively ask for parameters and search recursively"))
     (bindings--define-key menu [grep]
       '(menu-item "Search Files (Grep)..." grep
                   :help "Search files for strings or regexps (with Grep)"))

  reply	other threads:[~2019-10-03 22:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874l0ph146.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=37594@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).