[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 ecfe633: * lisp/tab-bar.el: Last-minute changes.
From: |
Juri Linkov |
Subject: |
emacs-27 ecfe633: * lisp/tab-bar.el: Last-minute changes. |
Date: |
Thu, 12 Mar 2020 20:11:02 -0400 (EDT) |
branch: emacs-27
commit ecfe633993a12cc1475bb9282178e238e8025a13
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
* lisp/tab-bar.el: Last-minute changes.
* lisp/tab-bar.el (tab-bar-mode): Check for non-nil
tab-bar-new-button and tab-bar-close-button.
(tab-bar-new-button-show): New defcustom.
(tab-bar-make-keymap-1): Check for tab-bar-new-button-show.
(tab-bar-separator): Add docstring.
---
lisp/tab-bar.el | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index fac27f4..e2ea11d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -123,7 +123,8 @@ Possible modifiers are `control', `meta', `shift', `hyper',
`super' and
(assq-delete-all 'tab-bar-lines
default-frame-alist)))))
- (when (and tab-bar-mode (not (get-text-property 0 'display
tab-bar-new-button)))
+ (when (and tab-bar-mode tab-bar-new-button
+ (not (get-text-property 0 'display tab-bar-new-button)))
;; This file is pre-loaded so only here we can use the right
data-directory:
(add-text-properties 0 (length tab-bar-new-button)
`(display (image :type xpm
@@ -132,7 +133,8 @@ Possible modifiers are `control', `meta', `shift', `hyper',
`super' and
:ascent center))
tab-bar-new-button))
- (when (and tab-bar-mode (not (get-text-property 0 'display
tab-bar-close-button)))
+ (when (and tab-bar-mode tab-bar-close-button
+ (not (get-text-property 0 'display tab-bar-close-button)))
;; This file is pre-loaded so only here we can use the right
data-directory:
(add-text-properties 0 (length tab-bar-close-button)
`(display (image :type xpm
@@ -263,6 +265,16 @@ before calling the command that adds a new tab."
:group 'tab-bar
:version "27.1")
+(defcustom tab-bar-new-button-show t
+ "Defines whether to show the new tab button."
+ :type 'boolean
+ :initialize 'custom-initialize-default
+ :set (lambda (sym val)
+ (set-default sym val)
+ (force-mode-line-update))
+ :group 'tab-bar
+ :version "27.1")
+
(defvar tab-bar-new-button " + "
"Button for creating a new tab.")
@@ -306,7 +318,8 @@ This helps to select the tab by its number using
`tab-bar-select-tab'."
:group 'tab-bar
:version "27.1")
-(defvar tab-bar-separator nil)
+(defvar tab-bar-separator nil
+ "String that delimits tabs.")
(defcustom tab-bar-tab-name-function #'tab-bar-tab-name-current
@@ -464,9 +477,9 @@ Return its existing value or a new value."
(interactive)
(tab-bar-close-tab ,i)))))))
tabs)
- (when tab-bar-new-button
- `((sep-add-tab menu-item ,separator ignore)
- (add-tab menu-item ,tab-bar-new-button tab-bar-new-tab
+ `((sep-add-tab menu-item ,separator ignore))
+ (when (and tab-bar-new-button-show tab-bar-new-button)
+ `((add-tab menu-item ,tab-bar-new-button tab-bar-new-tab
:help "New tab"))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 ecfe633: * lisp/tab-bar.el: Last-minute changes.,
Juri Linkov <=