summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2019-10-15 22:41:40 +0300
committerJuri Linkov <juri@linkov.net>2019-10-15 22:41:40 +0300
commit4509aaa5b0666a120fb1e255d52d83d03c46c596 (patch)
tree6dbab18b568dcd60f2556bc53b2d21bbaa2c99e7
parent6ac99ebb3f623c64379f5c6811f1cdeb6ecac7da (diff)
downloademacs-4509aaa5b0666a120fb1e255d52d83d03c46c596.tar.gz
emacs-4509aaa5b0666a120fb1e255d52d83d03c46c596.tar.bz2
emacs-4509aaa5b0666a120fb1e255d52d83d03c46c596.zip
New variable tab-bar-position
* lisp/cus-start.el: Add customization for tab-bar-position. * src/dispnew.c (syms_of_display): New variable Vtab_bar_position. (adjust_frame_glyphs_for_window_redisplay): Use it.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/cus-start.el6
-rw-r--r--src/dispnew.c17
3 files changed, 21 insertions, 4 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d06f0a59528..d6a7231474e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2134,6 +2134,8 @@ disabled: by default, they enable tab-bar-mode in that case.
The X resource "tabBar", class "TabBar" enables the tab bar
when its value is "on", "yes" or "1".
+The variable 'tab-bar-position' specifies where to show the tab bar.
+
Read the new Info node "(emacs) Tab Bars" for full description
of all related features.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 89a96a9f51c..d1278192ef7 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -591,6 +591,12 @@ since it could result in memory overflow and make Emacs crash."
(const :tag "Text-image-horiz" :value text-image-horiz)
(const :tag "System default" :value nil)) "24.1")
(tool-bar-max-label-size frames integer "24.1")
+ (tab-bar-position tab-bar boolean "27.1"
+ :set (lambda (sym val)
+ (set-default sym val)
+ ;; Redraw the bars:
+ (tab-bar-mode -1)
+ (tab-bar-mode 1)))
(auto-hscroll-mode scrolling
(choice
(const :tag "Don't scroll automatically"
diff --git a/src/dispnew.c b/src/dispnew.c
index 4dd5ee2a1e0..4cdc76f5bcf 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -2166,8 +2166,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
w->pixel_left = 0;
w->left_col = 0;
- w->pixel_top = FRAME_MENU_BAR_HEIGHT (f);
- w->top_line = FRAME_MENU_BAR_LINES (f);
+ w->pixel_top = FRAME_MENU_BAR_HEIGHT (f)
+ + (!NILP (Vtab_bar_position) ? FRAME_TOOL_BAR_HEIGHT (f) : 0);
+ w->top_line = FRAME_MENU_BAR_LINES (f)
+ + (!NILP (Vtab_bar_position) ? FRAME_TOOL_BAR_LINES (f) : 0);
w->total_cols = FRAME_TOTAL_COLS (f);
w->pixel_width = (FRAME_PIXEL_WIDTH (f)
- 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
@@ -2196,8 +2198,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
w->pixel_left = 0;
w->left_col = 0;
- w->pixel_top = FRAME_MENU_BAR_HEIGHT (f) + FRAME_TAB_BAR_HEIGHT (f);
- w->top_line = FRAME_MENU_BAR_LINES (f) + FRAME_TAB_BAR_LINES (f);
+ w->pixel_top = FRAME_MENU_BAR_HEIGHT (f)
+ + (NILP (Vtab_bar_position) ? FRAME_TAB_BAR_HEIGHT (f) : 0);
+ w->top_line = FRAME_MENU_BAR_LINES (f)
+ + (NILP (Vtab_bar_position) ? FRAME_TAB_BAR_LINES (f) : 0);
w->total_cols = FRAME_TOTAL_COLS (f);
w->pixel_width = (FRAME_PIXEL_WIDTH (f)
- 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
@@ -6569,6 +6573,11 @@ See `buffer-display-table' for more information. */);
beginning of the next redisplay). */
redisplay_dont_pause = true;
+ DEFVAR_LISP ("tab-bar-position", Vtab_bar_position,
+ doc: /* Specify on which side from the tool bar the tab bar shall be.
+Possible values are `t' (below the tool bar), `nil' (above the tool bar).
+This option affects only builds where the tool bar is not external. */);
+
pdumper_do_now_and_after_load (syms_of_display_for_pdumper);
}