1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00
Commit Graph

76 Commits

Author SHA1 Message Date
Juri Linkov
a6df8f9f99 * lisp/tab-line.el (tab-line-format): Use mode-line-window-selected-p.
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).
2022-02-10 20:52:55 +02:00
Juri Linkov
0f38e2393d Use mode-line-window-selected-p in tab-line-tab-name-format-default.
* 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).
2022-02-06 19:58:43 +02:00
Juri Linkov
e94f08b2d9 * lisp/tab-line.el: Support non-buffer tabs in some tab face functions.
(tab-line-tab-face-special, tab-line-tab-face-modified): For non-buffer tabs
when 'tab-line-tabs-function' is e.g. 'tab-line-tabs-buffer-groups',
try to get the buffer from the property 'buffer'.
https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg01923.html
2022-02-01 21:42:51 +02:00
Stefan Monnier
04c0245d36 Merge remote-tracking branch 'origin/emacs-28' into trunk 2022-01-02 17:07:42 -05:00
Juri Linkov
83da3a09d0 * lisp/tab-line.el: Revert part of the fix in a6adfe21e4 (bug#52881)
(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.
2022-01-02 20:00:40 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
78066671c0 Merge from origin/emacs-28
67400da412 Improve doc strings of fringe indicator variables
a6adfe21e4 * lisp/tab-line.el (tab-line--get-tab-property): New funct...
2022-01-01 06:51:58 +01:00
Juri Linkov
a6adfe21e4 * lisp/tab-line.el (tab-line--get-tab-property): New function (bug#52881).
(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.
2021-12-31 11:20:51 +02:00
Juri Linkov
d1c7ce68ba * lisp/tab-line.el (tab-line-tab-name-format-default): Add help-echo.
(bug#52889)
2021-12-30 10:08:37 +02:00
Matt Kramer
11e5c7d8ca Fix tab-line cycling when using buffer groups (bug#52050)
* 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
2021-11-24 21:42:32 +02:00
Juri Linkov
e6df5a32d0 * lisp/tab-line.el (tab-line-mode): Preserve existing value of tab-line-format
Keep the old value of tab-line-format when enabling tab-line-mode
and don't overwrite it with nil when disabling tab-line-mode (bug#51830).
2021-11-14 20:35:42 +02:00
Juri Linkov
a191d3c725 Add new and fix existing docstrings in tab-bar.el and tab-line.el (bug#51247)
* lisp/tab-bar.el (tab-bar--key-to-number)
(tab-bar--event-to-item, tab-bar--format-tab)
(tab-bar--format-tab-group, tab-bar--tab, tab-bar--current-tab)
(tab-bar--current-tab-make): Add/fix docstrings.
2021-10-17 20:09:29 +03:00
Eli Zaretskii
ed9f5546aa Improve doc strings in tab-line.el
* lisp/tab-line.el (tab-line-tab-name-function)
(tab-line-tab-name-truncated-buffer, tab-line-tabs-mode-buffers)
(tab-line-tabs-buffer-group-function)
(tab-line-tabs-buffer-group-sort-function)
(tab-line-tabs-buffer-groups, tab-line-tab-name-format-function)
(tab-line-tab-name-format-default, tab-line-format-template)
(tab-line-tab-face-inactive-alternating)
(tab-line-tab-face-special, tab-line-tab-face-modified)
(tab-line-format, tab-line-auto-hscroll, tab-line-hscroll-right)
(tab-line-hscroll-left, tab-line-new-tab, tab-line-select-tab)
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab)
(tab-line-close-tab-function, tab-line-close-tab)
(tab-line-tab-context-menu, tab-line-context-menu)
(tab-line-mode, tab-line-exclude-modes, tab-line-mode--turn-on):
Add or fix doc strings.
2021-10-17 12:49:04 +03:00
Juri Linkov
47e09d1855 Copy parent face attributes to tab-line-tab-current instead of inheriting face
* 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).
2021-10-11 21:27:50 +03:00
Juri Linkov
931a7276c0 * lisp/tab-line.el (tab-line-format): Add face-modified to the cache key.
When tab-line-tab-face-functions contains tab-line-tab-face-modified,
add 'buffer-modified-p' status to the cache-key, so the cache will expire
when the buffer modification status will change.
https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00129.html
2021-10-03 20:13:29 +03:00
Adam Porter
fcca1db9fd * lisp/tab-line.el: Add modified-buffer face
(tab-line-tab-modified): New face.
(tab-line-tab-face-modified): New function.
(tab-line-tab-face-functions): Use new function.

* etc/NEWS: Update.
2021-09-25 22:18:11 +03:00
Juri Linkov
3d1f51382f * lisp/tab-line.el: Add context menu bound to down-mouse-3 like on tab bar.
* lisp/tab-line.el: Bind tab-line down-mouse-3 to tab-line-context-menu.
(tab-line-tab-map): Rebind tab-line-select-tab from mouse-1 to down-mouse-1.
Bind down-mouse-3 to tab-line-tab-context-menu.
(tab-line-add-map): Rebind tab-line-new-tab from mouse-1 to down-mouse-1.
(tab-line-left-map, tab-line-right-map): Rebind mouse-1 to down-mouse-1.
(tab-line-tab-context-menu, tab-line-context-menu): New functions.
(tab-line-hscroll-right, tab-line-hscroll-left)
(tab-line-new-tab, tab-line-select-tab)
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab)
(tab-line-close-tab): Rename event args to 'event'.
2021-09-15 19:09:33 +03:00
Juri Linkov
274e71f5cc Don't turn mouse-1 into mouse-2 when clicking on the tab-line (bug#49247)
* lisp/tab-line.el (tab-line-tab-name-format-default): For 'tab-line-tab-map'
add the property 'follow-link' with the value 'ignore'.
2021-07-08 20:51:15 +03:00
Juri Linkov
3cd3f230c9 * lisp/tab-line.el: Face cleanup. 2021-03-17 19:42:48 +02:00
Gabriel do Nascimento Ribeiro
0a60e5d33c * lisp/tab-line.el: Update docstring of 'tab-line-tabs-function' (bug#47117)
(tab-line-tabs-function): Mention 'tab-line-tabs-buffer-groups'
in the docstring.
(tab-line-tabs-buffer-groups): Add docstring.
2021-03-14 11:11:12 +02:00
Gabriel do Nascimento Ribeiro
0bfa9e7860 * lisp/tab-line.el: Add face for group-tab (bug#47118)
(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.
2021-03-14 11:10:20 +02:00
Juri Linkov
29c0b640ba * lisp/tab-line.el (tab-line-tab-name-format-function): New defcustom.
(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.
2021-02-23 21:01:31 +02:00
Stefan Kangas
e0fc879c0c Prefer defvar-local in remaining libraries
* lisp/align.el (align-mode-rules-list)
(align-mode-exclude-rules-list):
* lisp/bookmark.el (bookmark-current-bookmark)
(bookmark-annotation-name)
(bookmark--annotation-from-bookmark-list):
* lisp/calc/calc-embed.el (calc-embedded-all-active)
(calc-embedded-some-active):
* lisp/comint.el (comint-password-function):
* lisp/completion.el (completion-syntax-table):
* lisp/dframe.el (dframe-track-mouse-function)
(dframe-help-echo-function, dframe-mouse-click-function)
(dframe-mouse-position-function, dframe-timer)
(dframe-attached-frame, dframe-controlled):
* lisp/ehelp.el (electric-help-orig-major-mode):
* lisp/eshell/esh-util.el (eshell-path-env):
* lisp/expand.el (expand-pos, expand-index, expand-point):
* lisp/face-remap.el (text-scale-mode-remapping)
(text-scale-mode-lighter, text-scale-mode-amount)
(text-scale-remap-header-line, buffer-face-mode-remapping):
* lisp/ffap.el (ffap-menu-alist):
* lisp/files-x.el (connection-local-variables-alist):
* lisp/foldout.el (foldout-fold-list, foldout-mode-line-string):
* lisp/follow.el (follow-start-end-invalid):
* lisp/forms.el (forms--mode-setup):
* lisp/gnus/message.el (message-cross-post-old-target)
(message-options):
* lisp/help-mode.el (help-xref-stack, help-xref-forward-stack)
(help-xref-stack-item, help-xref-stack-forward-item):
* lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay):
* lisp/hilit-chg.el (hilit-chg-string):
* lisp/ido.el (ido-eoinput):
* lisp/imenu.el (imenu-generic-expression)
(imenu-create-index-function, imenu-default-goto-function)
(imenu-prev-index-position-function)
(imenu-extract-index-name-function, imenu-name-lookup-function)
(imenu-syntax-alist, imenu-case-fold-search):
* lisp/jka-compr.el (jka-compr-really-do-compress):
* lisp/language/ethio-util.el (ethio-prefer-ascii-space):
* lisp/leim/quail/hangul.el (hangul-input-method-help-text):
* lisp/leim/quail/japanese.el (quail-japanese-package-saved):
* lisp/linum.el (linum-overlays, linum-available):
* lisp/man.el (Man-original-frame, Man-arguments, Man--sections)
(Man--refpages, Man-page-list, Man-current-page)
(Man-page-mode-string):
* lisp/pcomplete.el (pcomplete-current-completions)
(pcomplete-last-completion-length)
(pcomplete-last-completion-stub, pcomplete-last-completion-raw)
(pcomplete-last-window-config, pcomplete-window-restore-timer):
* lisp/reveal.el (reveal-open-spots, reveal-last-tick):
* lisp/ruler-mode.el (ruler-mode):
* lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save):
* lisp/server.el (server-buffer-clients, server-existing-buffer):
* lisp/tab-line.el (tab-line-exclude):
* lisp/tar-mode.el (tar-data-buffer, tar-data-swapped):
* lisp/thumbs.el (thumbs-current-tmp-filename)
(thumbs-current-image-filename, thumbs-extra-images)
(thumbs-image-num, thumbs-buffer, thumbs-marked-list):
* lisp/tutorial.el (tutorial--point-before-chkeys)
(tutorial--point-after-chkeys, tutorial--lang):
* lisp/url/url-vars.el (url-current-object)
(url-current-mime-headers, url-current-lastloc):
* lisp/view.el (view-mode, view-old-buffer-read-only)
(view-old-Helper-return-blurb, view-page-size)
(view-half-page-size, view-last-regexp, view-return-to-alist)
(view-exit-action, view-overlay):
* lisp/wid-edit.el (widget-global-map, widget-field-new)
(widget-field-list, widget-field-last, widget-field-was):
* lisp/woman.el (woman-imenu-done): Prefer defvar-local.
2021-02-02 09:57:07 +01:00
Jared Finder
0e2e1caa0b * lisp/tab-line.el (tab-line-new-tab): Use tty menus when supported. 2021-01-30 11:31:47 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Adam Porter
33210c8dc0 * lisp/tab-line.el: New options, faces, and functions
* 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.
2020-12-23 23:05:55 +02:00
Juri Linkov
5ec21155c3 Use '…' for ellipsis in truncate-string-to-width by default (bug#41250)
* 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.
2020-10-04 22:41:36 +03:00
Eli Zaretskii
cc24931b2f ; * lisp/tab-line.el (tab-line-switch-cycling): Fix last change. 2020-09-13 18:27:44 +03:00
Kiso Katsuyuki
2605eb9d0e Clarify when tab-line-switch-cycling is used
* lisp/tab-line.el (tab-line-switch-cycling): Clarify when the
variable is used.
Copyright-paperwork-exempt: yes
2020-09-13 15:23:25 +02:00
Basil L. Contovounesios
d08568e6e9 ; Silence byte-compilation warning in last change
* lisp/tab-line.el (tab-line-switch-cycling): Move definition before
first use.
2020-09-10 00:20:24 +01:00
Basil L. Contovounesios
60cb56e999 ; Fix typo in last change 2020-09-10 00:15:09 +01:00
Kiso Katsuyuki
5d43609095 Introduce a new variable tab-line-switch-cycling
If it is set t, enable cycling tab switch.  Default is nil.

Copyright-paperwork-exempt: yes
2020-09-09 22:24:06 +03:00
Kiso Katsuyuki
c3f986a455 Suppress errors of tab-line-switch functions
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
2020-09-09 22:24:06 +03:00
Daniel Martín
438cdc3328 Add support for horizontal scrolling in tab-line
* 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
2020-09-07 17:10:30 +02:00
Juri Linkov
6eb18a950d Move tab-bar and tab-line faces to faces.el (part of bug#41200)
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'.
2020-06-08 03:21:42 +03:00
Juri Linkov
f0e1bf56f0 Fix bugs in tab-bar and tab-line and mention remaining features in manual.
* doc/emacs/frames.texi (Tab Bars): Mention tab-bar-new-tab-to,
tab-bar-close-last-tab-choice, tab-bar-close-tab-select, tab-undo,
tab-select, tab-bar-history-mode.

* doc/emacs/windows.texi (Tab Line): Mention tab-line-tabs-function.

* lisp/tab-bar.el (tab-bar-select-tab-modifiers): Mention
tab-bar-tab-hints in docstring.
(tab-bar-tab-hints): Mention tab-bar-select-tab-modifiers
in docstring.
(tab-bar-select-tab): Mention tab-bar-select-tab-modifiers
in docstring.
(tab-bar-switch-to-tab): Expand the docstring.
(tab-bar-new-tab-to): Fix bug in handling 'left' value.
(tab-bar-close-tab): Fix bug in handling 'left' value.
(tab-bar-undo-close-tab): Use funcall tab-bar-tabs-function
instead of direct call to tab-bar-tabs.
(tab-bar-history-back, tab-bar-history-forward): Add docstrings.
(tab-bar-history-mode): Expand docstring.

* lisp/tab-line.el (tab-line-format): Fix bug for handling window
switching that should set face 'tab-line-tab-current'.
2020-04-27 01:28:36 +03:00
Juri Linkov
7515252cce * 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.
2020-03-20 01:21:57 +02:00
Juri Linkov
a2dd8c4234 * lisp/tab-line.el: Fix tab-line-format and tab-line-format-template.
* 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.
2020-03-17 01:11:27 +02:00
Juri Linkov
6b48aedb6b * lisp/tab-line.el: Fix auto-hscrolling (bug#39649)
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'.
2020-02-29 23:49:17 +02:00
Juri Linkov
ef5fba9f40 Fix faces tab-bar and tab-line.
* lisp/tab-bar.el (tab-bar) <defface>:
* lisp/tab-line.el (tab-line) <defface>:
Check for min-colors 88 instead of type x.
2020-02-05 01:27:30 +02:00
Juri Linkov
92f080dda8 Tab-bar related finishing touches.
* 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.
2020-01-23 01:23:17 +02:00
Juri Linkov
3ba0db41e3 Allow optional truncation of tab names in tab-bar and tab-line (bug#38693)
* 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.
2020-01-21 01:03:37 +02:00
Juri Linkov
92f30d62c0 * lisp/tab-line.el (tab-line-auto-hscroll): Fix for long tab names.
Check for nil value returned by previous-single-property-change that
happens when tab name is longer than window width.
2020-01-20 02:35:53 +02:00
Juri Linkov
d47b157969 Handle tab-bar clicks on a GPM-capable console.
* 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.
2020-01-13 01:23:12 +02:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Juri Linkov
1d52883047 * lisp/tab-line.el (tab-line-auto-hscroll): Improve.
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*".
2019-12-16 01:14:02 +02:00
Juri Linkov
fe7ae74c0b * lisp/tab-line.el (tab-line-format): Use composite cache key (bug#38522) 2019-12-09 00:08:53 +02:00
Juri Linkov
bd95d66ae9 * lisp/tab-line.el: Cache the tab-line-format template.
(tab-line-format): Cache the result of tab-line-format-template in window.
(tab-line-format-template): New function that returns the value to cache.
2019-12-05 01:08:24 +02:00
Juri Linkov
dfbbbf319e * lisp/tab-line.el (tab-line-auto-hscroll): Don't let-bind buffer-local values
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.
2019-11-30 23:42:37 +02:00