diff options
| author | Juri Linkov | 2021-10-20 19:50:29 +0300 |
|---|---|---|
| committer | Juri Linkov | 2021-10-20 19:50:29 +0300 |
| commit | 06fe499614dcb3e13ee795b5aa80ebc8687f2fe2 (patch) | |
| tree | 21c8cfebcf182710e2783d3f234dde49fc0f80df | |
| parent | 8358da9c4c9079b93daffc1aebf3ea5e52b98593 (diff) | |
| download | emacs-06fe499614dcb3e13ee795b5aa80ebc8687f2fe2.tar.gz emacs-06fe499614dcb3e13ee795b5aa80ebc8687f2fe2.zip | |
* lisp/tab-bar.el (tab-bar-menu-bar): New command (bug#51247).
(tab-bar-format): Rename option 'tab-bar-format-menu-global' to
'tab-bar-format-menu-bar'.
(tab-bar-format-menu-bar): Rename from 'tab-bar-format-menu-global'.
| -rw-r--r-- | lisp/tab-bar.el | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 03556919b20..a3316bf4496 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -715,7 +715,7 @@ it will display time aligned to the right on the tab bar instead | |||
| 715 | of the mode line. Replacing `tab-bar-format-tabs' with | 715 | of the mode line. Replacing `tab-bar-format-tabs' with |
| 716 | `tab-bar-format-tabs-groups' will group tabs on the tab bar." | 716 | `tab-bar-format-tabs-groups' will group tabs on the tab bar." |
| 717 | :type 'hook | 717 | :type 'hook |
| 718 | :options '(tab-bar-format-menu-global | 718 | :options '(tab-bar-format-menu-bar |
| 719 | tab-bar-format-history | 719 | tab-bar-format-history |
| 720 | tab-bar-format-tabs | 720 | tab-bar-format-tabs |
| 721 | tab-bar-format-tabs-groups | 721 | tab-bar-format-tabs-groups |
| @@ -730,22 +730,23 @@ of the mode line. Replacing `tab-bar-format-tabs' with | |||
| 730 | :group 'tab-bar | 730 | :group 'tab-bar |
| 731 | :version "28.1") | 731 | :version "28.1") |
| 732 | 732 | ||
| 733 | (defun tab-bar-format-menu-global () | 733 | (defun tab-bar-menu-bar (event) |
| 734 | "Produce the Menu button for the tab bar that shows a global menu." | 734 | "Pop up the same menu as displayed by the menu bar. |
| 735 | `((add-tab menu-item (propertize "Menu" 'face 'tab-bar-tab-inactive) | 735 | Used by `tab-bar-format-menu-bar'." |
| 736 | (lambda (event) (interactive "e") | 736 | (interactive "e") |
| 737 | (let ((menu (make-sparse-keymap | 737 | (let ((menu (make-sparse-keymap (propertize "Menu Bar" 'hide t)))) |
| 738 | (propertize "Global Menu" 'hide t)))) | 738 | (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) |
| 739 | 739 | (map-keymap (lambda (key binding) | |
| 740 | (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) | 740 | (when (consp binding) |
| 741 | (map-keymap (lambda (key binding) | 741 | (define-key-after menu (vector key) |
| 742 | (when (consp binding) | 742 | (copy-sequence binding)))) |
| 743 | (define-key-after menu (vector key) | 743 | (menu-bar-keymap)) |
| 744 | (copy-sequence binding)))) | 744 | (popup-menu menu event))) |
| 745 | (lookup-key global-map [menu-bar])) | 745 | |
| 746 | 746 | (defun tab-bar-format-menu-bar () | |
| 747 | (popup-menu menu event))) | 747 | "Produce the Menu button for the tab bar that shows the menu bar." |
| 748 | :help "Global Menu"))) | 748 | `((menu-bar menu-item (propertize "Menu" 'face 'tab-bar-tab-inactive) |
| 749 | tab-bar-menu-bar :help "Menu Bar"))) | ||
| 749 | 750 | ||
| 750 | (defun tab-bar-format-history () | 751 | (defun tab-bar-format-history () |
| 751 | "Produce back and forward buttons for the tab bar. | 752 | "Produce back and forward buttons for the tab bar. |