diff options
| author | Juri Linkov | 2020-03-20 01:21:57 +0200 |
|---|---|---|
| committer | Juri Linkov | 2020-03-20 01:21:57 +0200 |
| commit | 7515252cce60de91fce19f5efa84d326f0b14ca5 (patch) | |
| tree | cf8e2b64e0966cba97f0a5dba4602a1d1581b335 | |
| parent | d801d1d8ccae3d8c9ea3d55c27ae16cd28212734 (diff) | |
| download | emacs-7515252cce60de91fce19f5efa84d326f0b14ca5.tar.gz emacs-7515252cce60de91fce19f5efa84d326f0b14ca5.zip | |
* 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.
| -rw-r--r-- | lisp/tab-line.el | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 53fa984caf6..eb279deab4c 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el | |||
| @@ -142,11 +142,19 @@ | |||
| 142 | (defcustom tab-line-new-tab-choice t | 142 | (defcustom tab-line-new-tab-choice t |
| 143 | "Defines what to show in a new tab. | 143 | "Defines what to show in a new tab. |
| 144 | If t, display a selection menu with all available buffers. | 144 | If t, display a selection menu with all available buffers. |
| 145 | If the value is a function, call it with no arguments. | 145 | If the value is a function, call it with no arguments." |
| 146 | If nil, don't show the new tab button." | ||
| 147 | :type '(choice (const :tag "Buffer menu" t) | 146 | :type '(choice (const :tag "Buffer menu" t) |
| 148 | (function :tag "Function") | 147 | (function :tag "Function")) |
| 149 | (const :tag "No button" nil)) | 148 | :group 'tab-line |
| 149 | :version "27.1") | ||
| 150 | |||
| 151 | (defcustom tab-line-new-button-show t | ||
| 152 | "If non-nil, show the \"New tab\" button in the tab line." | ||
| 153 | :type 'boolean | ||
| 154 | :initialize 'custom-initialize-default | ||
| 155 | :set (lambda (sym val) | ||
| 156 | (set-default sym val) | ||
| 157 | (force-mode-line-update)) | ||
| 150 | :group 'tab-line | 158 | :group 'tab-line |
| 151 | :version "27.1") | 159 | :version "27.1") |
| 152 | 160 | ||
| @@ -211,7 +219,8 @@ If nil, don't show it at all." | |||
| 211 | 'help-echo "Click to scroll right") | 219 | 'help-echo "Click to scroll right") |
| 212 | "Button for scrolling horizontally to the right.") | 220 | "Button for scrolling horizontally to the right.") |
| 213 | 221 | ||
| 214 | (defvar tab-line-separator nil) | 222 | (defvar tab-line-separator nil |
| 223 | "String that delimits tabs.") | ||
| 215 | 224 | ||
| 216 | 225 | ||
| 217 | (defcustom tab-line-tab-name-function #'tab-line-tab-name-buffer | 226 | (defcustom tab-line-tab-name-function #'tab-line-tab-name-buffer |
| @@ -455,7 +464,8 @@ variable `tab-line-tabs-function'." | |||
| 455 | (if hscroll (nthcdr (truncate hscroll) strings) strings) | 464 | (if hscroll (nthcdr (truncate hscroll) strings) strings) |
| 456 | (list separator) | 465 | (list separator) |
| 457 | (when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) | 466 | (when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) |
| 458 | tab-line-new-tab-choice) | 467 | tab-line-new-button-show |
| 468 | tab-line-new-button) | ||
| 459 | (list tab-line-new-button))))) | 469 | (list tab-line-new-button))))) |
| 460 | 470 | ||
| 461 | (defvar tab-line-auto-hscroll) | 471 | (defvar tab-line-auto-hscroll) |