emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 097a03d: Enable tab-bar-mode from X resources


From: Juri Linkov
Subject: [Emacs-diffs] master 097a03d: Enable tab-bar-mode from X resources
Date: Sun, 13 Oct 2019 16:56:25 -0400 (EDT)

branch: master
commit 097a03d2a372c1285696779c7051d5b044d437f5
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    Enable tab-bar-mode from X resources
    
    * 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     |  6 +++---
 doc/emacs/xresources.texi  |  5 +++++
 doc/lispref/internals.texi |  4 ++--
 doc/man/emacs.1.in         |  5 ++++-
 etc/NEWS                   | 19 +++++++++++--------
 lisp/startup.el            | 12 ++++++++----
 6 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 2b403b4..fa28c3e 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -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
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index d8b70ef..e349d40 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -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
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index ab38516..e9fcbf4 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -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
diff --git a/doc/man/emacs.1.in b/doc/man/emacs.1.in
index 25c32e0..5fe12ae 100644
--- a/doc/man/emacs.1.in
+++ b/doc/man/emacs.1.in
@@ -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
diff --git a/etc/NEWS b/etc/NEWS
index 5b3dabe..ada7af3 100644
--- 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.
 
diff --git a/lisp/startup.el b/lisp/startup.el
index 48b4834..30f1a25 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]