From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#37594: Menu rearrangement Date: Thu, 03 Oct 2019 00:27:37 +0300 Organization: LINKOV.NET Message-ID: <87a7aidbqe.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="73357"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: 37594@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 03 00:36:02 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFnE2-000ItN-EW for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Oct 2019 00:36:02 +0200 Original-Received: from localhost ([::1]:59626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFnE0-0003Wb-9o for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Oct 2019 18:36:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45096) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFnAD-0000em-HL for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:32:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFnAB-0002ta-LO for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:32:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFnAB-0002tP-Hq for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:32:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFnAB-0004VT-Cd for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:32:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Oct 2019 22:32:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.157005552217287 (code B ref -1); Wed, 02 Oct 2019 22:32:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Oct 2019 22:32:02 +0000 Original-Received: from localhost ([127.0.0.1]:38487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFnA8-0004SP-4s for submit@debbugs.gnu.org; Wed, 02 Oct 2019 18:32:00 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFnA6-0004Qt-92 for submit@debbugs.gnu.org; Wed, 02 Oct 2019 18:31:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45030) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFnA3-0000Si-44 for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:31:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFnA0-0002og-Hv for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:31:54 -0400 Original-Received: from butterfly.birch.relay.mailchannels.net ([23.83.209.27]:12250) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFnA0-0002nc-2C for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 18:31:52 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 146DC6A18E9 for ; Wed, 2 Oct 2019 22:31:50 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a65.g.dreamhost.com (100-96-91-70.trex.outbound.svc.cluster.local [100.96.91.70]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 793016A1C00 for ; Wed, 2 Oct 2019 22:31:49 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a65.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Wed, 02 Oct 2019 22:31:50 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Thoughtful-Bitter: 0b00dd496dc138ac_1570055509954_2434469256 X-MC-Loop-Signature: 1570055509954:653605353 X-MC-Ingress-Time: 1570055509954 Original-Received: from pdx1-sub0-mail-a65.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTP id 32BA985869 for ; Wed, 2 Oct 2019 15:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=kznJ+TyXb+L+MSWMUODmfeX28GE=; b=TTb6hzZ6z84wMwdPU e9P0VtxgaQ4nM7yqjYdMwPGwV/H7y/GwW4jZZPW7iUF5KjZm47kcs0ULzQq6XaZq OdDSKyK5oLqFyliyuejZT07a85VSntBnsaGkBXjVomGOh+AGUJ4eVNL7J/HvBYHe S6HJJAEoBcDyEz0fLUdkM5IecI= Original-Received: from mail.jurta.org (m91-129-99-99.cust.tele2.ee [91.129.99.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTPSA id 2AFBA85851 for ; Wed, 2 Oct 2019 15:31:42 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a65 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrgeejgddtlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepshhtrggtkhhovhgvrhhflhhofidrtghomhenucfkphepledurdduvdelrdelledrleelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleelrdelledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168180 Archived-At: --=-=-= Content-Type: text/plain 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 and C-x 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=menu-rearrangement.patch 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)) --=-=-=--