1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

134 Commits

Author SHA1 Message Date
Eli Zaretskii
61562c78dd ; * lisp/tab-bar.el (toggle-frame-tab-bar, tab-bar-new-tab-to): Doc fix. 2021-09-06 13:13:22 +03:00
Juri Linkov
0da97a4ed9 * lisp/tab-bar.el (tab-bar-new-button-show): Make variable obsolete. 2021-08-15 19:15:42 +03:00
Juri Linkov
a93d164ff3 * lisp/tab-bar.el (tab-bar-history-buttons-show): Remove defcustom.
(tab-bar-format-history): Don't use this recently added variable
because now it's possible to customize the option 'tab-bar-format'
to remove 'tab-bar-format-history' from it that gives the same result.
2021-08-13 10:30:20 +03:00
Juri Linkov
09c3620253 Adjust tab-bar to the new mode-line-misc-info value (bug#49806)
* lisp/tab-bar.el (tab-bar--define-keys): Adjust to the new
default value for `mode-line-misc-info'.
2021-08-03 01:08:23 +03:00
Juri Linkov
30bd6a50aa * lisp/tab-bar.el (tab-bar-format-global): Use string-trim-right (bug#30056). 2021-07-27 23:55:32 +03:00
Lars Ingebrigtsen
8b808be2fb Adjust tab-bar to the new mode-line-misc-info value
* lisp/tab-bar.el (tab-bar--define-keys): Adjust to the new
default value for `mode-line-misc-info'.
2021-07-24 13:53:46 +02:00
Juri Linkov
8b49e99504 * lisp/tab-bar.el (tab-bar--define-keys): Fix global-mode-string (bug#49215) 2021-06-25 12:38:27 +03:00
Juri Linkov
c049c8da58 * lisp/tab-bar.el: Add repeat-map keymaps.
* lisp/tab-bar.el (tab-bar-switch-repeat-map): New keymap used for
'tab-next' and 'tab-previous'.
(tab-bar-move-repeat-map): New keymap used for 'tab-move'.
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg01103.html
2021-04-06 00:18:59 +03:00
Juri Linkov
3bacf74adb * lisp/tab-bar.el (tab-bar-tab-post-change-group-functions): New hook.
(tab-bar-change-tab-group): Run it.
(tab-bar-move-tab-to-group): New command for new hook.
2021-03-24 22:14:52 +02:00
Juri Linkov
8c589c2583 * lisp/tab-bar.el (tab-bar-new-tab-group): Set default to t.
(tab-bar-tabs, tab-bar-select-tab, tab-bar-new-tab-to):
Use tab-bar--current-tab-make instead of tab-bar--current-tab.
(tab-bar--tab): Add arg 'frame' to tab-bar--current-tab-find.
(tab-bar--current-tab, tab-bar--current-tab-make): Move most of body
from the former to the latter, thus reverting tab-bar--current-tab
to its previous behavior.
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00959.html
2021-03-22 20:55:49 +02:00
Juri Linkov
0441e605a1 * lisp/tab-bar.el: New faces and face options.
* lisp/tab-bar.el (tab-bar-tab-group-current)
(tab-bar-tab-group-inactive, tab-bar-tab-ungrouped): New deffaces.
(tab-bar-tab-face-function): New defcustom.
(tab-bar-tab-face-default): New function.
(tab-bar-tab-name-format-default): Use it.
(tab-bar-tab-group-format-default): Use tab-bar-tab-group-inactive face.
(tab-bar-tab-group-face-function): New defcustom.
(tab-bar-tab-group-face-default): New function.
(tab-bar--format-tab-group): Add new arg 'current-p'.
(tab-bar-format-tabs-groups): Prepend current group name before first tab.
Override tab-bar-tab-face-function with tab-bar-tab-group-face-function.
2021-03-17 19:42:27 +02:00
Juri Linkov
6199cdc78b * lisp/tab-bar.el (tab-bar-select-tab): Support negative arg. 2021-03-16 19:54:54 +02:00
Juri Linkov
126ea102a5 * lisp/tab-bar.el: Simplify internal functions.
* lisp/tab-bar.el (tab-bar-tabs-set): New function.
(tab-bar-tabs): Use tab-bar--current-tab-find and tab-bar-tabs-set.
(tab-bar--tab): Use tab-bar--current-tab-find.
(tab-bar--current-tab): Remove unused line (assq 'current-tab ...)
because there is no current-tab when it's called.  Remove unused arg 'frame'.
(tab-bar--current-tab-find): Simplify.
(tab-bar-move-tab-to, tab-bar-move-tab-to-frame)
(tab-bar-new-tab-to, tab-bar-close-tab)
(tab-bar-close-other-tabs, tab-bar-undo-close-tab)
(tab-switcher-delete-from-list): Use tab-bar-tabs-set
instead of set-frame-parameter.
(tab-bar-close-group-tabs): Simplify using tab-bar--current-tab-find
without arg.
2021-03-16 19:53:27 +02:00
Juri Linkov
c4549d3b37 * lisp/tab-bar.el (tab-bar-new-tab-group): New defcustom.
(tab-bar--current-tab, tab-bar-new-tab-to, tab-bar-duplicate-tab): Use it.
2021-03-15 19:21:53 +02:00
Juri Linkov
3a252ba6fd * lisp/tab-bar.el (tab-bar-tab-group-format-function): New defcustom.
(tab-bar-tab-group-default): New function.
(tab-bar-tab-group-format-default, tab-bar-format-tabs-groups)
(tab-bar-change-tab-group, tab-bar-close-group-tabs): Use it.
2021-03-15 19:20:06 +02:00
Juri Linkov
f9b737fb9d * lisp/tab-bar.el: Tab groups can be displayed with tab-bar-format-tabs-groups
* lisp/tab-bar.el (tab-bar-format): Turn defvar into defcustom.
Add :options and force-mode-line-update in :set.
(tab-bar--format-tab): New function refactored from tab-bar-format-tabs.
(tab-bar-format-tabs): Move most of code to tab-bar--format-tab and call it.
(tab-bar-tab-group-format-function): New defcustom.
(tab-bar-tab-group-format-default): New function.
(tab-bar--format-tab-group, tab-bar-format-tabs-groups): New functions.
(tab-bar-format-align-right, tab-bar-format-global): Shorten id.
(tab-bar-change-tab-group): Add refs to tab-bar-format in docstring.
2021-03-14 11:29:31 +02:00
Juri Linkov
8ad221cdf4 * lisp/tab-bar.el (tab-bar--current-tab-find): New function.
(tab-bar-close-other-tabs, tab-bar-close-group-tabs): Use it.
(tab-bar--history-pre-change): Rename from
'tab-bar-history--pre-change' to follow naming convention.
(tab-bar-history-mode): Use renamed 'tab-bar--history-pre-change'.
2021-03-11 21:05:12 +02:00
Juri Linkov
d07ed6dfee * lisp/tab-bar.el (tab-bar-close-group-tabs): New command.
(tab-close-group): New alias.
(tab-bar-close-other-tabs): Rewrite to fix old bug where regardless of
the returned value from tab-bar-tab-prevent-close-functions,
only one tab was retained.
2021-03-10 20:09:23 +02:00
Juri Linkov
5fa2775c0c * lisp/tab-bar.el: 'C-x t G' (tab-group) assigns a group name to the tab.
* lisp/tab-bar.el (tab-bar--tab, tab-bar--current-tab): Add tab group if any.
(tab-bar-change-tab-group): New command.
(display-buffer-in-new-tab): Handle tab-group alist entry.
(tab-group): New alias.
(tab-prefix-map): Bind "G" to 'tab-group'.
2021-03-10 19:57:48 +02:00
Juri Linkov
29458ec7d2 * lisp/tab-bar.el (tab-bar-select-tab): Set window-state-put WINDOW arg to nil
WINDOW arg nil will always create a new window regardless of the value
returned by 'frame-root-window' that is nondeterministic - it returns
an internal window when there are more than 1 window on the frame/tab,
otherwise it returns a live window that was reused between different tabs
(bug#46904)
(tab-prefix-map): Bind "u" to 'tab-undo'.
2021-03-09 19:27:31 +02:00
Juri Linkov
aa14398aa1 * lisp/tab-bar.el: Minor stylistic fixes.
(tab-bar-select-tab-modifiers): Use tab-bar--undefine-keys and
tab-bar--define-keys instead of turning tab-bar-mode on/off.
2021-03-02 21:50:49 +02:00
Juri Linkov
6268c9ba6e * lisp/tab-bar.el (tab-bar--define-keys): Add check for tab-bar-format-global. 2021-03-01 21:58:43 +02:00
Juri Linkov
3b3b16ea17 * lisp/tab-bar.el: Support displaying global-mode-string in the tab bar.
* lisp/tab-bar.el (tab-bar--define-keys): Update global-mode-string
in mode-line-misc-info with condition to disable global-mode-string
in the mode line.
(tab-bar-format): New variable.
(tab-bar-format-history, tab-bar-format-add-tab)
(tab-bar-format-tabs): New functions with body from
'tab-bar-make-keymap-1'.
(tab-bar-format-align-right, tab-bar-format-global): New functions for
'tab-bar-format' list.
(tab-bar-format-list): New utility function.
(tab-bar-make-keymap-1): Just call 'tab-bar-format-list'.
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01210.html
2021-02-27 22:09:33 +02:00
Juri Linkov
65f458ba5e * lisp/tab-bar.el: Move aliases down closer to keybindings. 2021-02-24 20:53:25 +02:00
Juri Linkov
24be523fde * lisp/tab-bar.el (tab-switch): New defalias to 'tab-bar-switch-to-tab'.
(tab-prefix-map): Bind "O" to 'tab-previous'.
2021-02-24 20:53:25 +02:00
Juri Linkov
0b9fda1fd9 * lisp/tab-bar.el (tab-prefix-map): Bind "n" to 'tab-duplicate'.
(tab-bar-separator): New function.
(tab-bar-make-keymap-1): Use it.
2021-02-23 20:57:31 +02:00
Juri Linkov
8933cf86a1 * lisp/tab-bar.el: 'C-x t N' bound to tab-new-to supports a negative argument
* lisp/tab-bar.el (tab-bar-new-tab-to): Negative TO-INDEX counts
tabs from the end of the tab bar.
(tab-bar-new-tab): Fix docstring to add reference to
'tab-bar-new-tab-to'.
(tab-prefix-map): Bind "N" to tab-new-to.
2021-02-22 19:12:43 +02:00
Juri Linkov
6e90768143 * lisp/tab-bar.el: 'C-x t M' bound to tab-move-to supports a negative argument
* lisp/tab-bar.el (tab-bar-move-tab-to): Negative TO-INDEX counts
tabs from the end of the tab bar.
(tab-bar-move-tab): Fix docstring to add reference to tab-bar-move-tab-to.
(tab-prefix-map): Bind "M" to tab-move-to.
2021-02-22 19:08:16 +02:00
Juri Linkov
ffdb91c6b3 'Mod-9' bound to 'tab-last' now switches to the last tab like in web browsers
* lisp/tab-bar.el (tab-bar--define-keys): Rebind 0 from
tab-bar-switch-to-recent-tab to its alias tab-recent.
Bind 9 to tab-last.
(tab-bar-switch-to-last-tab): New command.
(tab-last): New alias to tab-bar-switch-to-last-tab.
(tab-bar-switch-to-tab, tab-bar-undo-close-tab): Fix docstrings to
avoid mentioning the term "last" for "most recently used" meaning.
2021-02-22 19:03:42 +02:00
Juri Linkov
2601aa9105 * lisp/tab-bar.el (tab-bar--undefine-keys): New function from tab-bar-mode. 2021-02-22 18:56:47 +02:00
Juri Linkov
734396aa04 New command 'tab-duplicate' like in web browsers 2021-02-17 19:56:45 +02:00
Bastian Beranek
12b80948fd * lisp/tab-bar.el: Fix behavior of toggle-frame-tab-bar (bug #46299)
(toggle-frame-tab-bar): Add frame parameter to protect tab bar state.
(tab-bar--update-tab-bar-lines): Check parameter.
2021-02-16 19:27:32 +02:00
Bastian Beranek
27eaf37241 Fix showing and hiding of tab-bar on new frames (bug#46299)
* lisp/tab-bar.el (tab-bar--update-tab-bar-lines)
(tab-bar--tab-bar-lines-for-frame):
New functions to update value of tab-bar-lines in frames.
(tab-bar-mode, tab-bar-new-tab-to, tab-bar-close-tab)
(tab-bar-close-other-tab, tab-bar-show :set):
Use new function.
(tab-bar-select-tab-modifiers :set):
Work around visual glitch.
2021-02-14 20:48:23 +02:00
Stefan Kangas
58473dc660 Prefer defvar-local in preloaded files
* lisp/abbrev.el:
* lisp/bindings.el (mode-line-mule-info, mode-line-modified)
(mode-line-remote, mode-line-process)
(mode-line-buffer-identification):
* lisp/buff-menu.el (Buffer-menu-files-only):
* lisp/files.el (buffer-file-number, buffer-file-read-only)
(local-write-file-hooks, write-contents-functions)
(file-local-variables-alist, dir-local-variables-alist)
(save-buffer-coding-system, buffer-save-without-query):
* lisp/font-core.el (font-lock-defaults):
* lisp/font-lock.el (font-lock-keywords-case-fold-search)
(font-lock-syntactically-fontified)
(font-lock-extend-after-change-region-function)
(font-lock-extend-region-functions, font-lock-major-mode):
* lisp/menu-bar.el (list-buffers-directory):
* lisp/simple.el (next-error--message-highlight-overlay)
(next-error-buffer, next-error-function)
(next-error-move-function, goto-line-history)
(minibuffer-default-add-done, undo-extra-outer-limit):
* lisp/tab-bar.el (tab-switcher-column):
* lisp/term/ns-win.el (ns-select-overlay):
* lisp/window.el (window-size-fixed, window-area-factor)
(window-group-start-function, window-group-end-function)
(set-window-group-start-function)
(recenter-window-group-function)
(pos-visible-in-window-group-p-function)
(selected-window-group-function)
(move-to-window-group-line-function): Prefer defvar-local.
2021-01-31 20:08:25 +01:00
Juri Linkov
cd56406b62 * lisp/tab-bar.el: Improve tab-bar-show (bug#45556)
* lisp/tab-bar.el (tab-bar-show): Change :set lambda to update all frames.
Improve docstring.
2021-01-07 20:08:44 +02:00
Juri Linkov
7469214d94 * lisp/tab-bar.el (tab-bar-tab-name-format-function): New defcustom.
(tab-bar-tab-name-format-default): New function as the default value.
(tab-bar-make-keymap-1): Funcall tab-bar-tab-name-format-function.
2021-01-05 20:55:29 +02:00
Juri Linkov
e72fd12ec6 * lisp/tab-bar.el (toggle-frame-tab-bar): New command (bug#45556) 2021-01-05 20:43:22 +02:00
James N. V. Cash
c1daeb4c28 Refactor tab-bar-mode to -define-keys and -load-buttons (bug#42052)
* lisp/tab-bar.el (tab-bar--define-keys, tab-bar--load-buttons):
Move some code here from 'tab-bar-mode'.
(tab-bar-new-tab-to): Call tab-bar--load-buttons and tab-bar--define-keys.

Copyright-paperwork-exempt: yes
2021-01-05 20:35:35 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Stefan Kangas
5ab5c38987 Shorten over-wide docstrings in defcustoms
* lisp/calc/calc.el (calc-embedded-announce-formula-alist)
(calc-embedded-open-formula, calc-embedded-close-formula)
(calc-matrix-mode):
* lisp/cedet/semantic/imenu.el (semantic-imenu-sort-bucket-function):
* lisp/emacs-lisp/find-func.el (find-feature-regexp):
* lisp/emulation/cua-base.el (cua-paste-pop-rotate-temporarily):
* lisp/emulation/viper-init.el (viper-fast-keyseq-timeout)
(viper-related-files-and-buffers-ring):
* lisp/emulation/viper-keym.el (viper-want-ctl-h-help):
* lisp/gnus/gnus-art.el (gnus-article-banner-alist):
* lisp/gnus/gnus-group.el (gnus-keep-same-level):
* lisp/gnus/gnus-score.el (gnus-adaptive-word-length-limit):
* lisp/gnus/gnus-sum.el (gnus-inhibit-user-auto-expire):
* lisp/gnus/gnus-uu.el (gnus-uu-ignore-files-by-type)
(gnus-uu-do-not-unpack-archives)
(gnus-uu-unmark-articles-not-decoded)
(gnus-uu-correct-stripped-uucode, gnus-uu-save-in-digest)
(gnus-uu-post-include-before-composing):
* lisp/gnus/gnus.el (gnus-use-long-file-name)
(gnus-install-group-spam-parameters):
* lisp/gnus/message.el (message-cite-style):
* lisp/gnus/nnmail.el
(nnmail-split-fancy-with-parent-ignore-groups)
(nnmail-cache-ignore-groups):
* lisp/ido.el (ido-rewrite-file-prompt-functions):
* lisp/mail/feedmail.el (feedmail-fiddle-plex-user-list)
(feedmail-spray-address-fiddle-plex-list):
* lisp/mh-e/mh-e.el (mh-annotate-msg-hook):
* lisp/net/imap.el (imap-process-connection-type):
* lisp/net/rcirc.el (rcirc-omit-threshold):
* lisp/net/tramp-sh.el (tramp-copy-size-limit):
* lisp/nxml/nxml-mode.el (nxml-default-buffer-file-coding-system):
* lisp/obsolete/landmark.el (landmark-max-stall-time):
* lisp/obsolete/tls.el (tls-checktrust):
* lisp/org/org-indent.el
(org-indent-mode-turns-off-org-adapt-indentation)
(org-indent-mode-turns-on-hiding-stars):
* lisp/org/org-protocol.el (org-protocol-project-alist):
* lisp/progmodes/cc-vars.el (c-doc-comment-style):
* lisp/progmodes/cperl-mode.el (cperl-indent-subs-specially):
* lisp/progmodes/flymake-proc.el (flymake-proc-allowed-file-name-masks):
* lisp/progmodes/hideif.el (hide-ifdef-expand-reinclusion-protection):
* lisp/simple.el (minibuffer-history-case-insensitive-variables):
* lisp/tab-bar.el (tab-bar-close-last-tab-choice):
* lisp/textmodes/reftex-vars.el
(reftex-special-environment-functions):
* lisp/vc/ediff-init.el (ediff-startup-hook, ediff-cleanup-hook)
(ediff-metachars):
* lisp/vc/ediff-merg.el (ediff-show-clashes-only):
* lisp/vc/ediff-mult.el (ediff-default-filtering-regexp): Shorten doc
strings to not exceed 80-column limits.  (Bug#44858)
2020-12-19 18:21:06 +01:00
Gabriel do Nascimento Ribeiro
c6c4e74603 New option tab-bar-history-buttons-show
* lisp/tab-bar.el (tab-bar-history-buttons-show): If true,
    show back and forward buttons when tab-bar-history-mode
    is enabled.  (Bug#45227)

    Copyright-paperwork-exempt: yes
2020-12-14 10:54:52 +02:00
Juri Linkov
e948cdbfa8 Allow creating a new tab for tab-switcher from the minibuffer (bug#45072)
* lisp/tab-bar.el (tab-switcher): Simplify by let-binding
tab-bar-new-tab-choice to t before calling tab-bar-new-tab
that handles the case when it's called in the active minibuffer.
2020-12-14 10:52:05 +02:00
Juri Linkov
91432f1ec5 Allow creating a new tab from the minibuffer (bug#45072)
* lisp/tab-bar.el (tab-bar-new-tab-to): Select the original window
when selected window is the minibuffer.
2020-12-10 10:28:32 +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
Earl
676398dd7d Add new tab command `C-x t C-r'
* doc/emacs/misc.texi (FFAP): Document new commands (bug#43503).

* lisp/ffap.el (ffap-read-only-other-tab): New command.

* lisp/tab-bar.el (find-file-read-only-other-tab): New command and
keystroke.
2020-09-20 11:36:52 +02:00
James N. V. Cash
7b2dd0ed50 * lisp/tab-bar.el (tab-bar-new-tab-to): Fix tabs not reappearing (bug#42052)
Copyright-paperwork-exempt: yes
2020-09-18 11:27:07 +03:00
Lars Ingebrigtsen
60de60b350 Revert "Use format-prompt in calls to read-from-minibuffer with default value"
This reverts commit 1921d2176b.

The DEFAULT-VALUE here isn't really a default value (since READ is nil), so
don't say there's a default.
2020-09-08 22:41:33 +02:00
Lars Ingebrigtsen
1921d2176b Use format-prompt in calls to read-from-minibuffer with default value
* lisp/tab-bar.el (tab-bar-rename-tab)
(tab-bar-rename-tab-by-name):
* lisp/simple.el (next-matching-history-element): Use
format-prompt in calls to read-from-minibuffer with at default
value.
2020-09-06 23:19:43 +02:00
Lars Ingebrigtsen
660d13bd7b Use format-prompt in calls to completing-read with a default value
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/tab-bar.el (tab-bar-switch-to-tab):
* lisp/profiler.el (profiler-start):
* lisp/frame.el (set-frame-font):
* lisp/erc/erc.el (erc-join-channel):
* lisp/emacs-lock.el (emacs-lock--set-mode):
* lisp/emacs-lisp/elp.el (elp-set-master):
* lisp/emacs-lisp/checkdoc.el ()
(checkdoc-this-string-valid-engine):
* lisp/calendar/todo-mode.el (todo-find-filtered-items-file):
* lisp/calendar/calendar.el (calendar-set-date-style): Use
`format-prompt' in calls to completing-read that has a default
value, but didn't mention that in the prompt.
2020-09-06 20:35:11 +02:00
Juri Linkov
8d05f21946 * lisp/window.el (display-buffer-override-next-command): Add ECHO arg.
* lisp/frame.el (other-frame-prefix):
* lisp/tab-bar.el (other-tab-prefix):
* lisp/windmove.el (windmove-display-in-direction):
* lisp/window.el (other-window-prefix, same-window-prefix):
Use new ECHO arg of display-buffer-override-next-command.

https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00819.html
2020-07-19 02:43:18 +03:00