summaryrefslogtreecommitdiff
path: root/lisp/tab-bar.el
Commit message (Collapse)AuthorAgeFilesLines
...
| * * lisp/tab-bar.el (tab-bar-switch-to-last-tab): Add 'abs' for precautions.Juri Linkov2021-12-121-1/+1
| | | | | | | | https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg01149.html
* | Merge from origin/emacs-28Stefan Kangas2021-12-031-4/+3
|\| | | | | | | | | | | | | | | | | | | 9c222b9c1a Port to C compilers that lack size-0 arrays fed35a8951 Port emacsclient to Solaris 10 f35d6a9c73 * CONTRIBUTE: Improve commit message instructions e0ee1d003a Work around IBM XL C compiler bug 6b99b6eb8b * admin/make-tarball.txt: Various clarifications. bbf4140091 * admin/diff-tar-files: Don't assume .tar.gz. 0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
| * * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.Juri Linkov2021-12-021-4/+3
| | | | | | | | | | | | * test/lisp/tab-bar-tests.el: New file. (tab-bar-tests-close-other-tabs-with-arg): Test for regression that closed the selected tab after selecting it.
* | * lisp/tab-bar.el: 'C-x t RET' creates a new tab for non-existent tab name.Juri Linkov2021-11-221-2/+8
| | | | | | | | | | * lisp/tab-bar.el (tab-bar-switch-to-tab): Create a new tab and rename it to NAME when can't find the tab with the given NAME (bug#51935).
* | * lisp/tab-bar.el (tab-bar-history-old-minibuffer-depth): Remove variable.Juri Linkov2021-11-221-11/+4
| | | | | | | | | | (tab-bar--history-pre-change, tab-bar--history-change): Use minibuffer-depth instead of this variable (bug#51370).
* | Merge from origin/emacs-28Stefan Kangas2021-11-191-2/+4
|\| | | | | | | | | | | | | | | | | 02853edba7 Fix sorting of menus in `context-menu-local' (bug#50067). 14271d050a Fix flyspell-correct-word selected from context menu opene... bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound k... 6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like ... 5eeaf85767 Improve documentation of window hooks 7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
| * * lisp/tab-bar.el: Use 'mouse-1' for history buttons like for 'add-tab' buttonJuri Linkov2021-11-181-2/+4
| | | | | | | | | | | | * lisp/tab-bar.el (tab-bar-mouse-down-1, tab-bar-mouse-1): Handle clicks for 'history-back' and 'history-forward' the same way as 'add-tab' clicks.
* | * lisp/tab-bar.el: Optimize data usage for nil tab-bar-history-mode.Juri Linkov2021-11-181-13/+21
| | | | | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar--tab): Add wc-history-back and wc-history-forward only when tab-bar-history-mode is non-nil. (tab-bar-select-tab): Use wc-history-back and wc-history-forward only when tab-bar-history-mode is non-nil. (tab-bar-new-tab-to): Reset tab-bar-history-back and tab-bar-history-forward to nil.
* | * lisp/tab-bar.el: Avoid micro-steps in tab-bar-history-back/forward.Juri Linkov2021-11-181-4/+15
|/ | | | | | | | | * lisp/tab-bar.el (tab-bar-history-pre-command) (tab-bar-history-done-command): New variables. (tab-bar--history-pre-change): Set 'tab-bar-history-omit' and 'tab-bar-history-pre-command'. (tab-bar--history-change): Use 'tab-bar-history-done-command' and 'tab-bar-history-pre-command' (bug#51370).
* * lisp/tab-bar.el (tab-bar-select-tab): Add check for wc-frame (bug#51883).Juri Linkov2021-11-161-1/+5
|
* * lisp/tab-bar.el: Doc fixes for commands bound to modifier keys.Juri Linkov2021-11-161-7/+12
| | | | | (tab-bar-select-tab-modifiers) (tab-bar-select-tab, tab-bar-switch-to-last-tab): Doc fixes.
* * lisp/tab-bar.el (tab-bar-move-repeat-map): Fix alias binding of tab-move.Juri Linkov2021-10-241-1/+2
| | | | (tab-bar-move-tab-backward): Put 'repeat-map' symbol property.
* ; More accurate doc string for 'tab-bar-format'Eli Zaretskii2021-10-211-2/+7
| | | | | * lisp/tab-bar.el (tab-bar-format): Make the doc string more accurate. (Bug#51247)
* * lisp/tab-bar.el (tab-bar-menu-bar): New command (bug#51247).Juri Linkov2021-10-201-17/+18
| | | | | | (tab-bar-format): Rename option 'tab-bar-format-menu-global' to 'tab-bar-format-menu-bar'. (tab-bar-format-menu-bar): Rename from 'tab-bar-format-menu-global'.
* Rename tab-bar-drag-maybe to tab-bar--dragging-in-progressJuri Linkov2021-10-181-4/+4
| | | | | | | | | * lisp/tab-bar.el (tab-bar--event-to-item, tab-bar-mouse-down-1) (tab-bar-mouse-move-tab): Rename tab-bar-drag-maybe to tab-bar--dragging-in-progress. * src/xdisp.c (note_mouse_highlight): Rename tab_bar_drag_maybe to tab_bar__dragging_in_progress.
* Minor fixes for recent changes in ELisp manualEli Zaretskii2021-10-181-10/+14
| | | | | | | | * doc/lispref/windows.texi (Basic Windows, Windows and Frames) (Selecting Windows): * doc/lispref/objects.texi (Window Type): * doc/lispref/frames.texi (Input Focus, Frame Layout): Fix wording, punctuation, and indexing.
* * lisp/tab-bar.el: Improve docstrings (bug#51247)Juri Linkov2021-10-171-14/+17
| | | | | | | * lisp/tab-bar.el (tab-bar--key-to-number) (tab-bar--event-to-item, tab-bar--format-tab-group) (tab-bar--current-tab-make): Improve docstrings. (switch-to-buffer-other-tab): Obsolete the arg NORECORD.
* * lisp/tab-bar.el (tab-bar-mouse-move-tab): Don't drag tab to itself.Juri Linkov2021-10-171-2/+3
|
* Add tab-bar-drag-maybe for indication of tab dragging (bug#50993)Martin Rudalics2021-10-171-0/+5
| | | | | | | | | | * lisp/tab-bar.el (tab-bar--event-to-item) (tab-bar-mouse-move-tab): Set tab-bar-drag-maybe to nil. (tab-bar-mouse-down-1): Set tab-bar-drag-maybe to t. * src/xdisp.c (note_mouse_highlight): Set cursor to 'hand_cursor' when tab_bar_drag_maybe is true. (syms_of_xdisp): New variable tab-bar-drag-maybe.
* * lisp/tab-bar.el: Add a new tab on [mouse-1] instead of [down-mouse-1]Juri Linkov2021-10-171-14/+16
| | | | | | | | | | * lisp/tab-bar.el (tab-bar-mouse-down-1): Rename from tab-bar-mouse-select-tab. Ignore 'add-tab'. (tab-bar-mouse-1): Rename from tab-bar-mouse-close-tab-from-button. Use binding of 'add-tab'. (tab-bar-map): Rebind [down-mouse-1] from tab-bar-mouse-select-tab to tab-bar-mouse-down-1, and [mouse-1] from tab-bar-mouse-close-tab-from-button to tab-bar-mouse-1 (bug#51246).
* Add new and fix existing docstrings in tab-bar.el and tab-line.el (bug#51247)Juri Linkov2021-10-171-12/+32
| | | | | | | * 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.
* More documentation fixes in tab-bar.elEli Zaretskii2021-10-171-41/+65
| | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar-detach-tab, tab-bar-move-window-to-tab) (tab-bar-new-tab-to, tab-bar-new-tab, tab-bar-close-tab-select) (tab-bar-close-last-tab-choice, tab-bar-tab-pre-close-functions) (tab-bar-close-tab, tab-bar-close-tab-by-name) (tab-bar-close-other-tabs, tab-bar-rename-tab) (tab-bar-rename-tab-by-name, tab-bar-move-tab-to-group) (tab-bar-change-tab-group, tab-bar-close-group-tabs) (tab-switcher-next-line, tab-switcher-prev-line) (tab-switcher-unmark, tab-switcher-delete, tab-switcher-select) (tab-bar-get-buffer-tab, display-buffer-in-tab) (display-buffer-in-new-tab, switch-to-buffer-other-tab) (find-file-other-tab, find-file-read-only-other-tab): Doc fixes.
* Improve doc strings of tab-bar commandsEli Zaretskii2021-10-171-10/+28
| | | | | | | | | | * lisp/tab-bar.el (tab-bar-mouse-select-tab) (tab-bar-mouse-move-tab, tab-bar-mouse-close-tab-from-button) (tab-bar-mouse-close-tab, tab-bar-mouse-context-menu) (tab-bar-switch-to-next-tab, tab-bar-switch-to-prev-tab) (tab-bar-switch-to-last-tab, tab-bar-switch-to-recent-tab) (tab-bar-move-tab-backward, tab-bar-move-tab) (tab-bar-move-tab-to-frame): Add/fix doc strings.
* * lisp/tab-bar.el (tab-detach, tab-window-detach): New aliases.Juri Linkov2021-10-071-20/+22
| | | | | (tab-bar-mouse-context-menu, tab-bar-duplicate-tab): Use word "clone" in help/doc string.
* Clone the frame window configuration in 'clone-frame'Juri Linkov2021-10-061-3/+3
| | | | | | | | | | | | | * doc/emacs/frames.texi (Creating Frames): Mention the cloned window configuration for clone-frame. * lisp/frame.el (clone-frame): Change second arg to 'no-windows' and clone window configuration when it's nil. * lisp/tab-bar.el (tab-bar-mouse-context-menu) (tab-bar-detach-tab): Replace "Detach" with "Move" in help/doc strings. https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00408.html
* * lisp/tab-bar.el (tab-bar-detach-tab): Handle frame selected by make-frame.Juri Linkov2021-10-031-6/+20
| | | | | | (tab-bar-move-window-to-tab): New command. (tab-bar-new-tab-to): Handle the value 'window' of tab-bar-new-tab-choice. https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg02197.html
* * lisp/tab-bar.el (tab-bar-move-tab-to-frame): Delete frame with last tab.Juri Linkov2021-09-291-0/+1
|
* * lisp/tab-bar.el: (tab-bar-detach-tab) New commandAdam Porter2021-09-291-0/+16
| | | | | | | | (tab-bar-detach-tab): New command. (tab-bar-mouse-context-menu): Add menu entry. With thanks to Matt Beshara <m@mfa.pw> for his feedback. https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg02141.html
* ; Adjust overly long docstrings to fit 80 charactersStefan Kangas2021-09-261-3/+4
|
* * lisp/tab-bar.el (tab-bar-new-tab-to): Use ignore-window-parameters.Juri Linkov2021-09-251-1/+2
| | | | | Suggested by Adam Porter <adam@alphapapa.net> in https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01758.html
* * lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs.Juri Linkov2021-09-211-6/+27
| | | | | | * lisp/tab-bar.el (tab-bar--tab, tab-bar--current-tab-make): Copy other possible tab parameters. https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01544.html
* * lisp/tab-bar.el (tab-bar-new-tab): Add optional arg 'from-number'.Juri Linkov2021-09-201-7/+10
| | | | | | (tab-bar-mouse-context-menu): Use tab-number as an arg for 'tab-bar-duplicate-tab'. (tab-bar-duplicate-tab): Add optional arg 'from-number'.
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-2/+2
|
* * lisp/tab-bar.el (tab-bar-format): Add new option tab-bar-format-menu-globalJuri Linkov2021-09-151-1/+24
| | | | (tab-bar-format-menu-global): New function.
* * lisp/tab-bar.el (tab-bar-close-other-tabs): Add arg ‘tab-number’.Juri Linkov2021-09-151-6/+21
| | | | | (tab-bar-mouse-context-menu): Bind menu-item "Close other tabs" to tab-bar-close-other-tabs with arg ‘tab-number’.
* * lisp/tab-bar.el: Rename args to consistent naming convention.Juri Linkov2021-09-151-65/+65
| | | | | | | | | | | | | | | | Use the same naming scheme for function arguments. Use the term "index" when arguments count from 0, and the term "number" when arguments count from 1. * lisp/tab-bar.el (tab-bar-select-tab): Rename ‘arg’ to ‘tab-number’. (tab-bar-move-tab-to): Rename ‘from-index’ to ‘from-number’ and ‘to-index’ to ‘to-number’. (tab-bar-move-tab-to-frame): Rename ‘from-index’ to ‘from-number’ and ‘to-index’ to ‘to-number’. (tab-bar-new-tab-to): Rename ‘to-index’ to ‘tab-number’. (tab-bar-close-tab): Rename ‘arg’ to ‘tab-number’ and ‘to-index’ to ‘to-number’. (tab-bar-rename-tab): Rename ‘arg’ to ‘tab-number’. (tab-bar-change-tab-group): Rename ‘arg’ to ‘tab-number’.
* * lisp/tab-bar.el: Close tab only on mouse-1, not down-mouse-1 (bug#41343)Juri Linkov2021-09-141-10/+25
| | | | | | | | * lisp/tab-bar.el (tab-bar-mouse-select-tab): Don't close the tab when clicked on the close button. (tab-bar-mouse-close-tab-from-button): New function. (tab-bar-map): Bind [mouse-1] to 'tab-bar-mouse-close-tab-from-button'. (tab-bar-mouse-move-tab): Do nothing on non-tab events.
* Support mouse events clicked on the tab bar but outside of any tab (bug#41343)Juri Linkov2021-09-131-46/+72
| | | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar--key-to-number): Return non-nil non-numeric t when no tab is used. Return nil for current-tab. (tab-bar-mouse-select-tab, tab-bar-mouse-close-tab): Do nothing when tab-bar--key-to-number returns non-nil non-numeric t for click events outside of any tab. (tab-bar-mouse-context-menu): Add context menu when mouse is clicked outside of tabs. Add "Duplicate" alongside with "Close" to the menu used when mouse is clicked on a tab. (toggle-tab-bar-mode-from-frame, toggle-frame-tab-bar): Move code closer to 'tab-bar-show'. * src/xdisp.c (handle_tab_bar_click): Return Qtab_bar with empty list when mouse is clicked on the tab bar but outside of any tab.
* * lisp/tab-bar.el (tab-bar-get-buffer-tab): Use 'remq' instead of 'seq-remove'Juri Linkov2021-09-121-1/+1
|
* * lisp/tab-bar.el: Improve logic of 'ignore-current-tab'.Juri Linkov2021-09-121-11/+25
| | | | | | | | | | * lisp/tab-bar.el (tab-bar-get-buffer-tab): Prefer the current tab when 'ignore-current-tab' is nil. (display-buffer-in-tab): Use alist entry 'ignore-current-tab' as the third arg of 'tab-bar-get-buffer-tab'. Improve docstring. Suggested by Feng Shu <tumashu@163.com> https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg00955.html
* Improve documentation of some tab-bar featuresEli Zaretskii2021-09-121-8/+11
| | | | | | | * lisp/tab-bar.el (tab-bar-show, toggle-frame-tab-bar): Doc fixes. * etc/NEWS: Update the corresponding entries.
* Improve documentation of tab-bar functions and variablesEli Zaretskii2021-09-091-5/+12
| | | | | | | * etc/NEWS: Improve wording of tab-bar related entries. * lisp/tab-bar.el (tab-bar-show, tab-bar-select-tab-modifiers): Improve and clarify the doc strings.
* Merge branch 'feature/tab-bar-events'Juri Linkov2021-09-091-61/+111
|\
| * Improve tab-bar event handling (bug#41343)Juri Linkov2021-09-051-52/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar--key-to-number): Rename from tab--key-to-number. (tab-bar--event-to-item): New function from tab-bar-handle-mouse. (tab-bar-mouse-select-tab, tab-bar-mouse-close-tab) (tab-bar-mouse-context-menu, tab-bar-mouse-move-tab): Use tab-bar--event-to-item. * src/menu.c (x_popup_menu_1): Handle Qtab_bar in the second list element. * src/xdisp.c (tty_get_tab_bar_item): Change arg 'end' to bool 'close_p'. (tty_get_tab_bar_item): Detect if the close button was clicked. (tty_handle_tab_bar_click): Return a list with caption that has text properties.
| * Mouse wheel scrolling on the tab barJuri Linkov2021-08-181-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar-map): Bind mouse-4/wheel-up/wheel-left to tab-previous and mouse-5/wheel-down/wheel-right to tab-next. Bind S-mouse-4/wheel-up/wheel-left to tab-bar-move-tab-backward and S-mouse-5/wheel-down/wheel-right to tab-bar-move-tab. (tab-bar-move-tab-backward): New command. (tab-bar-move-repeat-map): Use tab-bar-move-tab-backward instead of lambda. * src/xterm.c (handle_one_xevent): Remove restriction to allow clicking mouse-4 and mouse-5.
| * Bind [drag-mouse-1] to tab-bar-mouse-move-tab on tab-bar-mapJuri Linkov2021-08-181-2/+15
| | | | | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar-mouse-move-tab): New command. (tab-bar-map): Bind [drag-mouse-1] to tab-bar-mouse-move-tab. (tab-bar-select-tab): Zero or nil arg means the current tab. * src/xdisp.c (handle_tab_bar_click): Remove restriction to allow dragging the tab to another tab.
| * Redesign tab-bar event processing (bug#41342, bug#41343)Juri Linkov2021-08-181-36/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of emitting menu-item keys like [tab-1], emit normal mouse events like [mouse-1] and [down-mouse-3] for all mouse clicks issued on the tab-bar. * lisp/mouse.el (mouse-posn-property): Handle 'tab-bar' posn-area. * lisp/tab-bar.el (tab--key-to-number): New internal function. (tab-bar-handle-mouse): Use tab key to select/close tab. (tab-bar-mouse-select-tab, tab-bar-mouse-close-tab) (tab-bar-mouse-context-menu): New commands. (tab-bar-map): Bind [down-mouse-1] to tab-bar-mouse-select-tab, [down-mouse-2] to tab-bar-mouse-close-tab, [down-mouse-3] to tab-bar-mouse-context-menu. (tab-bar-keymap-cache): Remove. (tab-bar-make-keymap): Don't use cache. (tab-bar--format-tab): Remove default bindings from menu items. (tab-bar-make-keymap-1): Prepend tab-bar-map. * src/keyboard.c (make_lispy_event): Append event->arg to position for Qtab_bar. * src/term.c (handle_one_term_event): Simplify to set event arg. * src/w32inevt.c (do_mouse_event): Set emacs_ev->arg to the value returned from tty_handle_tab_bar_click. * src/w32term.c (w32_handle_tab_bar_click): Return value from handle_tab_bar_click. (w32_read_socket): Set tab_bar_key to value returned from w32_handle_tab_bar_click, and set event arg from it. * src/xdisp.c (handle_tab_bar_click): Instead of emitting event, return a list with Qtab_bar and tab caption with text properties that contain Qmenu_item with key and binding. (tty_handle_tab_bar_click): Simplify to return a list of Qtab_bar, key and close_p, instead of emitting event. * src/xterm.c (handle_one_xevent): Set tab_bar_key to value returned from handle_tab_bar_click, and set event arg from it.
* | Fix display of tab-bar buttonsEli Zaretskii2021-09-071-4/+4
| | | | | | | | | | | | | | | | | | | | * src/xterm.c (x_draw_image_relief): * src/w32term.c (w32_draw_image_relief): Fix calculation of relief thickness for tab-bar buttons. * lisp/tab-bar.el (tab-bar--load-buttons) (tab-bar-history-mode): Fix the :margin specification for tab-bar buttons. (Bug#50424)
* | ; * lisp/tab-bar.el (toggle-frame-tab-bar, tab-bar-new-tab-to): Doc fix.Eli Zaretskii2021-09-061-2/+5
|/
* * lisp/tab-bar.el (tab-bar-new-button-show): Make variable obsolete.Juri Linkov2021-08-151-0/+1
|