Recently 'mode-line-window-selected-p' was added to
'tab-line-tab-name-format-default'. Now add the same to another
place that handles the face 'tab-line-tab-current' (bug#53629).
* lisp/tab-line.el (tab-line-tab-name-format-default):
Use the recently added function 'mode-line-window-selected-p'
for the face 'tab-line-tab-current' (bug#53629).
(tab-line--get-tab-property, tab-line-auto-hscroll): Use get-pos-property
instead of get-text-property that fails after previous-single-property-change.
(tab-line-auto-hscroll): Use ‘tab-line--get-tab-property’ instead of
‘get-pos-property 1’, and ‘get-text-property’ instead of
‘get-pos-property’.
(tab-line-select-tab, tab-line-close-tab): Use tab-line--get-tab-property.
* lisp/tab-line.el (tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Remove tabs that aren't associated with a buffer, such as the `group-tab' that
exists when `tab-line-tabs-function' is `tab-line-tabs-buffer-groups'.
Copyright-paperwork-exempt: yes
* lisp/tab-line.el (tab-line-tab-current): Don't inherit face from
'tab-line-tab' to not inherit the face attribute :height from 'tab-line',
because :height of mouse-face is added to the base face.
Copy here most of the parent face attributes (bug#50798).
(tab-line-tab-face-functions): Add choice for 'tab-line-tab-face-group'.
(tab-line-tab-group): New face.
(tab-line-tabs-buffer-groups): Set alist key 'group-tab' for group tabs.
(tab-line-tab-face-group): New function to set face for group tabs.
(tab-line-tab-name-format-default): New function as the default value.
(tab-line-format-template): Funcall tab-line-tab-name-format-function.
This is like recently added tab-bar-tab-name-format-function.
* lisp/tab-line.el:
(tab-line-tab-face-functions): New option.
(tab-line-tab-inactive-alternate): New face.
(tab-line-tab-special): New face.
(tab-line-tab-face-inactive-alternating): New function.
(tab-line-tab-face-special): New function.
(tab-line-format-template): Use them.
* etc/NEWS: Update.
With thanks to Juri Linkov and Eli Zaretskii for their guidance.
* lisp/international/mule-util.el (truncate-string-ellipsis):
Change the default value to nil.
(truncate-string-ellipsis): New function.
(truncate-string-to-width): Use the value returned from the
function 'truncate-string-ellipsis'.
* lisp/tab-bar.el (tab-bar-tab-name-truncated):
* lisp/tab-line.el (tab-line-tab-name-ellipsis):
Take advantage of the improvement of the ellipsis default value
in truncate-string-to-width and truncate-string-ellipsis.
* doc/lispref/display.texi (Size of Displayed Text):
Improve description of truncate-string-ellipsis.
Traget errors occurs when tab-line-switch-to-prev-tab or
tab-line-switch-to-next-tab is invoked in a buffer which is not in
tabs
Copyright-paperwork-exempt: yes
* lisp/tab-line.el ([tab-line wheel-left]): Bind left and right tab
line scrolling to the 'wheel-left' and 'wheel-right' mouse events.
([tab-line S-wheel-right]): Analogous change for the functions that
switch tabs.
* etc/NEWS: Announce the new feature (bug#43224).
Copyright-paperwork-exempt: yes
These are basic faces, so they need to be defined in
faces.el, otherwise (get 'tab-line 'face) returns 0.
* lisp/faces.el (tab-bar, tab-line): Move faces here
from tab-bar.el and tab-line.el.
* lisp/tab-bar.el (tab-bar): Move face to faces.el.
(tab-bar-faces): Add '((tab-bar custom-face))
to the second arg MEMBERS of 'defgroup'.
* lisp/tab-line.el (tab-line): Move face to faces.el.
(tab-line-faces): Add '((tab-line custom-face))
to the second arg MEMBERS of 'defgroup'.
* 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 (tab-line-format): Use buffer-name in the cache key
instead of just buffer object to invalidate the cache on buffer renaming.
(tab-line-format-template): Always leave the separator after the last tab
like tab-bar.el already does.
Distinguish offsets between manual-vs-automatic scrolling
as integers-vs-floats instead of positive-vs-negative integers.
* lisp/tab-line.el (tab-line-format-template): Use 'numberp'
instead of 'integerp', and 'truncate' instead of 'abs'.
(tab-line-format): When the window-buffer was updated, set window-parameter
to float to enable auto-hscroll after it was disabled on manual scrolling.
(tab-line-auto-hscroll-buffer): New variable with internal buffer.
(tab-line-auto-hscroll): Erase in tab-line-auto-hscroll-buffer.
Use 'numberp' instead of 'integerp', 'truncate' instead of 'abs',
and 'float' instead of '-'.
(tab-line-hscroll): Use 'numberp' instead of 'integerp',
and 'truncate' instead of 'abs'.
* lisp/tab-bar.el (tab-bar-tab-name-ellipsis): Use shorter name
instead of tab-bar-tab-name-truncated-ellipsis.
(tab-bar-new-tab-to) <defcustom>: Add 'function' option.
(tab-bar-new-tab-to) <function>: Use it.
* lisp/tab-line.el (tab-line-close-tab): Add missing arg 'tab' to
tab-line-close-tab-function funcall.
* lisp/tab-line.el (tab-line-tab-name-truncated-max): New defcustom.
(tab-line-tab-name-truncated-buffer): Use tab-line-tab-name-truncated-max
consistently with similar options in tab-bar.el.
(tab-line-tabs-limit): Remove variable.
(tab-line-tabs-window-buffers): Remove use of tab-line-tabs-limit
that was an experimental feature before horizontal scrolling was implemented.
(tab-line-close-tab-function): Rename from tab-line-close-tab-action
and allow a customizaed function as option.
(tab-line-close-tab): Call function if tab-line-close-tab-function
is customized to a function.
* lisp/tab-bar.el (tab-bar-tab-name-function): Add option
tab-bar-tab-name-truncated.
(tab-bar-tab-name-truncated-max): New defcustom.
(tab-bar-tab-name-truncated-ellipsis): New variable.
(tab-bar-tab-name-truncated): New function.
* src/term.c (handle_one_term_event): Call tty_handle_tab_bar_click.
* src/xdisp.c (tty_handle_tab_bar_click): Force reset of up_modifier bit
from the event modifiers.
* lisp/tab-line.el (tab-line-tab-current): No need to use inverse-video
on console/xterm because the selected tab already uses inverse-video.
Better handling of tabs scrolled to the left.
Don't scroll tabs that are already visible.
Remove setq of buffer-undo-list because undo is disabled
anyway in internal buffers with name " *temp*".
Use setq to set buffer-local values of truncate-lines and buffer-undo-list.
This will prevent leaking of let-bound values to buffer-local values
of the minibuffer.