2019-09-22 20:40:04 +00:00
|
|
|
|
;;; tab-line.el --- window-local tabs with window buffers -*- lexical-binding: t; -*-
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2022-01-01 07:45:51 +00:00
|
|
|
|
;; Copyright (C) 2019-2022 Free Software Foundation, Inc.
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
|
|
|
|
;; Author: Juri Linkov <juri@linkov.net>
|
|
|
|
|
;; Keywords: windows tabs
|
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; To enable this mode, run `M-x global-tab-line-mode'.
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2020-12-13 05:54:28 +00:00
|
|
|
|
(require 'cl-lib)
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(require 'seq) ; tab-line.el is not pre-loaded so it's safe to use it here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defgroup tab-line nil
|
2019-09-22 20:40:04 +00:00
|
|
|
|
"Window-local tabs."
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
:group 'convenience
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
2021-09-24 04:47:56 +00:00
|
|
|
|
(defcustom tab-line-tab-face-functions
|
|
|
|
|
'(tab-line-tab-face-modified tab-line-tab-face-special)
|
2020-12-13 05:54:28 +00:00
|
|
|
|
"Functions called to modify tab faces.
|
|
|
|
|
Each function is called with five arguments: the tab, a list of
|
|
|
|
|
all tabs, the face returned by the previously called modifier,
|
|
|
|
|
whether the tab is a buffer, and whether the tab is selected."
|
|
|
|
|
:type '(repeat
|
|
|
|
|
(choice (function-item tab-line-tab-face-special)
|
2021-09-24 04:47:56 +00:00
|
|
|
|
(function-item tab-line-tab-face-modified)
|
2020-12-13 05:54:28 +00:00
|
|
|
|
(function-item tab-line-tab-face-inactive-alternating)
|
2021-03-13 02:12:10 +00:00
|
|
|
|
(function-item tab-line-tab-face-group)
|
2020-12-13 05:54:28 +00:00
|
|
|
|
(function :tag "Custom function")))
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "28.1")
|
|
|
|
|
|
2020-06-08 00:21:42 +00:00
|
|
|
|
(defgroup tab-line-faces '((tab-line custom-face)) ; tab-line is defined in faces.el
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
"Faces used in the tab line."
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:group 'faces
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
|
|
|
|
(defface tab-line-tab
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'((default :inherit tab-line)
|
2019-10-14 20:07:23 +00:00
|
|
|
|
(((class color) (min-colors 88))
|
|
|
|
|
:box (:line-width 1 :style released-button))
|
2021-03-17 17:42:48 +00:00
|
|
|
|
(t :inverse-video nil))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
"Tab line face for selected tab."
|
|
|
|
|
:version "27.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
|
|
|
|
(defface tab-line-tab-inactive
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'((default :inherit tab-line-tab)
|
2019-09-15 20:52:22 +00:00
|
|
|
|
(((class color) (min-colors 88))
|
|
|
|
|
:background "grey75")
|
2021-03-17 17:42:48 +00:00
|
|
|
|
(t :inverse-video t))
|
2019-09-22 20:40:04 +00:00
|
|
|
|
"Tab line face for non-selected tab."
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
:version "27.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
2020-12-13 05:54:28 +00:00
|
|
|
|
(defface tab-line-tab-inactive-alternate
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'((t :inherit tab-line-tab-inactive :background "grey65"))
|
2020-12-13 05:54:28 +00:00
|
|
|
|
"Alternate face for inactive tab-line tabs.
|
|
|
|
|
Applied to alternating tabs when option
|
|
|
|
|
`tab-line-tab-face-functions' includes function
|
|
|
|
|
`tab-line-tab-face-inactive-alternating'."
|
|
|
|
|
:version "28.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
|
|
|
|
(defface tab-line-tab-special
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'((default :weight bold)
|
2020-12-13 05:54:28 +00:00
|
|
|
|
(((supports :slant italic))
|
2021-03-17 17:42:48 +00:00
|
|
|
|
:slant italic :weight normal))
|
2020-12-13 05:54:28 +00:00
|
|
|
|
"Face for special (i.e. non-file-backed) tabs.
|
|
|
|
|
Applied when option `tab-line-tab-face-functions' includes
|
|
|
|
|
function `tab-line-tab-face-special'."
|
|
|
|
|
:version "28.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
2021-09-24 04:47:56 +00:00
|
|
|
|
(defface tab-line-tab-modified
|
|
|
|
|
'((t :inherit font-lock-doc-face))
|
|
|
|
|
"Face for modified tabs.
|
|
|
|
|
Applied when option `tab-line-tab-face-functions' includes
|
|
|
|
|
function `tab-line-tab-face-modified'."
|
|
|
|
|
:version "28.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
2021-03-13 02:12:10 +00:00
|
|
|
|
(defface tab-line-tab-group
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'((t :inherit tab-line :box nil))
|
2021-03-13 02:12:10 +00:00
|
|
|
|
"Face for group tabs.
|
|
|
|
|
Applied when option `tab-line-tab-face-functions' includes
|
|
|
|
|
function `tab-line-tab-face-group'."
|
|
|
|
|
:version "28.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(defface tab-line-tab-current
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'((default :inherit tab-line-tab)
|
2019-11-02 21:39:15 +00:00
|
|
|
|
(((class color) (min-colors 88))
|
2020-01-12 23:23:12 +00:00
|
|
|
|
:background "grey85"))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
"Tab line face for tab with current buffer in selected window."
|
2019-11-02 21:39:15 +00:00
|
|
|
|
:version "27.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
2019-09-15 20:52:22 +00:00
|
|
|
|
(defface tab-line-highlight
|
2021-10-11 18:27:50 +00:00
|
|
|
|
'((((class color) (min-colors 88))
|
|
|
|
|
:box (:line-width 1 :style released-button)
|
|
|
|
|
:background "grey85"
|
|
|
|
|
:foreground "black")
|
|
|
|
|
(t :inverse-video nil))
|
2019-09-15 20:52:22 +00:00
|
|
|
|
"Tab line face for highlighting."
|
|
|
|
|
:version "27.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
|
|
|
|
(defface tab-line-close-highlight
|
|
|
|
|
'((t :foreground "red"))
|
2019-09-22 20:40:04 +00:00
|
|
|
|
"Tab line face for highlighting of the close button."
|
2019-09-15 20:52:22 +00:00
|
|
|
|
:version "27.1"
|
|
|
|
|
:group 'tab-line-faces)
|
|
|
|
|
|
|
|
|
|
|
2022-09-12 14:53:26 +00:00
|
|
|
|
(defvar-keymap tab-line-tab-map
|
|
|
|
|
:doc "Local keymap for `tab-line-mode' window tabs."
|
|
|
|
|
"<tab-line> <down-mouse-1>" #'tab-line-select-tab
|
|
|
|
|
"<tab-line> <mouse-2>" #'tab-line-close-tab
|
|
|
|
|
"<tab-line> <down-mouse-3>" #'tab-line-tab-context-menu
|
|
|
|
|
"RET" #'tab-line-select-tab)
|
|
|
|
|
|
|
|
|
|
(defvar-keymap tab-line-add-map
|
|
|
|
|
:doc "Local keymap to add `tab-line-mode' window tabs."
|
|
|
|
|
"<tab-line> <down-mouse-1>" #'tab-line-new-tab
|
|
|
|
|
"<tab-line> <down-mouse-2>" #'tab-line-new-tab
|
|
|
|
|
"RET" #'tab-line-new-tab)
|
|
|
|
|
|
|
|
|
|
(defvar-keymap tab-line-tab-close-map
|
|
|
|
|
:doc "Local keymap to close `tab-line-mode' window tabs."
|
|
|
|
|
"<tab-line> <mouse-1>" #'tab-line-close-tab
|
|
|
|
|
"<tab-line> <mouse-2>" #'tab-line-close-tab)
|
|
|
|
|
|
|
|
|
|
(defvar-keymap tab-line-left-map
|
|
|
|
|
:doc "Local keymap to scroll `tab-line-mode' window tabs to the left."
|
|
|
|
|
"<tab-line> <down-mouse-1>" #'tab-line-hscroll-left
|
|
|
|
|
"<tab-line> <down-mouse-2>" #'tab-line-hscroll-left
|
|
|
|
|
"RET" #'tab-line-new-tab)
|
|
|
|
|
|
|
|
|
|
(defvar-keymap tab-line-right-map
|
|
|
|
|
:doc "Local keymap to scroll `tab-line-mode' window tabs to the right."
|
|
|
|
|
"<tab-line> <down-mouse-1>" #'tab-line-hscroll-right
|
|
|
|
|
"<tab-line> <down-mouse-2>" #'tab-line-hscroll-right
|
|
|
|
|
"RET" #'tab-line-new-tab)
|
2019-10-22 21:17:27 +00:00
|
|
|
|
|
2019-09-15 20:52:22 +00:00
|
|
|
|
|
2019-09-25 20:21:37 +00:00
|
|
|
|
(defcustom tab-line-new-tab-choice t
|
|
|
|
|
"Defines what to show in a new tab.
|
|
|
|
|
If t, display a selection menu with all available buffers.
|
2020-03-19 23:21:57 +00:00
|
|
|
|
If the value is a function, call it with no arguments."
|
2019-09-25 20:21:37 +00:00
|
|
|
|
:type '(choice (const :tag "Buffer menu" t)
|
2020-03-19 23:21:57 +00:00
|
|
|
|
(function :tag "Function"))
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
|
|
|
|
(defcustom tab-line-new-button-show t
|
|
|
|
|
"If non-nil, show the \"New tab\" button in the tab line."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:initialize 'custom-initialize-default
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(force-mode-line-update))
|
2019-09-25 20:21:37 +00:00
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
2019-09-15 20:52:22 +00:00
|
|
|
|
|
2019-09-25 20:21:37 +00:00
|
|
|
|
(defvar tab-line-new-button
|
2019-09-15 20:52:22 +00:00
|
|
|
|
(propertize " + "
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'display '(image :type xpm
|
2019-10-15 19:44:10 +00:00
|
|
|
|
:file "tabs/new.xpm"
|
2019-09-15 20:52:22 +00:00
|
|
|
|
:margin (2 . 0)
|
|
|
|
|
:ascent center)
|
|
|
|
|
'keymap tab-line-add-map
|
|
|
|
|
'mouse-face 'tab-line-highlight
|
|
|
|
|
'help-echo "Click to add tab")
|
|
|
|
|
"Button for creating a new tab.")
|
|
|
|
|
|
2019-09-25 20:21:37 +00:00
|
|
|
|
(defcustom tab-line-close-button-show t
|
|
|
|
|
"Defines where to show the close tab button.
|
|
|
|
|
If t, show the close tab button on all tabs.
|
|
|
|
|
If `selected', show it only on the selected tab.
|
|
|
|
|
If `non-selected', show it only on non-selected tab.
|
|
|
|
|
If nil, don't show it at all."
|
|
|
|
|
:type '(choice (const :tag "On all tabs" t)
|
|
|
|
|
(const :tag "On selected tab" selected)
|
|
|
|
|
(const :tag "On non-selected tabs" non-selected)
|
|
|
|
|
(const :tag "None" nil))
|
2019-10-02 20:18:01 +00:00
|
|
|
|
:initialize 'custom-initialize-default
|
2019-09-25 20:21:37 +00:00
|
|
|
|
:set (lambda (sym val)
|
2019-10-02 20:18:01 +00:00
|
|
|
|
(set-default sym val)
|
2019-09-25 20:21:37 +00:00
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
|
|
|
|
(defvar tab-line-close-button
|
2019-09-22 20:40:04 +00:00
|
|
|
|
(propertize " x"
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'display '(image :type xpm
|
2019-10-15 19:44:10 +00:00
|
|
|
|
:file "tabs/close.xpm"
|
2019-09-15 20:52:22 +00:00
|
|
|
|
:margin (2 . 0)
|
|
|
|
|
:ascent center)
|
|
|
|
|
'keymap tab-line-tab-close-map
|
|
|
|
|
'mouse-face 'tab-line-close-highlight
|
|
|
|
|
'help-echo "Click to close tab")
|
|
|
|
|
"Button for closing the clicked tab.")
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(defvar tab-line-left-button
|
|
|
|
|
(propertize " <"
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'display '(image :type xpm
|
2019-10-22 21:17:27 +00:00
|
|
|
|
:file "tabs/left-arrow.xpm"
|
|
|
|
|
:margin (2 . 0)
|
|
|
|
|
:ascent center)
|
|
|
|
|
'keymap tab-line-left-map
|
|
|
|
|
'mouse-face 'tab-line-highlight
|
|
|
|
|
'help-echo "Click to scroll left")
|
|
|
|
|
"Button for scrolling horizontally to the left.")
|
|
|
|
|
|
|
|
|
|
(defvar tab-line-right-button
|
|
|
|
|
(propertize "> "
|
2021-03-17 17:42:48 +00:00
|
|
|
|
'display '(image :type xpm
|
2019-10-22 21:17:27 +00:00
|
|
|
|
:file "tabs/right-arrow.xpm"
|
|
|
|
|
:margin (2 . 0)
|
|
|
|
|
:ascent center)
|
|
|
|
|
'keymap tab-line-right-map
|
|
|
|
|
'mouse-face 'tab-line-highlight
|
|
|
|
|
'help-echo "Click to scroll right")
|
|
|
|
|
"Button for scrolling horizontally to the right.")
|
|
|
|
|
|
2020-03-19 23:21:57 +00:00
|
|
|
|
(defvar tab-line-separator nil
|
|
|
|
|
"String that delimits tabs.")
|
2019-09-25 20:21:37 +00:00
|
|
|
|
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(defcustom tab-line-tab-name-function #'tab-line-tab-name-buffer
|
2019-09-22 20:40:04 +00:00
|
|
|
|
"Function to get a tab name.
|
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 09:49:04 +00:00
|
|
|
|
The function is called with one or two arguments: the buffer or
|
|
|
|
|
another object whose tab's name is requested, and, optionally,
|
|
|
|
|
the list of all tabs."
|
2019-10-22 21:17:27 +00:00
|
|
|
|
:type '(choice (const :tag "Buffer name"
|
|
|
|
|
tab-line-tab-name-buffer)
|
|
|
|
|
(const :tag "Truncated buffer name"
|
|
|
|
|
tab-line-tab-name-truncated-buffer)
|
2021-10-17 17:09:29 +00:00
|
|
|
|
(function :tag "Function"))
|
2019-10-22 21:17:27 +00:00
|
|
|
|
:initialize 'custom-initialize-default
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
2019-09-22 20:40:04 +00:00
|
|
|
|
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(defun tab-line-tab-name-buffer (buffer &optional _buffers)
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
"Generate tab name from BUFFER.
|
2019-09-22 20:40:04 +00:00
|
|
|
|
Reduce tab width proportionally to space taken by other tabs.
|
|
|
|
|
This function can be overridden by changing the default value of the
|
|
|
|
|
variable `tab-line-tab-name-function'."
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(buffer-name buffer))
|
|
|
|
|
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(defcustom tab-line-tab-name-truncated-max 20
|
|
|
|
|
"Maximum length of the tab name from the current buffer.
|
|
|
|
|
Effective when `tab-line-tab-name-function' is customized
|
|
|
|
|
to `tab-line-tab-name-truncated-buffer'."
|
2022-07-06 17:29:51 +00:00
|
|
|
|
:type 'natnum
|
2020-01-20 23:03:37 +00:00
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
2020-10-04 19:41:36 +00:00
|
|
|
|
(defvar tab-line-tab-name-ellipsis t)
|
2020-01-20 23:03:37 +00:00
|
|
|
|
|
|
|
|
|
(defun tab-line-tab-name-truncated-buffer (buffer &optional _buffers)
|
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 09:49:04 +00:00
|
|
|
|
"Generate tab name from BUFFER, truncating it as needed.
|
2020-01-20 23:03:37 +00:00
|
|
|
|
Truncate it to the length specified by `tab-line-tab-name-truncated-max'.
|
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 09:49:04 +00:00
|
|
|
|
If truncated, append ellipsis per `tab-line-tab-name-ellipsis'."
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(let ((tab-name (buffer-name buffer)))
|
|
|
|
|
(if (< (length tab-name) tab-line-tab-name-truncated-max)
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
tab-name
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(propertize (truncate-string-to-width
|
|
|
|
|
tab-name tab-line-tab-name-truncated-max nil nil
|
|
|
|
|
tab-line-tab-name-ellipsis)
|
2019-09-02 20:27:32 +00:00
|
|
|
|
'help-echo tab-name))))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2019-11-05 23:21:57 +00:00
|
|
|
|
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(defcustom tab-line-tabs-function #'tab-line-tabs-window-buffers
|
2019-09-22 20:40:04 +00:00
|
|
|
|
"Function to get a list of tabs to display in the tab line.
|
|
|
|
|
This function should return either a list of buffers whose names will
|
|
|
|
|
be displayed, or just a list of strings to display in the tab line.
|
2019-10-26 22:38:32 +00:00
|
|
|
|
By default, use function `tab-line-tabs-window-buffers' that
|
|
|
|
|
returns a list of buffers associated with the selected window.
|
|
|
|
|
When `tab-line-tabs-mode-buffers', return a list of buffers
|
2021-03-13 22:04:55 +00:00
|
|
|
|
with the same major mode as the current buffer.
|
|
|
|
|
When `tab-line-tabs-buffer-groups', return a list of buffers
|
|
|
|
|
grouped either by `tab-line-tabs-buffer-group-function', when set,
|
|
|
|
|
or by `tab-line-tabs-buffer-groups'."
|
2019-10-26 22:38:32 +00:00
|
|
|
|
:type '(choice (const :tag "Window buffers"
|
|
|
|
|
tab-line-tabs-window-buffers)
|
|
|
|
|
(const :tag "Same mode buffers"
|
|
|
|
|
tab-line-tabs-mode-buffers)
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(const :tag "Grouped buffers"
|
|
|
|
|
tab-line-tabs-buffer-groups)
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(function :tag "Function"))
|
|
|
|
|
:initialize 'custom-initialize-default
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
2019-09-22 20:40:04 +00:00
|
|
|
|
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(defvar tab-line-tabs-buffer-list-function #'tab-line-tabs-buffer-list
|
|
|
|
|
"Function to return a global list of buffers.
|
|
|
|
|
Used only for `tab-line-tabs-mode-buffers' and `tab-line-tabs-buffer-groups'.")
|
|
|
|
|
|
|
|
|
|
(defun tab-line-tabs-buffer-list ()
|
|
|
|
|
(seq-filter (lambda (b) (and (buffer-live-p b)
|
|
|
|
|
(/= (aref (buffer-name b) 0) ?\s)))
|
2019-11-13 22:09:06 +00:00
|
|
|
|
(seq-uniq (append (list (current-buffer))
|
|
|
|
|
(mapcar #'car (window-prev-buffers))
|
|
|
|
|
(buffer-list)))))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(defun tab-line-tabs-mode-buffers ()
|
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 09:49:04 +00:00
|
|
|
|
"Return a list of buffers with the same major mode as the current buffer."
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(let ((mode major-mode))
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(seq-sort-by #'buffer-name #'string<
|
|
|
|
|
(seq-filter (lambda (b) (with-current-buffer b
|
|
|
|
|
(derived-mode-p mode)))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(funcall tab-line-tabs-buffer-list-function)))))
|
2019-10-26 22:38:32 +00:00
|
|
|
|
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(defvar tab-line-tabs-buffer-group-function nil
|
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 09:49:04 +00:00
|
|
|
|
"Function to add a buffer to the appropriate group of tabs.
|
|
|
|
|
Takes a buffer as arg and should return a group name as a string.
|
|
|
|
|
If the return value is nil, the buffer should be filtered out.")
|
2019-11-06 22:59:28 +00:00
|
|
|
|
|
|
|
|
|
(defvar tab-line-tabs-buffer-group-sort-function nil
|
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 09:49:04 +00:00
|
|
|
|
"Function to sort buffers in a group.")
|
2019-11-06 22:59:28 +00:00
|
|
|
|
|
|
|
|
|
(defvar tab-line-tabs-buffer-groups-sort-function #'string<
|
|
|
|
|
"Function to sort group names.")
|
|
|
|
|
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(defvar tab-line-tabs-buffer-groups mouse-buffer-menu-mode-groups
|
|
|
|
|
"How to group various major modes together in the tab line.
|
|
|
|
|
Each element has the form (REGEXP . GROUPNAME).
|
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 09:49:04 +00:00
|
|
|
|
If the major mode's name matches REGEXP, it belongs to GROUPNAME.
|
|
|
|
|
The default is for each major mode to have a separate group
|
|
|
|
|
named the same as the mode.")
|
2019-11-05 23:21:57 +00:00
|
|
|
|
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(defun tab-line-tabs-buffer-group-name (&optional buffer)
|
|
|
|
|
(if (functionp tab-line-tabs-buffer-group-function)
|
|
|
|
|
(funcall tab-line-tabs-buffer-group-function buffer)
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(let ((mode (if buffer (with-current-buffer buffer
|
|
|
|
|
(format-mode-line mode-name))
|
|
|
|
|
(format-mode-line mode-name))))
|
|
|
|
|
(or (cdr (seq-find (lambda (group)
|
|
|
|
|
(string-match-p (car group) mode))
|
|
|
|
|
tab-line-tabs-buffer-groups))
|
|
|
|
|
mode))))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
|
|
|
|
|
(defun tab-line-tabs-buffer-groups ()
|
2021-03-13 22:04:55 +00:00
|
|
|
|
"Return a list of tabs that should be displayed in the tab line.
|
|
|
|
|
By default return a list of buffers grouped by major mode,
|
|
|
|
|
according to `tab-line-tabs-buffer-groups'.
|
|
|
|
|
If non-nil, `tab-line-tabs-buffer-group-function' is used to
|
|
|
|
|
generate the group name."
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(if (window-parameter nil 'tab-line-groups)
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(let* ((buffers (funcall tab-line-tabs-buffer-list-function))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(groups
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(seq-sort tab-line-tabs-buffer-groups-sort-function
|
|
|
|
|
(delq nil (mapcar #'car (seq-group-by
|
|
|
|
|
(lambda (buffer)
|
|
|
|
|
(tab-line-tabs-buffer-group-name
|
|
|
|
|
buffer))
|
|
|
|
|
buffers)))))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(selected-group (window-parameter nil 'tab-line-group))
|
|
|
|
|
(tabs
|
|
|
|
|
(mapcar (lambda (group)
|
|
|
|
|
`(tab
|
|
|
|
|
(name . ,group)
|
|
|
|
|
(selected . ,(equal group selected-group))
|
|
|
|
|
(select . ,(lambda ()
|
|
|
|
|
(set-window-parameter nil 'tab-line-groups nil)
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(set-window-parameter nil 'tab-line-group group)
|
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll nil)))))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
groups)))
|
|
|
|
|
tabs)
|
|
|
|
|
|
|
|
|
|
(let* ((window-parameter (window-parameter nil 'tab-line-group))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(group-name (tab-line-tabs-buffer-group-name (current-buffer)))
|
|
|
|
|
(group (prog1 (or window-parameter group-name "All")
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(when (equal window-parameter group-name)
|
|
|
|
|
(set-window-parameter nil 'tab-line-group nil))))
|
|
|
|
|
(group-tab `(tab
|
|
|
|
|
(name . ,group)
|
2021-03-13 02:12:10 +00:00
|
|
|
|
(group-tab . t)
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(select . ,(lambda ()
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(set-window-parameter nil 'tab-line-groups t)
|
|
|
|
|
(set-window-parameter nil 'tab-line-group group)
|
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll nil)))))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(buffers
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(seq-filter (lambda (b)
|
2019-11-13 22:09:06 +00:00
|
|
|
|
(equal (tab-line-tabs-buffer-group-name b) group))
|
|
|
|
|
(funcall tab-line-tabs-buffer-list-function)))
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(sorted-buffers (if (functionp tab-line-tabs-buffer-group-sort-function)
|
|
|
|
|
(seq-sort tab-line-tabs-buffer-group-sort-function
|
|
|
|
|
buffers)
|
|
|
|
|
buffers))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(tabs (mapcar (lambda (buffer)
|
|
|
|
|
`(tab
|
|
|
|
|
(name . ,(funcall tab-line-tab-name-function buffer))
|
|
|
|
|
(selected . ,(eq buffer (current-buffer)))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(buffer . ,buffer)
|
|
|
|
|
(close . ,(lambda (&optional b)
|
|
|
|
|
;; kill-buffer because bury-buffer
|
|
|
|
|
;; won't remove the buffer from tab-line
|
|
|
|
|
(kill-buffer (or b buffer))))))
|
2019-11-06 22:59:28 +00:00
|
|
|
|
sorted-buffers)))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(cons group-tab tabs))))
|
|
|
|
|
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(defun tab-line-tabs-window-buffers ()
|
2019-09-22 20:40:04 +00:00
|
|
|
|
"Return a list of tabs that should be displayed in the tab line.
|
|
|
|
|
By default returns a list of window buffers, i.e. buffers previously
|
|
|
|
|
shown in the same window where the tab line is displayed.
|
|
|
|
|
This list can be overridden by changing the default value of the
|
|
|
|
|
variable `tab-line-tabs-function'."
|
|
|
|
|
(let* ((window (selected-window))
|
|
|
|
|
(buffer (window-buffer window))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(next-buffers (seq-remove (lambda (b) (eq b buffer))
|
|
|
|
|
(window-next-buffers window)))
|
2019-09-02 22:29:07 +00:00
|
|
|
|
(next-buffers (seq-filter #'buffer-live-p next-buffers))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(prev-buffers (seq-remove (lambda (b) (eq b buffer))
|
|
|
|
|
(mapcar #'car (window-prev-buffers window))))
|
2019-09-02 22:29:07 +00:00
|
|
|
|
(prev-buffers (seq-filter #'buffer-live-p prev-buffers))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
;; Remove next-buffers from prev-buffers
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(prev-buffers (seq-difference prev-buffers next-buffers)))
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(append (reverse prev-buffers)
|
|
|
|
|
(list buffer)
|
|
|
|
|
next-buffers)))
|
2019-09-02 22:29:07 +00:00
|
|
|
|
|
2019-11-05 23:21:57 +00:00
|
|
|
|
|
2021-02-23 19:01:31 +00:00
|
|
|
|
(defcustom tab-line-tab-name-format-function #'tab-line-tab-name-format-default
|
|
|
|
|
"Function to format a tab name.
|
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 09:49:04 +00:00
|
|
|
|
The function will be called two arguments: the tab whose name to format,
|
|
|
|
|
and the list of all the tabs; it should return the formatted tab name
|
|
|
|
|
to display in the tab line.
|
|
|
|
|
The first argument could also be a different object, for example the buffer
|
|
|
|
|
which the tab will represent."
|
2021-02-23 19:01:31 +00:00
|
|
|
|
:type 'function
|
|
|
|
|
:initialize 'custom-initialize-default
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "28.1")
|
|
|
|
|
|
|
|
|
|
(defun tab-line-tab-name-format-default (tab tabs)
|
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 09:49:04 +00:00
|
|
|
|
"Default function to use as `tab-line-tab-name-format-function', which see."
|
2021-02-23 19:01:31 +00:00
|
|
|
|
(let* ((buffer-p (bufferp tab))
|
|
|
|
|
(selected-p (if buffer-p
|
|
|
|
|
(eq tab (window-buffer))
|
|
|
|
|
(cdr (assq 'selected tab))))
|
|
|
|
|
(name (if buffer-p
|
|
|
|
|
(funcall tab-line-tab-name-function tab tabs)
|
|
|
|
|
(cdr (assq 'name tab))))
|
|
|
|
|
(face (if selected-p
|
2022-02-06 17:58:43 +00:00
|
|
|
|
(if (mode-line-window-selected-p)
|
2021-02-23 19:01:31 +00:00
|
|
|
|
'tab-line-tab-current
|
|
|
|
|
'tab-line-tab)
|
|
|
|
|
'tab-line-tab-inactive)))
|
|
|
|
|
(dolist (fn tab-line-tab-face-functions)
|
|
|
|
|
(setf face (funcall fn tab tabs face buffer-p selected-p)))
|
|
|
|
|
(apply 'propertize
|
2021-07-08 17:51:15 +00:00
|
|
|
|
(concat (propertize name
|
|
|
|
|
'keymap tab-line-tab-map
|
2021-12-30 08:08:37 +00:00
|
|
|
|
'help-echo (if selected-p "Current tab"
|
|
|
|
|
"Click to select tab")
|
2021-07-08 17:51:15 +00:00
|
|
|
|
;; Don't turn mouse-1 into mouse-2 (bug#49247)
|
|
|
|
|
'follow-link 'ignore)
|
2021-02-23 19:01:31 +00:00
|
|
|
|
(or (and (or buffer-p (assq 'buffer tab) (assq 'close tab))
|
|
|
|
|
tab-line-close-button-show
|
|
|
|
|
(not (eq tab-line-close-button-show
|
|
|
|
|
(if selected-p 'non-selected 'selected)))
|
|
|
|
|
tab-line-close-button)
|
|
|
|
|
""))
|
|
|
|
|
`(
|
|
|
|
|
tab ,tab
|
|
|
|
|
,@(if selected-p '(selected t))
|
|
|
|
|
face ,face
|
|
|
|
|
mouse-face tab-line-highlight))))
|
|
|
|
|
|
2019-12-04 23:08:24 +00:00
|
|
|
|
(defun tab-line-format-template (tabs)
|
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 09:49:04 +00:00
|
|
|
|
"Template of the format for displaying tab line for selected window.
|
|
|
|
|
This is used by `tab-line-format'."
|
2021-02-23 19:01:31 +00:00
|
|
|
|
(let* ((separator (or tab-line-separator (if window-system " " "|")))
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(hscroll (window-parameter nil 'tab-line-hscroll))
|
|
|
|
|
(strings
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (tab)
|
2021-02-23 19:01:31 +00:00
|
|
|
|
(concat separator
|
|
|
|
|
(funcall tab-line-tab-name-format-function tab tabs)))
|
2019-11-17 21:43:28 +00:00
|
|
|
|
tabs))
|
|
|
|
|
(hscroll-data (tab-line-auto-hscroll strings hscroll)))
|
|
|
|
|
(setq hscroll (nth 1 hscroll-data))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(append
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(if (null (nth 0 hscroll-data))
|
|
|
|
|
(when hscroll
|
|
|
|
|
(setq hscroll nil)
|
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll hscroll))
|
|
|
|
|
(list separator
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(when (and (numberp hscroll) (not (zerop hscroll)))
|
2019-11-17 21:43:28 +00:00
|
|
|
|
tab-line-left-button)
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(when (if (numberp hscroll)
|
|
|
|
|
(< (truncate hscroll) (1- (length strings)))
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(> (length strings) 1))
|
|
|
|
|
tab-line-right-button)))
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(if hscroll (nthcdr (truncate hscroll) strings) strings)
|
2020-03-16 23:11:27 +00:00
|
|
|
|
(list separator)
|
|
|
|
|
(when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
|
2020-03-19 23:21:57 +00:00
|
|
|
|
tab-line-new-button-show
|
|
|
|
|
tab-line-new-button)
|
2020-03-16 23:11:27 +00:00
|
|
|
|
(list tab-line-new-button)))))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2020-12-13 05:54:28 +00:00
|
|
|
|
(defun tab-line-tab-face-inactive-alternating (tab tabs face _buffer-p selected-p)
|
|
|
|
|
"Return FACE for TAB in TABS with alternation.
|
2021-10-17 17:09:29 +00:00
|
|
|
|
SELECTED-P nil means TAB is not the selected tab.
|
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 09:49:04 +00:00
|
|
|
|
When TAB is not selected and is even-numbered, make FACE
|
2020-12-13 05:54:28 +00:00
|
|
|
|
inherit from `tab-line-tab-inactive-alternate'. For use in
|
|
|
|
|
`tab-line-tab-face-functions'."
|
|
|
|
|
(when (and (not selected-p) (cl-evenp (cl-position tab tabs)))
|
|
|
|
|
(setf face `(:inherit (tab-line-tab-inactive-alternate ,face))))
|
|
|
|
|
face)
|
|
|
|
|
|
|
|
|
|
(defun tab-line-tab-face-special (tab _tabs face buffer-p _selected-p)
|
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 09:49:04 +00:00
|
|
|
|
"Return FACE for TAB according to whether its buffer is special.
|
|
|
|
|
When TAB is a non-file-visiting buffer, make FACE inherit from
|
2020-12-13 05:54:28 +00:00
|
|
|
|
`tab-line-tab-special'. For use in
|
|
|
|
|
`tab-line-tab-face-functions'."
|
2022-02-01 19:42:51 +00:00
|
|
|
|
(let ((buffer (if buffer-p tab (cdr (assq 'buffer tab)))))
|
|
|
|
|
(when (and buffer (not (buffer-file-name buffer)))
|
|
|
|
|
(setf face `(:inherit (tab-line-tab-special ,face)))))
|
2020-12-13 05:54:28 +00:00
|
|
|
|
face)
|
|
|
|
|
|
2021-09-24 04:47:56 +00:00
|
|
|
|
(defun tab-line-tab-face-modified (tab _tabs face buffer-p _selected-p)
|
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 09:49:04 +00:00
|
|
|
|
"Return FACE for TAB according to whether its buffer is modified.
|
2021-09-24 04:47:56 +00:00
|
|
|
|
When TAB is a modified, file-backed buffer, make FACE inherit
|
|
|
|
|
from `tab-line-tab-modified'. For use in
|
|
|
|
|
`tab-line-tab-face-functions'."
|
2022-02-01 19:42:51 +00:00
|
|
|
|
(let ((buffer (if buffer-p tab (cdr (assq 'buffer tab)))))
|
|
|
|
|
(when (and buffer (buffer-file-name buffer) (buffer-modified-p buffer))
|
|
|
|
|
(setf face `(:inherit (tab-line-tab-modified ,face)))))
|
2021-09-24 04:47:56 +00:00
|
|
|
|
face)
|
|
|
|
|
|
2021-03-13 02:12:10 +00:00
|
|
|
|
(defun tab-line-tab-face-group (tab _tabs face _buffer-p _selected-p)
|
|
|
|
|
"Return FACE for TAB according to whether it's a group tab.
|
|
|
|
|
For use in `tab-line-tab-face-functions'."
|
|
|
|
|
(when (alist-get 'group-tab tab)
|
|
|
|
|
(setf face `(:inherit (tab-line-tab-group ,face))))
|
|
|
|
|
face)
|
|
|
|
|
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(defvar tab-line-auto-hscroll)
|
|
|
|
|
|
2019-12-04 23:08:24 +00:00
|
|
|
|
(defun tab-line-format ()
|
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 09:49:04 +00:00
|
|
|
|
"Format for displaying the tab line of the selected window."
|
2019-12-08 22:08:53 +00:00
|
|
|
|
(let* ((tabs (funcall tab-line-tabs-function))
|
|
|
|
|
(cache-key (list tabs
|
2020-04-26 22:28:36 +00:00
|
|
|
|
;; handle buffer renames
|
2020-03-16 23:11:27 +00:00
|
|
|
|
(buffer-name (window-buffer))
|
2020-04-26 22:28:36 +00:00
|
|
|
|
;; handle tab-line scrolling
|
|
|
|
|
(window-parameter nil 'tab-line-hscroll)
|
|
|
|
|
;; for setting face 'tab-line-tab-current'
|
2022-02-10 18:52:55 +00:00
|
|
|
|
(mode-line-window-selected-p)
|
2021-10-03 17:13:29 +00:00
|
|
|
|
(and (memq 'tab-line-tab-face-modified
|
|
|
|
|
tab-line-tab-face-functions)
|
|
|
|
|
(buffer-file-name) (buffer-modified-p))))
|
2019-12-08 22:08:53 +00:00
|
|
|
|
(cache (window-parameter nil 'tab-line-cache)))
|
2020-02-29 21:49:17 +00:00
|
|
|
|
;; Enable auto-hscroll again after it was disabled on manual scrolling.
|
|
|
|
|
;; The moment to enable it is when the window-buffer was updated.
|
|
|
|
|
(when (and tab-line-auto-hscroll ; if auto-hscroll was enabled
|
|
|
|
|
(integerp (nth 2 cache-key)) ; integer on manual scroll
|
|
|
|
|
cache ; window-buffer was updated
|
|
|
|
|
(not (equal (nth 1 (car cache)) (nth 1 cache-key))))
|
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll (float (nth 2 cache-key))))
|
2019-12-08 22:08:53 +00:00
|
|
|
|
(or (and cache (equal (car cache) cache-key) (cdr cache))
|
|
|
|
|
(cdr (set-window-parameter
|
|
|
|
|
nil 'tab-line-cache
|
|
|
|
|
(cons cache-key (tab-line-format-template tabs)))))))
|
2019-12-04 23:08:24 +00:00
|
|
|
|
|
2019-11-17 21:43:28 +00:00
|
|
|
|
|
2019-11-18 21:57:16 +00:00
|
|
|
|
(defcustom tab-line-auto-hscroll t
|
|
|
|
|
"Allow or disallow automatic horizontal scrolling of the tab line.
|
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 09:49:04 +00:00
|
|
|
|
Non-nil means the tab lines are automatically scrolled horizontally to make
|
2019-11-18 21:57:16 +00:00
|
|
|
|
the selected tab visible."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(defvar tab-line-auto-hscroll-buffer (generate-new-buffer " *tab-line-hscroll*"))
|
|
|
|
|
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(defun tab-line--get-tab-property (prop string)
|
2022-01-02 18:00:40 +00:00
|
|
|
|
(or (get-pos-property 1 prop string) ;; for most cases of 1-char separator
|
|
|
|
|
(get-pos-property 0 prop string) ;; for empty separator
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(let ((pos (next-single-property-change 0 prop string))) ;; long separator
|
2022-01-02 18:00:40 +00:00
|
|
|
|
(and pos (get-pos-property pos prop string)))))
|
2021-12-31 09:20:51 +00:00
|
|
|
|
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(defun tab-line-auto-hscroll (strings hscroll)
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(with-current-buffer tab-line-auto-hscroll-buffer
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(let ((truncate-partial-width-windows nil)
|
|
|
|
|
(inhibit-modification-hooks t)
|
|
|
|
|
show-arrows)
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(setq truncate-lines nil)
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(erase-buffer)
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(apply 'insert strings)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(add-face-text-property (point-min) (point-max) 'tab-line)
|
|
|
|
|
;; Continuation means tab-line doesn't fit completely,
|
|
|
|
|
;; thus scroll arrows are needed for scrolling.
|
|
|
|
|
(setq show-arrows (> (vertical-motion 1) 0))
|
2020-02-29 21:49:17 +00:00
|
|
|
|
;; Try to auto-hscroll only when scrolling is needed,
|
2019-11-17 21:43:28 +00:00
|
|
|
|
;; but no manual scrolling was performed before.
|
2019-11-18 21:57:16 +00:00
|
|
|
|
(when (and tab-line-auto-hscroll
|
|
|
|
|
show-arrows
|
2019-12-15 23:14:02 +00:00
|
|
|
|
;; Do nothing when scrolled manually
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(not (integerp hscroll)))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(let ((selected (seq-position strings 'selected
|
|
|
|
|
(lambda (str prop)
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(tab-line--get-tab-property prop str)))))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(cond
|
|
|
|
|
((null selected)
|
|
|
|
|
;; Do nothing if no tab is selected
|
|
|
|
|
)
|
2020-02-29 21:49:17 +00:00
|
|
|
|
((or (not (numberp hscroll)) (< selected (truncate hscroll)))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
;; Selected is scrolled to the left, or no scrolling yet
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(erase-buffer)
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(apply 'insert (reverse (seq-subseq strings 0 (1+ selected))))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(add-face-text-property (point-min) (point-max) 'tab-line)
|
|
|
|
|
(if (> (vertical-motion 1) 0)
|
|
|
|
|
(let* ((point (previous-single-property-change (point) 'tab))
|
2020-01-20 00:35:53 +00:00
|
|
|
|
(tab-prop (when point
|
2022-01-02 18:00:40 +00:00
|
|
|
|
(or (get-pos-property point 'tab)
|
2020-01-20 00:35:53 +00:00
|
|
|
|
(and (setq point (previous-single-property-change point 'tab))
|
2022-01-02 18:00:40 +00:00
|
|
|
|
(get-pos-property point 'tab)))))
|
2020-01-20 00:35:53 +00:00
|
|
|
|
(new-hscroll (when tab-prop
|
|
|
|
|
(seq-position strings tab-prop
|
|
|
|
|
(lambda (str tab)
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(eq (tab-line--get-tab-property 'tab str) tab))))))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(when new-hscroll
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(setq hscroll (float new-hscroll))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll hscroll)))
|
|
|
|
|
(setq hscroll nil)
|
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll hscroll)))
|
|
|
|
|
(t
|
|
|
|
|
;; Check if the selected tab is already visible
|
|
|
|
|
(erase-buffer)
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(apply 'insert (seq-subseq strings (truncate hscroll) (1+ selected)))
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(add-face-text-property (point-min) (point-max) 'tab-line)
|
|
|
|
|
(when (> (vertical-motion 1) 0)
|
2019-12-15 23:14:02 +00:00
|
|
|
|
;; Not visible already
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(apply 'insert (reverse (seq-subseq strings 0 (1+ selected))))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(add-face-text-property (point-min) (point-max) 'tab-line)
|
|
|
|
|
(when (> (vertical-motion 1) 0)
|
|
|
|
|
(let* ((point (previous-single-property-change (point) 'tab))
|
2020-01-20 00:35:53 +00:00
|
|
|
|
(tab-prop (when point
|
2022-01-02 18:00:40 +00:00
|
|
|
|
(or (get-pos-property point 'tab)
|
2020-01-20 00:35:53 +00:00
|
|
|
|
(and (setq point (previous-single-property-change point 'tab))
|
2022-01-02 18:00:40 +00:00
|
|
|
|
(get-pos-property point 'tab)))))
|
2020-01-20 00:35:53 +00:00
|
|
|
|
(new-hscroll (when tab-prop
|
|
|
|
|
(seq-position strings tab-prop
|
|
|
|
|
(lambda (str tab)
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(eq (tab-line--get-tab-property 'tab str) tab))))))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(when new-hscroll
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(setq hscroll (float new-hscroll))
|
2019-12-15 23:14:02 +00:00
|
|
|
|
(set-window-parameter nil 'tab-line-hscroll hscroll)))))))))
|
2019-11-17 21:43:28 +00:00
|
|
|
|
(list show-arrows hscroll))))
|
|
|
|
|
|
2019-10-22 21:17:27 +00:00
|
|
|
|
|
|
|
|
|
(defun tab-line-hscroll (&optional arg window)
|
|
|
|
|
(let* ((hscroll (window-parameter window 'tab-line-hscroll))
|
|
|
|
|
(tabs (if window
|
|
|
|
|
(with-selected-window window (funcall tab-line-tabs-function))
|
|
|
|
|
(funcall tab-line-tabs-function))))
|
|
|
|
|
(set-window-parameter
|
|
|
|
|
window 'tab-line-hscroll
|
2020-02-29 21:49:17 +00:00
|
|
|
|
(max 0 (min (+ (if (numberp hscroll) (truncate hscroll) 0) (or arg 1))
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(1- (length tabs)))))
|
|
|
|
|
(when window
|
|
|
|
|
(force-mode-line-update t))))
|
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-hscroll-right (&optional arg event)
|
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 09:49:04 +00:00
|
|
|
|
"Scroll the tab line ARG positions to the right.
|
|
|
|
|
Interactively, ARG is the prefix numeric argument and defaults to 1."
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(interactive (list current-prefix-arg last-nonmenu-event))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(let ((window (and (listp event) (posn-window (event-start event)))))
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(tab-line-hscroll arg window)
|
|
|
|
|
(force-mode-line-update window)))
|
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-hscroll-left (&optional arg event)
|
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 09:49:04 +00:00
|
|
|
|
"Scroll the tab line ARG positions to the left.
|
|
|
|
|
Interactively, ARG is the prefix numeric argument and defaults to 1."
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(interactive (list current-prefix-arg last-nonmenu-event))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(let ((window (and (listp event) (posn-window (event-start event)))))
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(tab-line-hscroll (- (or arg 1)) window)
|
|
|
|
|
(force-mode-line-update window)))
|
|
|
|
|
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-new-tab (&optional event)
|
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 09:49:04 +00:00
|
|
|
|
"Add a new tab to the selected-window's tab line.
|
|
|
|
|
This command is usually invoked by clicking on the plus-shaped button
|
|
|
|
|
on the tab line. Switching to another buffer also adds a new tab
|
|
|
|
|
corresponding to the new buffer shown in the window."
|
2019-10-20 22:37:39 +00:00
|
|
|
|
(interactive (list last-nonmenu-event))
|
2019-09-25 20:21:37 +00:00
|
|
|
|
(if (functionp tab-line-new-tab-choice)
|
|
|
|
|
(funcall tab-line-new-tab-choice)
|
2019-11-06 22:59:28 +00:00
|
|
|
|
(let ((tab-line-tabs-buffer-groups mouse-buffer-menu-mode-groups))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(if (and (listp event)
|
2020-12-08 06:44:32 +00:00
|
|
|
|
(display-popup-menus-p)
|
|
|
|
|
(not tty-menu-open-use-tmm))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(mouse-buffer-menu event) ; like (buffer-menu-open)
|
2019-11-06 22:59:28 +00:00
|
|
|
|
;; tty menu doesn't support mouse clicks, so use tmm
|
|
|
|
|
(tmm-prompt (mouse-buffer-menu-keymap))))))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-select-tab (&optional event)
|
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 09:49:04 +00:00
|
|
|
|
"Switch to the buffer specified by the tab on which you click.
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
This command maintains the original order of prev/next buffers.
|
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 09:49:04 +00:00
|
|
|
|
So, for example, switching to a previous tab is equivalent to
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
using the `previous-buffer' command."
|
|
|
|
|
(interactive "e")
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(let* ((posnp (event-start event))
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(tab (tab-line--get-tab-property 'tab (car (posn-string posnp))))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
(buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))))
|
|
|
|
|
(if buffer
|
|
|
|
|
(tab-line-select-tab-buffer buffer (posn-window posnp))
|
|
|
|
|
(let ((select (cdr (assq 'select tab))))
|
|
|
|
|
(when (functionp select)
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(with-selected-window (posn-window posnp)
|
|
|
|
|
(funcall select)
|
|
|
|
|
(force-mode-line-update)))))))
|
2019-11-05 23:21:57 +00:00
|
|
|
|
|
|
|
|
|
(defun tab-line-select-tab-buffer (buffer &optional window)
|
|
|
|
|
(let* ((window-buffer (window-buffer window))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(next-buffers (seq-remove (lambda (b) (eq b window-buffer))
|
|
|
|
|
(window-next-buffers window)))
|
|
|
|
|
(prev-buffers (seq-remove (lambda (b) (eq b window-buffer))
|
|
|
|
|
(mapcar #'car (window-prev-buffers window))))
|
|
|
|
|
;; Remove next-buffers from prev-buffers
|
|
|
|
|
(prev-buffers (seq-difference prev-buffers next-buffers)))
|
|
|
|
|
(cond
|
2019-10-26 22:38:32 +00:00
|
|
|
|
((and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
|
|
|
|
|
(memq buffer next-buffers))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(dotimes (_ (1+ (seq-position next-buffers buffer)))
|
|
|
|
|
(switch-to-next-buffer window)))
|
2019-10-26 22:38:32 +00:00
|
|
|
|
((and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
|
|
|
|
|
(memq buffer prev-buffers))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(dotimes (_ (1+ (seq-position prev-buffers buffer)))
|
|
|
|
|
(switch-to-prev-buffer window)))
|
|
|
|
|
(t
|
2019-09-24 21:54:36 +00:00
|
|
|
|
(with-selected-window window
|
|
|
|
|
(switch-to-buffer buffer))))))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2020-09-09 23:20:24 +00:00
|
|
|
|
(defcustom tab-line-switch-cycling nil
|
|
|
|
|
"Enable cycling tab switch.
|
|
|
|
|
If non-nil, `tab-line-switch-to-prev-tab' in the first tab
|
|
|
|
|
switches to the last tab and `tab-line-switch-to-next-tab' in the
|
2020-09-13 13:23:25 +00:00
|
|
|
|
last tab switches to the first tab. This variable is not consulted
|
2020-09-13 15:27:44 +00:00
|
|
|
|
when `tab-line-tabs-function' is `tab-line-tabs-window-buffers'."
|
2020-09-09 23:20:24 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "28.1")
|
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-switch-to-prev-tab (&optional event)
|
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 09:49:04 +00:00
|
|
|
|
"Switch to the previous tab's buffer.
|
2019-09-28 19:48:48 +00:00
|
|
|
|
Its effect is the same as using the `previous-buffer' command
|
|
|
|
|
(\\[previous-buffer])."
|
2019-10-20 22:37:39 +00:00
|
|
|
|
(interactive (list last-nonmenu-event))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(let ((window (and (listp event) (posn-window (event-start event)))))
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
|
|
|
|
|
(switch-to-prev-buffer window)
|
|
|
|
|
(with-selected-window (or window (selected-window))
|
2021-11-24 19:41:52 +00:00
|
|
|
|
(let* ((tabs (seq-filter
|
|
|
|
|
(lambda (tab) (or (bufferp tab) (assq 'buffer tab)))
|
|
|
|
|
(funcall tab-line-tabs-function)))
|
2020-09-09 19:16:34 +00:00
|
|
|
|
(pos (seq-position
|
|
|
|
|
tabs (current-buffer)
|
|
|
|
|
(lambda (tab buffer)
|
|
|
|
|
(if (bufferp tab)
|
|
|
|
|
(eq buffer tab)
|
|
|
|
|
(eq buffer (cdr (assq 'buffer tab)))))))
|
2020-09-09 19:22:49 +00:00
|
|
|
|
(tab (if pos
|
|
|
|
|
(if (and tab-line-switch-cycling (<= pos 0))
|
|
|
|
|
(nth (1- (length tabs)) tabs)
|
|
|
|
|
(nth (1- pos) tabs))))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))))
|
|
|
|
|
(when (bufferp buffer)
|
|
|
|
|
(switch-to-buffer buffer)))))))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-switch-to-next-tab (&optional event)
|
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 09:49:04 +00:00
|
|
|
|
"Switch to the next tab's buffer.
|
2019-09-28 19:48:48 +00:00
|
|
|
|
Its effect is the same as using the `next-buffer' command
|
|
|
|
|
(\\[next-buffer])."
|
2019-10-20 22:37:39 +00:00
|
|
|
|
(interactive (list last-nonmenu-event))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(let ((window (and (listp event) (posn-window (event-start event)))))
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
|
|
|
|
|
(switch-to-next-buffer window)
|
|
|
|
|
(with-selected-window (or window (selected-window))
|
2021-11-24 19:41:52 +00:00
|
|
|
|
(let* ((tabs (seq-filter
|
|
|
|
|
(lambda (tab) (or (bufferp tab) (assq 'buffer tab)))
|
|
|
|
|
(funcall tab-line-tabs-function)))
|
2020-09-09 19:16:34 +00:00
|
|
|
|
(pos (seq-position
|
|
|
|
|
tabs (current-buffer)
|
|
|
|
|
(lambda (tab buffer)
|
|
|
|
|
(if (bufferp tab)
|
|
|
|
|
(eq buffer tab)
|
|
|
|
|
(eq buffer (cdr (assq 'buffer tab)))))))
|
2020-09-09 19:22:49 +00:00
|
|
|
|
(tab (if pos
|
|
|
|
|
(if (and tab-line-switch-cycling (<= (length tabs) (1+ pos)))
|
|
|
|
|
(car tabs)
|
|
|
|
|
(nth (1+ pos) tabs))))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))))
|
|
|
|
|
(when (bufferp buffer)
|
|
|
|
|
(switch-to-buffer buffer)))))))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2019-10-22 21:17:27 +00:00
|
|
|
|
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(defcustom tab-line-close-tab-function 'bury-buffer
|
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 09:49:04 +00:00
|
|
|
|
"What to do upon closing a tab on the tab line.
|
2019-09-28 19:48:48 +00:00
|
|
|
|
If `bury-buffer', put the tab's buffer at the end of the list of all
|
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 09:49:04 +00:00
|
|
|
|
buffers, which effectively hides the buffer's tab from the tab line.
|
2019-11-12 21:31:12 +00:00
|
|
|
|
If `kill-buffer', kills the tab's buffer.
|
2020-01-20 23:03:37 +00:00
|
|
|
|
When a function, it is called with the tab as its argument.
|
2019-11-12 21:31:12 +00:00
|
|
|
|
This option is useful when `tab-line-tabs-function' has the value
|
|
|
|
|
`tab-line-tabs-window-buffers'."
|
2019-09-28 19:48:48 +00:00
|
|
|
|
:type '(choice (const :tag "Bury buffer" bury-buffer)
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(const :tag "Kill buffer" kill-buffer)
|
|
|
|
|
(function :tag "Function"))
|
2019-09-28 19:48:48 +00:00
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-close-tab (&optional event)
|
2019-09-28 19:48:48 +00:00
|
|
|
|
"Close the selected tab.
|
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 09:49:04 +00:00
|
|
|
|
This command is usually invoked by clicking on the close button on the
|
|
|
|
|
right side of the tab. This command buries the buffer, so it goes out of
|
|
|
|
|
sight of the tab line."
|
2019-10-20 22:37:39 +00:00
|
|
|
|
(interactive (list last-nonmenu-event))
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(let* ((posnp (and (listp event) (event-start event)))
|
2019-10-20 22:37:39 +00:00
|
|
|
|
(window (and posnp (posn-window posnp)))
|
2021-12-31 09:20:51 +00:00
|
|
|
|
(tab (tab-line--get-tab-property 'tab (car (posn-string posnp))))
|
2019-11-12 21:31:12 +00:00
|
|
|
|
(buffer (if (bufferp tab) tab (cdr (assq 'buffer tab))))
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(close-function (unless (bufferp tab) (cdr (assq 'close tab)))))
|
2019-10-20 22:37:39 +00:00
|
|
|
|
(with-selected-window (or window (selected-window))
|
2019-09-28 19:48:48 +00:00
|
|
|
|
(cond
|
2020-01-20 23:03:37 +00:00
|
|
|
|
((functionp close-function)
|
|
|
|
|
(funcall close-function))
|
|
|
|
|
((eq tab-line-close-tab-function 'kill-buffer)
|
2019-09-28 19:48:48 +00:00
|
|
|
|
(kill-buffer buffer))
|
2020-01-20 23:03:37 +00:00
|
|
|
|
((eq tab-line-close-tab-function 'bury-buffer)
|
2019-09-28 19:48:48 +00:00
|
|
|
|
(if (eq buffer (current-buffer))
|
|
|
|
|
(bury-buffer)
|
|
|
|
|
(set-window-prev-buffers nil (assq-delete-all buffer (window-prev-buffers)))
|
2020-01-20 23:03:37 +00:00
|
|
|
|
(set-window-next-buffers nil (delq buffer (window-next-buffers)))))
|
|
|
|
|
((functionp tab-line-close-tab-function)
|
2020-01-22 23:23:17 +00:00
|
|
|
|
(funcall tab-line-close-tab-function tab)))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(force-mode-line-update))))
|
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(defun tab-line-tab-context-menu (&optional event)
|
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 09:49:04 +00:00
|
|
|
|
"Pop up the context menu for a tab-line tab."
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(interactive "e")
|
|
|
|
|
(let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t))))
|
|
|
|
|
(define-key-after menu [close]
|
|
|
|
|
'(menu-item "Close" tab-line-close-tab :help "Close the tab"))
|
|
|
|
|
(popup-menu menu event)))
|
|
|
|
|
|
|
|
|
|
(defun tab-line-context-menu (&optional event)
|
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 09:49:04 +00:00
|
|
|
|
"Pop up the context menu for the tab line."
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(interactive "e")
|
|
|
|
|
(let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t))))
|
|
|
|
|
(define-key-after menu [close]
|
|
|
|
|
'(menu-item "New tab" tab-line-new-tab :help "Create a new tab"))
|
|
|
|
|
(popup-menu menu event)))
|
|
|
|
|
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(define-minor-mode tab-line-mode
|
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 09:49:04 +00:00
|
|
|
|
"Toggle display of tab line in the windows displaying the current buffer."
|
2019-10-26 22:38:32 +00:00
|
|
|
|
:lighter nil
|
2021-11-14 18:35:42 +00:00
|
|
|
|
(let ((default-value '(:eval (tab-line-format))))
|
|
|
|
|
(if tab-line-mode
|
|
|
|
|
;; Preserve the existing tab-line set outside of this mode
|
|
|
|
|
(unless tab-line-format
|
|
|
|
|
(setq tab-line-format default-value))
|
|
|
|
|
;; Reset only values set by this mode
|
|
|
|
|
(when (equal tab-line-format default-value)
|
|
|
|
|
(setq tab-line-format nil)))))
|
2019-10-26 22:38:32 +00:00
|
|
|
|
|
|
|
|
|
(defcustom tab-line-exclude-modes
|
|
|
|
|
'(completion-list-mode)
|
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 09:49:04 +00:00
|
|
|
|
"List of major modes for which the tab-line display is not enabled.
|
|
|
|
|
Buffers under any of these major modes will not show the tab line in
|
|
|
|
|
their windows, even if `global-tab-line-mode' is enabled."
|
2019-10-26 22:38:32 +00:00
|
|
|
|
:type '(repeat symbol)
|
|
|
|
|
:group 'tab-line
|
|
|
|
|
:version "27.1")
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
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 08:55:40 +00:00
|
|
|
|
(defvar-local tab-line-exclude nil)
|
2019-10-26 22:38:32 +00:00
|
|
|
|
|
|
|
|
|
(defun tab-line-mode--turn-on ()
|
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 09:49:04 +00:00
|
|
|
|
"Turn on `tab-line-mode' in all pertinent buffers.
|
|
|
|
|
Temporary buffers, buffers whose names begin with a space, buffers
|
|
|
|
|
under major modes that are either mentioned in `tab-line-exclude-mode'
|
|
|
|
|
or have a non-nil `tab-line-exclude' property on their symbol,
|
|
|
|
|
and buffers that have a non-nil buffer-local value
|
|
|
|
|
of `tab-line-exclude', are exempt from `tab-line-mode'."
|
2019-10-26 22:38:32 +00:00
|
|
|
|
(unless (or (minibufferp)
|
|
|
|
|
(string-match-p "\\` " (buffer-name))
|
|
|
|
|
(memq major-mode tab-line-exclude-modes)
|
|
|
|
|
(get major-mode 'tab-line-exclude)
|
|
|
|
|
(buffer-local-value 'tab-line-exclude (current-buffer)))
|
|
|
|
|
(tab-line-mode 1)))
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(define-globalized-minor-mode global-tab-line-mode
|
|
|
|
|
tab-line-mode tab-line-mode--turn-on
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
:group 'tab-line
|
2019-10-26 22:38:32 +00:00
|
|
|
|
:version "27.1")
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
2019-10-20 22:37:39 +00:00
|
|
|
|
|
2021-09-15 16:09:33 +00:00
|
|
|
|
(global-set-key [tab-line down-mouse-3] 'tab-line-context-menu)
|
|
|
|
|
|
2019-10-22 21:17:27 +00:00
|
|
|
|
(global-set-key [tab-line mouse-4] 'tab-line-hscroll-left)
|
|
|
|
|
(global-set-key [tab-line mouse-5] 'tab-line-hscroll-right)
|
|
|
|
|
(global-set-key [tab-line wheel-up] 'tab-line-hscroll-left)
|
|
|
|
|
(global-set-key [tab-line wheel-down] 'tab-line-hscroll-right)
|
2020-09-07 15:10:30 +00:00
|
|
|
|
(global-set-key [tab-line wheel-left] 'tab-line-hscroll-left)
|
|
|
|
|
(global-set-key [tab-line wheel-right] 'tab-line-hscroll-right)
|
2019-10-22 21:17:27 +00:00
|
|
|
|
|
2019-11-02 21:39:15 +00:00
|
|
|
|
(global-set-key [tab-line S-mouse-4] 'tab-line-switch-to-prev-tab)
|
|
|
|
|
(global-set-key [tab-line S-mouse-5] 'tab-line-switch-to-next-tab)
|
|
|
|
|
(global-set-key [tab-line S-wheel-up] 'tab-line-switch-to-prev-tab)
|
|
|
|
|
(global-set-key [tab-line S-wheel-down] 'tab-line-switch-to-next-tab)
|
2020-09-07 15:10:30 +00:00
|
|
|
|
(global-set-key [tab-line S-wheel-left] 'tab-line-switch-to-prev-tab)
|
|
|
|
|
(global-set-key [tab-line S-wheel-right] 'tab-line-switch-to-next-tab)
|
2019-10-20 22:37:39 +00:00
|
|
|
|
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
|
|
|
|
|
(provide 'tab-line)
|
|
|
|
|
;;; tab-line.el ends here
|