;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\307%\207" [require seq custom-declare-group tab-bar-groups nil "Tab groups for the tab bar." :group tab-bar] 6) #@82 Default tab group appearances (symbols, strings; will generate faces from this). (defvar tab-bar-groups-appearances '(1 2 3 4 5 6 7 8) (#$ . 245)) #@82 Default tab group colors (to be used by faces that relate to group appearances). (defvar tab-bar-groups-colors '("dark blue" "dark red" "dark green" "dark orange" "steel blue" "medium violet red" "dark cyan" "saddle brown") (#$ . 398)) #@771 List of functions to call to style a tab's name for display. Each function is expected to take NAME, TYPE, TAB, INDEX and COUNT as arguments, and to return a copy of the name that was further styled for display. NAME is the partially styled tab's name as provided by the previous function in the list. In Emacs 27, TYPE is either 'tab or 'current-tab. In Emacs 28 and higher, it may also be 'group or 'current-group. TAB is the tab that the name belongs to. INDEX is the index of the tab within the list of displayed tabs. COUNT is the total number of displayed tabs. If you provide your own implementation here, you're encouraged to make it respect the user's settings in other variables related to group appearance (currently, `tab-bar-groups-show-group-name'). (defvar tab-bar-groups-style-tab-name-functions (byte-code "\301>\203\302\207\303\207" [tab-bar-format tab-bar-format-tabs-groups (tab-bar-groups-propertize-tab-name) (tab-bar-groups-add-group-prefix tab-bar-groups-propertize-tab-name)] 2) (#$ . 641)) #@181 Function to pick a new tab group's initial appearance. This function is expected to take GROUP-NAME and GROUP-TABS as arguments and to return one of `tab-bar-groups-appearances'. (defvar tab-bar-groups-pick-group-appearance-function 'tab-bar-groups-pick-group-appearance (#$ . 1673)) #@131 Pick next unused (or first, if they are all used) group appearance from `tab-bar-groups-appearances'. (fn GROUP-NAME GROUP-TABS) (defalias 'tab-bar-groups-pick-group-appearance #[514 "\301 \302\303\304\"\"\305\206\301 !\207" [tab-bar-groups-appearances tab-bar-groups-distinct-group-appearances seq-remove make-closure #[257 "\211\300\235\207" [V0] 3 "\n\n(fn APPEARANCE)"] seq-first] 7 (#$ . 1965)]) #@451 When to show the group name of a tab in its name. When nil, never show the group name. When 'first, show the group name only on the first tab of a group. When 'all, show the group name on all tabs of a group. Note that this is applied by `tab-bar-groups-propertize-tab-name' or other custom functions that choose to respect this setting only. It does not apply when tab bar groups are rendered via 'tab-bar-format-tabs-groups in `tab-bar-format'. (defvar tab-bar-groups-show-group-name 'first (#$ . 2379)) (byte-code "\301\302\303\304#\210\301\305\306\307#\210\310\311\"\207" [tab-bar-groups-appearances custom-declare-face tab-bar-groups-tab-group-current ((t :inherit (underline bold))) "Tab bar groups face for current group tab." tab-bar-groups-tab-group-inactive ((t :inherit underline)) "Tab bar groups face for inactive group tab." seq-do-indexed #[514 "\301G\"8\302\303\304\"!\305\306\307\310\311\312ECD\303\313\n\"F!!\207" [tab-bar-groups-colors mod intern format "tab-bar-groups-tab-%s" eval macroexpand defface quote t :foreground "Tab bar groups face for tabs (%s)."] 12 "\n\n(fn APPEARANCE INDEX)"]] 4) #@595 Regex to detect relevant tab bar keymap elements by their type. The Regex must provide at least two match groups. The first match group must match the actual type (without the index part) of a relevant tab bar keymap element. By default, that is 'tab and 'current-tab in Emacs 27 and additionally, 'group in Emacs 28. The second match group must match the index of the element in the keymap, if any. For example, a keymap element with a type of 'tab-4 should match 'tab' and '4'. Only match types of keymap elements that you want to be fed into `tab-bar-groups-style-tab-name-functions'. (defvar tab-bar-groups--keymap-element-type-regex "^\\(group\\|\\(?:current-\\)?tab\\)\\(?:-\\([[:digit:]]+\\)\\)?$" (#$ . 3514)) #@181 Extract the actual type of KEYMAP-ELEMENT. Returns either 'tab or 'current-tab in Emacs 27 and additionally, 'group or 'current-group in Emacs 28 and higher. (fn KEYMAP-ELEMENT) (defalias 'tab-bar-groups--keymap-element-type #[257 "\301@!\211\205\302\"\205\303\304\305\"!\211\205AA@\211\2051\306=\2030\211\307 \230\2030\310\207\207" [tab-bar-groups--keymap-element-type-regex symbol-name string-match intern match-string 1 group tab-bar-groups-tab-group-name current-group] 6 (#$ . 4245)]) #@288 Find the tab that KEYMAP-ELEMENT relates to. In Emacs 28 and higher, for keymap elements that denote tab groups (that is, keymap elements that have a type of 'group-*), return the first tab in the group. If the keymap element does not relate to a tab, return nil. (fn KEYMAP-ELEMENT) (defalias 'tab-bar-groups--keymap-element-tab #[257 "\211@\211\302=\203 \303 \207\304!\305\"\210\306\307\310\"!S 8\207" [tab-bar-groups--keymap-element-type-regex tab-bar-tabs-function current-tab tab-bar--current-tab symbol-name string-match string-to-number match-string 2] 7 (#$ . 4760)]) #@76 Propertize NAME according to TYPE and TAB. (fn NAME TYPE TAB INDEX COUNT) (defalias 'tab-bar-groups-propertize-tab-name #[1285 "\260\300\267\202\301\202\302\202\303\211\203 \304\305G\306%\210\210\307\310\"\211\2039\304\305G\306\311\312\313\"!%\210\210\207" [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (current-group 9 group 13)) "tab-bar-groups-tab-group-current" "tab-bar-groups-tab-group-inactive" nil font-lock-prepend-text-property 0 face alist-get group-appearance intern format "tab-bar-groups-tab-%s"] 15 (#$ . 5351)]) #@73 Prefix NAME with the group name of TAB. (fn NAME TYPE TAB INDEX COUNT) (defalias 'tab-bar-groups-add-group-prefix #[1285 "\301\302\"\211\205 \303!\260\211\203H\211\303 \230\304\305\306\203 \307\202!\310\"!\311=\203/\312=\2045\313=\203F\314\315G\316%\210\317\nQ\262 \266\266\207" [tab-bar-groups-show-group-name alist-get group-index tab-bar-groups-tab-group-name intern format "tab-bar-groups-tab-group-%s" "current" "inactive" first 1 all font-lock-prepend-text-property 0 face " "] 15 (#$ . 5947)]) #@236 List of functions to call after changing the group of a tab. Each function is expected to take the updated tab as an argument. Note that ejecting a tab from its group (that is, changing its group to nil) will also trigger this hook. (defvar tab-bar-groups-tab-post-change-group-functions nil (#$ . 6479)) #@47 Retrieve original data about the current tab. (defalias 'tab-bar-groups-current-tab #[0 "\301 \236\207" [tab-bar-tabs-function current-tab] 2 (#$ . 6792)]) #@75 The group name of the given TAB (or the current tab). (fn &optional TAB) (defalias 'tab-bar-groups-tab-group-name #[256 "\300\301\206\302 \"\207" [alist-get group tab-bar-groups-current-tab] 4 (#$ . 6955)]) #@84 Whether the given TAB (or the current tab) belongs to a group. (fn &optional TAB) (defalias 'tab-bar-groups-tab-group-p #[256 "\300!;\207" [tab-bar-groups-tab-group-name] 3 (#$ . 7172)]) #@147 All tabs that belong to the same group as TAB (or the current tab). Returns nil if the given tab does not belong to a group. (fn &optional TAB) (defalias 'tab-bar-groups-group-tabs #[256 "\300!\211\205\301\302!\303 \"\207" [tab-bar-groups-tab-group-name alist-get intern tab-bar-groups-parse-groups] 5 (#$ . 7368)]) #@124 Set VALUE for KEY in TAB (or the current tab). Return true if the tab was actually updated. (fn KEY VALUE &optional TAB) (defalias 'tab-bar-groups-store-tab-value #[770 "\211\206\300 \301\"\211\203A\232?\205B\211\203:\236\203*\241\266\202AB\211\262B\262\266\202ABC\244\210\302\207" [tab-bar-groups-current-tab assoc t] 9 (#$ . 7697)]) #@423 Set GROUP-NAME in TAB (or the current tab). If the group of the tab was actually updated, run the hooks in `tab-bar-tab-post-change-group-functions' and, by proxy, in `tab-bar-groups-tab-post-change-group-functions'. Note that `tab-bar-tab-post-change-group-functions' is defined in Emacs 28 and higher only. For Emacs 27, it is backported when `tab-bar-groups-activate' is called first. (fn GROUP-NAME &optional TAB) (defalias 'tab-bar-groups-store-tab-group #[513 "\211\206\300 \301\302#\205\303\304\"\207" [tab-bar-groups-current-tab tab-bar-groups-store-tab-value group run-hook-with-args tab-bar-tab-post-change-group-functions] 7 (#$ . 8071)]) #@40 Re-distribute group index to all tabs. (defalias 'tab-bar-groups--reindex-tabs #[0 "\300\301\302\303\304 \"\"\207" [seq-do #[257 "\300\301\"\207" [seq-do-indexed #[514 "\300\301\302!\205\nT#\207" [tab-bar-groups-store-tab-value group-index tab-bar-groups-tab-group-name] 6 "\n\n(fn TAB INDEX)"]] 4 "\n\n(fn GROUP-TABS)"] mapcar cdr tab-bar-groups-parse-groups] 5 (#$ . 8738) nil]) #@45 Re-distribute group appearance to all tabs. (defalias 'tab-bar-groups--reassign-group-appearances #[0 "\300 \211\205R\211@\211@A\301\302\303\304\"\"\205!\211\206!\305\306!\"\211\203I\211@\302\236\2038\241\266\202B\302B\211\262B\266\203A\266\202\202\"\266A\266\202\202\207" [tab-bar-groups-parse-groups alist-get group-appearance seq-find #[257 "\300\301\"\207" [alist-get group-appearance] 4 "\n\n(fn TAB)"] tab-bar-groups-pick-group-appearance symbol-name] 12 (#$ . 9130) nil]) #@414 Build an alist of tabs grouped by their group name. Successive tabs that don't belong to a group are grouped under intermitting nil keys. For example, consider this list of tabs: groupA:foo, groupB:bar, baz, qux, groupC:quux, quuz, groupB:corge, groupA:grault. Calling this function would yield this result: '((groupA (foo grault)) (groupB (bar corge)) (nil (baz qux)) (groupC (grault)) (nil (quuz))) (defalias 'tab-bar-groups-parse-groups #[0 "\300\301 \302\"\303\211\203X\211@\304!\211\205\305!\211\205\211\236?@:\205)@@?\206.\211?\2047\211\203FCBB\262\266\202Q\306 \"C\244\266A\266\202\202\210\307!\207" [frame-parameter selected-frame tabs nil tab-bar-groups-tab-group-name intern alist-get reverse] 12 (#$ . 9644)]) #@94 Retrieve a list of distinct values found for KEY in all tabs of the current frame. (fn KEY) (defalias 'tab-bar-groups-distinct-tab-values #[257 "\301\302\303\304\" \"!\207" [tab-bar-tabs-function seq-uniq seq-map make-closure #[257 "\301\300\"\207" [V0 alist-get] 4 "\n\n(fn TAB)"]] 6 (#$ . 10417)]) #@66 A list of distinct group names in all tabs of the current frame. (defalias 'tab-bar-groups-distinct-group-names #[0 "\300\301\302\303!\"\207" [seq-filter identity tab-bar-groups-distinct-tab-values group] 4 (#$ . 10727)]) #@72 A list of distinct group appearances in all tabs of the current frame. (defalias 'tab-bar-groups-distinct-group-appearances #[0 "\300\301\302\303!\"\207" [seq-filter identity tab-bar-groups-distinct-tab-values group-appearance] 4 (#$ . 10955)]) #@164 Create a new tab in the current group; ARG is used like in `tab-bar-new-tab'. In Emacs 28 and higher, adjust `tab-bar-new-tab-group' instead. (fn &optional ARG) (defalias 'tab-bar-groups-new-tab #[256 "\300 \301!\210\302!\207" [tab-bar-groups-tab-group-name tab-bar-new-tab tab-bar-groups-store-tab-group] 4 (#$ . 11207) nil]) #@158 Duplicate current tab in its group; ARG is used like in `tab-bar-new-tab'. In Emacs 28 and higher, use `tab-bar-duplicate-tab' instead. (fn &optional ARG) (defalias 'tab-bar-groups-duplicate-tab #[256 "\301 \302\303!\210\304!)\207" [tab-bar-new-tab-choice tab-bar-groups-tab-group-name nil tab-bar-new-tab tab-bar-groups-store-tab-group] 4 (#$ . 11545) nil]) #@134 Change GROUP-NAME of TAB (or the current tab). In Emacs 28 and higher, use `tab-bar-change-tab-group' instead. (fn GROUP-NAME TAB) (defalias 'tab-bar-groups-change-tab-group #[514 "\301\302\303\304\305#)\266\204?\205\"\207" [inhibit-changing-match-data tab-bar-groups-store-tab-group "\\`[ \n ]*\\'" nil t string-match] 11 (#$ . 11916) (byte-code "\300\301\302 \303\211\304 %\305 D\207" [completing-read "Group name for tab: " tab-bar-groups-distinct-group-names nil tab-bar-groups-tab-group-name tab-bar-groups-current-tab] 6)]) (defalias 'tab-bar-groups-assign-group 'tab-bar-groups-change-tab-group) #@76 When non-nil, preserve a tab's group appearance when its group is changed. (defvar tab-bar-groups-preserve-apparance-on-change-group nil (#$ . 12538)) #@215 Rename the group of TAB (or the current tab) to GROUP-NAME. Note that this changes the group's name in all tabs that belong to that group. If GROUP-NAME is nil, interactively query the user. (fn GROUP-NAME TAB) (defalias 'tab-bar-groups-rename-group #[514 "\301\302!\206\n\211C\211\205\211@\303\"\210A\266\202\202\n\262)\207" [tab-bar-groups-preserve-apparance-on-change-group t tab-bar-groups-group-tabs tab-bar-groups-store-tab-group] 7 (#$ . 12696) (byte-code "\300\301\302 \303\211\304 %\305 D\207" [completing-read "Group name for tab(s): " tab-bar-groups-distinct-group-names nil tab-bar-groups-tab-group-name tab-bar-groups-current-tab] 6)]) #@54 Eject TAB (or current tab) from its group. (fn TAB) (defalias 'tab-bar-groups-eject-tab #[257 "\300\301\"\207" [tab-bar-groups-store-tab-group nil] 4 (#$ . 13364) (byte-code "\300 C\207" [tab-bar-groups-current-tab] 1)]) #@146 Close all tabs of the group that TAB (or the current tab) belongs to. In Emacs 28 and higher, use `tab-bar-close-group-tabs' instead. (fn TAB) (defalias 'tab-bar-groups-close-group-tabs #[257 "\301!\211\205\211@\302\303 \304#T!\210A\266\202\202\207" [tab-bar-tabs-function tab-bar-groups-group-tabs tab-bar-close-tab seq-position equal] 8 (#$ . 13594) (byte-code "\300 C\207" [tab-bar-groups-current-tab] 1)]) (byte-code "\300\301\302\"\210\300\302\303\"\207" [defalias tab-bar-groups-close-tab-group tab-bar-groups-close-group tab-bar-groups-close-group-tabs] 3) #@258 Re-order tabs so that all tabs of each group are next to each other. Accepts, but ignores any arguments so it can be used as-is in the `tab-bar-groups-tab-post-change-group-functions' abnormal hook in order to keep tabs grouped at all times. (fn &rest _) (defalias 'tab-bar-groups-regroup-tabs #[128 "\300\301\302\303\304 \"\"\211G\305\211W\205&\211\234\306T\307!T\"\266\211T\262\202 \207" [apply append seq-map cdr tab-bar-groups-parse-groups 0 tab-bar-move-tab-to tab-bar--tab-index] 10 (#$ . 14175) nil]) #@73 List of functions after which to re-distribute group index in all tabs. (defvar tab-bar-groups-trigger-reindex-tabs-functions '(tab-bar-close-tab tab-bar-move-tab-to tab-bar-new-tab-to) (#$ . 14700)) #@68 Re-distribute group index to all tabs, return RESULT. (fn RESULT) (defalias 'tab-bar-groups--reindex-tabs-advice #[257 "\300 \210\207" [tab-bar-groups--reindex-tabs] 2 (#$ . 14906)]) #@78 List of functions after which to re-distribute group appearance in all tabs. (defvar tab-bar-groups-trigger-reassign-group-appearances-functions '(tab-bar-new-tab-to) (#$ . 15096)) #@73 Re-distribute group appearance in all tabs, return RESULT. (fn RESULT) (defalias 'tab-bar-groups--reassign-group-appearances-advice #[257 "\300 \210\207" [tab-bar-groups--reassign-group-appearances] 2 (#$ . 15283)]) #@105 Call ORIG-FUN with ARGS, then inject custom properties related to tab groups. (fn ORIG-FUN &rest ARGS) (defalias 'tab-bar-groups--tab-advice #[385 "\300\"\301\302@\303\"\236\304\211\203+\211@\305\"\204$\306\"BC\244\210A\266\202\202\f\210\207" [apply current-tab frame-parameter tabs (group group-index group-appearance) assoc alist-get] 11 (#$ . 15507)]) #@105 Call ORIG-FUN with ARGS, then inject custom properties related to tab groups. (fn ORIG-FUN &rest ARGS) (defalias 'tab-bar-groups--current-tab-advice #[385 "\300\"@\206\301\302A@\303\"\236\304\211\2031\211@\305\"\204*\306\"BC\244\210A\266\202\202\210\207" [apply current-tab frame-parameter tabs (group group-index group-appearance) assoc alist-get] 11 (#$ . 15885)]) #@60 Apply group appearance to all tabs in KEYMAP. (fn KEYMAP) (defalias 'tab-bar-groups--make-keymap-1-advice #[257 "\300\301A\"\211G\302\303\304\"\"\266\207" [seq-filter tab-bar-groups--keymap-element-type seq-map-indexed make-closure #[514 "AA\211\302\303\304\300$ AA@#\240\207" [V0 tab-bar-groups-style-tab-name-functions seq-reduce make-closure #[514 "\211\303\301!\304\301!\302\300%\207" [V0 V1 V2 tab-bar-groups--keymap-element-type tab-bar-groups--keymap-element-tab] 8 "\n\n(fn NAME F)"]] 10 "\n\n(fn KEYMAP-ELEMENT INDEX)"]] 7 (#$ . 16278)]) #@82 Do some tab bar group related housekeeping after changing TAB's group. (fn TAB) (defalias 'tab-bar-groups--post-change-group #[257 "\204\n\301\302\303#\210\301\304\303#\210\305 \210\306 \210\307\310\"\207" [tab-bar-groups-preserve-apparance-on-change-group tab-bar-groups-store-tab-value group-appearance nil group-index tab-bar-groups--reindex-tabs tab-bar-groups--reassign-group-appearances run-hook-with-args tab-bar-groups-tab-post-change-group-functions] 5 (#$ . 16844)]) #@26 Activate tab bar groups. (defalias 'tab-bar-groups-activate #[0 "\303\304\305\306#\210\307\310!\203\303\310\305\311#\210\202\303\312\305\311#\210\303\313\314\315#\210\211\2036\211@\303\314\316\317$\210A\266\202\202\"\210 \211\203K\211@\303\314\320#\210A\266\202\2028\210\n \211\203t\211@\321\211\203l\211@\322\323\"#\210A\266\202\202U\210A\266\202\202N\210\324\325\326\"\207" [tab-bar-groups-trigger-reindex-tabs-functions tab-bar-groups-trigger-reassign-group-appearances-functions tab-bar-tabs-function advice-add tab-bar--tab :around tab-bar-groups--tab-advice fboundp tab-bar--current-tab-make tab-bar-groups--current-tab-advice tab-bar--current-tab tab-bar-make-keymap-1 :filter-return tab-bar-groups--make-keymap-1-advice tab-bar-groups--reindex-tabs-advice ((depth . 100)) tab-bar-groups--reassign-group-appearances-advice (group group-index group-appearance) tab-bar-groups-store-tab-value alist-get add-hook tab-bar-tab-post-change-group-functions tab-bar-groups--post-change-group] 9 (#$ . 17333)]) (defvar tab-bar-groups--original-tab-bar-echo-area-make-keymap-function nil) #@67 Make an unaltered keymap to use as the source of tabs to display. (defalias 'tab-bar-groups--make-keymap-for-tab-bar-echo-area #[0 "\302 )\207" [tab-bar-groups-style-tab-name-functions tab-bar-groups--original-tab-bar-echo-area-make-keymap-function nil] 1 (#$ . 18449)]) #@82 Style NAME according to TYPE, TAB, INDEX, COUNT. (fn NAME TYPE TAB INDEX COUNT) (defalias 'tab-bar-groups--style-tab-name-for-echo-area #[1285 "\301\302\303%#\207" [tab-bar-groups-style-tab-name-functions seq-reduce make-closure #[514 "\211\300\301\302\303%\207" [V0 V1 V2 V3] 8 "\n\n(fn NAME F)"]] 12 (#$ . 18728)]) #@101 Activate tab bar groups for the 'tab-bar-echo-area' package. Requires version 0.3 of that package. (defalias 'tab-bar-groups-activate-for-tab-bar-echo-area #[0 "\302\303!\2052\304\305\306\307#\210\310\211\203\211@\304\311\"\210A\266\202\202 \210\312\300!\203*\313\314\315!\2052\315 \207" [tab-bar-echo-area-make-keymap-function tab-bar-groups--original-tab-bar-echo-area-make-keymap-function featurep tab-bar-echo-area add-hook tab-bar-echo-area-style-tab-name-functions tab-bar-groups--style-tab-name-for-echo-area 100 (tab-bar-groups-new-tab tab-bar-groups-duplicate-tab tab-bar-groups-assign-group tab-bar-groups-rename-group tab-bar-groups-eject-tab tab-bar-groups-close-group) tab-bar-echo-area-trigger-display-functions boundp tab-bar-groups--make-keymap-for-tab-bar-echo-area functionp tab-bar-echo-area-apply-display-tab-names-advice] 5 (#$ . 19065)]) #@38 Style PROJECT-TAG. (fn PROJECT-TAG) (defalias 'tab-bar-groups--style-project-mode-line-tag #[257 "\211\260\300\301\302 \"\211\203\303\304G\305\306\307\310\"!%\210\210\207" [alist-get group-appearance tab-bar-groups-current-tab font-lock-prepend-text-property 0 face intern format "tab-bar-groups-tab-%s"] 11 (#$ . 19943)]) #@66 Activate tab bar groups for the 'project-mode-line-tag' package. (defalias 'tab-bar-groups-activate-for-project-mode-line-tag #[0 "\300\301!\205 \302\303\304\305#\207" [featurep project-mode-line-tag add-hook project-mode-line-tag-style-functions tab-bar-groups--style-project-mode-line-tag 100] 4 (#$ . 20281)]) (provide 'tab-bar-groups)