[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 7515252: * lisp/tab-line.el (tab-line-new-button-show): New def
From: |
Juri Linkov |
Subject: |
emacs-27 7515252: * lisp/tab-line.el (tab-line-new-button-show): New defcustom. |
Date: |
Thu, 19 Mar 2020 19:22:04 -0400 (EDT) |
branch: emacs-27
commit 7515252cce60de91fce19f5efa84d326f0b14ca5
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
* lisp/tab-line.el (tab-line-new-button-show): New defcustom.
* lisp/tab-line.el (tab-line-format-template): Use tab-line-new-button-show.
(tab-line-new-tab-choice): Remove choice 'nil' with "No button".
(tab-line-separator): Add docstring.
---
lisp/tab-line.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 53fa984..eb279de 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -142,11 +142,19 @@
(defcustom tab-line-new-tab-choice t
"Defines what to show in a new tab.
If t, display a selection menu with all available buffers.
-If the value is a function, call it with no arguments.
-If nil, don't show the new tab button."
+If the value is a function, call it with no arguments."
:type '(choice (const :tag "Buffer menu" t)
- (function :tag "Function")
- (const :tag "No button" nil))
+ (function :tag "Function"))
+ :group 'tab-line
+ :version "27.1")
+
+(defcustom tab-line-new-button-show t
+ "If non-nil, show the \"New tab\" button in the tab line."
+ :type 'boolean
+ :initialize 'custom-initialize-default
+ :set (lambda (sym val)
+ (set-default sym val)
+ (force-mode-line-update))
:group 'tab-line
:version "27.1")
@@ -211,7 +219,8 @@ If nil, don't show it at all."
'help-echo "Click to scroll right")
"Button for scrolling horizontally to the right.")
-(defvar tab-line-separator nil)
+(defvar tab-line-separator nil
+ "String that delimits tabs.")
(defcustom tab-line-tab-name-function #'tab-line-tab-name-buffer
@@ -455,7 +464,8 @@ variable `tab-line-tabs-function'."
(if hscroll (nthcdr (truncate hscroll) strings) strings)
(list separator)
(when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
- tab-line-new-tab-choice)
+ tab-line-new-button-show
+ tab-line-new-button)
(list tab-line-new-button)))))
(defvar tab-line-auto-hscroll)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 7515252: * lisp/tab-line.el (tab-line-new-button-show): New defcustom.,
Juri Linkov <=