]> git.eshelyaron.com Git - emacs.git/commitdiff
Enable tab-bar-mode from X resources
authorJuri Linkov <juri@linkov.net>
Sun, 13 Oct 2019 20:56:17 +0000 (23:56 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 13 Oct 2019 20:56:17 +0000 (23:56 +0300)
* lisp/startup.el (x-apply-session-resources): Enable tab-bar-mode
when X resource "tabBar" class "TabBar" is "on", "yes" or "1".

* doc/man/emacs.1.in:
* doc/emacs/xresources.texi (Table of Resources):
Document X resource "tabBar" (class "TabBar").

doc/emacs/cmdargs.texi
doc/emacs/xresources.texi
doc/lispref/internals.texi
doc/man/emacs.1.in
etc/NEWS
lisp/startup.el

index 2b403b4a33e60aecc5be8c6328adf3252a41c576..fa28c3eabcb7447a614200b3014ea228aa75d7df 100644 (file)
@@ -1237,9 +1237,9 @@ Disable the blinking cursor on graphical displays.
 @opindex -D
 @itemx --basic-display
 @opindex --basic-display
-Disable the menu-bar, the tool-bar, the scroll-bars, and tool tips,
-and turn off the blinking cursor.  This can be useful for making a
-test case that simplifies debugging of display problems.
+Disable the menu-bar, the tool-bar, the scroll-bars, tool tips, and
+font-lock-mode, and turn off the blinking cursor.  This can be useful
+for making a test case that simplifies debugging of display problems.
 @end table
 
   The @samp{--xrm} option (@pxref{Resources}) specifies additional
index d8b70ef90098389b40a551aafcbd8ae9a6aa609e..e349d40333f366b11b8ea6da8aa47a6e933e6f31 100644 (file)
@@ -319,6 +319,11 @@ Name to display in the title bar of the initial Emacs frame.
 If the value of this resource is @samp{off} or @samp{false} or
 @samp{0}, Emacs disables Tool Bar mode at startup (@pxref{Tool Bars}).
 
+@item @code{tabBar} (class @code{TabBar})
+@cindex tab bar
+If the value of this resource is @samp{on} or @samp{yes} or
+@samp{1}, Emacs enables Tab Bar mode at startup (@pxref{Tab Bars}).
+
 @item @code{useXIM} (class @code{UseXIM})
 @cindex XIM
 @cindex X input methods
index ab385168af2518bae863c8d0b6bba8ccc4659112..e9fcbf48cb4a4c8a14ef7ac3bd8225b2af799f8f 100644 (file)
@@ -2324,8 +2324,8 @@ minibuffer or the echo area.
 Non-zero if this window is a @dfn{pseudo window}.  A pseudo window is
 either a window used to display the menu bar or the tool bar (when
 Emacs uses toolkits that don't display their own menu bar and tool
-bar) or a window showing a tooltip on a tooltip frame.  Pseudo windows
-are in general not accessible from Lisp code.
+bar) or the tab bar or a window showing a tooltip on a tooltip frame.
+Pseudo windows are in general not accessible from Lisp code.
 
 @item parent
 Internally, Emacs arranges windows in a tree; each group of siblings
index 25c32e018a01e700ef3f4e734a5857bb5760353a..5fe12aed95d3f4bb417e72f88ee4b06c94fe161e 100644 (file)
@@ -284,7 +284,7 @@ frames is a width of 80 and a height between 35 and 40, depending on
 the OS and the window manager.
 See the Emacs manual, section "Options for Window Size and Position",
 for information on how window sizes interact
-with selecting or deselecting the tool bar and menu bar.
+with selecting or deselecting the tool bar, tab bar and menu bar.
 .TP
 .BI \-lsp " pixels\fR,\fP " \-\-line\-spacing= "pixels"
 Additional space to put between lines.
@@ -517,6 +517,9 @@ window.
 .BR toolBar " (class " ToolBar )
 Number of lines to reserve for the tool bar.
 .TP
+.BR tabBar " (class " TabBar )
+Number of lines to reserve for the tab bar.
+.TP
 .BR useXIM " (class " UseXIM )
 Turns off use of X input methods (XIM) if
 .I false
index 5b3dabe22ac1d17bc83b72b8c7edc9399b570df3..ada7af374694c53acd9c3f491fed2313336b207a 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2089,8 +2089,8 @@ file-local variable, you may need to update the value.
 ** Tab Bars
 
 +++
-*** Tab-Bar mode
-The new command 'tab-bar-mode' enables the tab-bar at the top of each
+*** Tab Bar mode
+The new command 'tab-bar-mode' enables the tab bar at the top of each
 frame, where you can use tabs to switch between named persistent
 window configurations.
 
@@ -2101,20 +2101,23 @@ edit file in another tab; and 'C-TAB' and 'S-C-TAB' switch to the next
 or previous tab.  You can also switch between tabs and create/delete
 tabs with a mouse.
 
-Tab-related commands are available even when the Tab-Bar mode is
-disabled: by default, they enable Tab-Bar mode in that case.
+Tab-related commands are available even when the tab-bar-mode is
+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".
 
 Read the new Info node "(emacs) Tab Bars" for full description
 of all related features.
 
-*** Tab-Line mode
-The new command 'global-tab-line-mode' enables the tab-line above each
+*** Tab Line mode
+The new command 'global-tab-line-mode' enables the tab line above each
 window, which you can use to switch buffers in the window.  Selecting
 the previous window-local tab is the same as typing 'C-x <LEFT>'
 (previous-buffer), selecting the next tab is the same as 'C-x <RIGHT>'
 (next-buffer).  Clicking on the plus icon adds a new buffer to the
-window-local tab-line of buffers.  Using the mouse wheel on the
-tab-line scrolls tabs that display the window buffers.
+window-local tab line of buffers.  Using the mouse wheel on the
+tab line scrolls tabs that display the window buffers.
 
 ** fileloop.el lets one setup multifile operations like search&replace.
 
index 48b483415a30f415b18a532dfdac141845741d0f..30f1a253ee65371f3441b43729d02346983cbc91 100644 (file)
@@ -1512,18 +1512,22 @@ as `x-initialize-window-system' for X, either at startup (prior
 to reading the init file), or afterwards when the user first
 opens a graphical frame.
 
-This can set the values of `menu-bar-mode', `tool-bar-mode', and
-`no-blinking-cursor', as well as the `cursor' face.  Changed
-settings will be marked as \"CHANGED outside of Customize\"."
+This can set the values of `menu-bar-mode', `tool-bar-mode',
+`tab-bar-mode', and `no-blinking-cursor', as well as the `cursor' face.
+Changed settings will be marked as \"CHANGED outside of Customize\"."
   (let ((no-vals  '("no" "off" "false" "0"))
        (settings '(("menuBar" "MenuBar" menu-bar-mode nil)
-                   ("tabBar" "TabBar" tab-bar-mode nil)
                    ("toolBar" "ToolBar" tool-bar-mode nil)
                    ("scrollBar" "ScrollBar" scroll-bar-mode nil)
                    ("cursorBlink" "CursorBlink" no-blinking-cursor t))))
     (dolist (x settings)
       (if (member (x-get-resource (nth 0 x) (nth 1 x)) no-vals)
          (set (nth 2 x) (nth 3 x)))))
+  (let ((yes-vals  '("yes" "on" "true" "1"))
+       (settings '(("tabBar" "TabBar" tab-bar-mode 1))))
+    (dolist (x settings)
+      (if (member (x-get-resource (nth 0 x) (nth 1 x)) yes-vals)
+         (funcall (nth 2 x) (nth 3 x)))))
   (let ((color (x-get-resource "cursorColor" "Foreground")))
     (when color
       (put 'cursor 'theme-face