aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJared Finder2024-06-08 17:23:58 -0700
committerEli Zaretskii2024-06-09 15:21:34 +0300
commita5c0d682b10fa60925641c6abc3a5dbee024fa46 (patch)
treed8ad62800a6d19bc37b5dc03f3ca87d4df930d3b /doc
parent7f8ded2a85d551c6e3303eaca1697bbd7b9427ef (diff)
downloademacs-a5c0d682b10fa60925641c6abc3a5dbee024fa46.tar.gz
emacs-a5c0d682b10fa60925641c6abc3a5dbee024fa46.zip
Add documentation for window-tool-bar package
Also change window-tool-mode to not pay attention to if tool-bar-map has a buffer local value or not as that made the documentation complicated. Documentation added in Emacs manual, Elisp manual, package commentary, and docstrings. Also extend window-tool-bar support to Emacs 27 and newer. (bug#68765) * doc/emacs/emacs.texi (Top): * doc/emacs/frames.texi (Menu Bars): * doc/emacs/glossary.texi (Glossary): * doc/emacs/modes.texi (Minor Modes): * doc/emacs/windows.texi (Windows, Tab Line): Mention Window Tool Bar. (Window Tool Bar): New documentation. * doc/lispref/elisp.texi (Top): * doc/lispref/modes.texi (Mode Line Format, Mode Line Basics) (Mode Line Data): Mention Tab Lines. (Tab Lines): New documentation. * etc/NEWS: Mention newly added variable and package. * lisp/window-tool-bar.el (window-tool-bar-mode): Don't display tool bar when tool-bar-map is nil. * lisp/window-tool-bar.el (tool-bar-always-show-default): Define variable for older Emacs versions.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/emacs.texi1
-rw-r--r--doc/emacs/frames.texi14
-rw-r--r--doc/emacs/glossary.texi10
-rw-r--r--doc/emacs/modes.texi3
-rw-r--r--doc/emacs/windows.texi43
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/modes.texi56
7 files changed, 106 insertions, 22 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 7d77f13ab21..8246041fb95 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -529,6 +529,7 @@ Multiple Windows
529* Temporary Displays:: Displaying non-editable buffers. 529* Temporary Displays:: Displaying non-editable buffers.
530* Window Convenience:: Convenience functions for window handling. 530* Window Convenience:: Convenience functions for window handling.
531* Tab Line:: Window tab line. 531* Tab Line:: Window tab line.
532* Window Tool Bar:: A tool bar that is attached to windows.
532 533
533Displaying a Buffer in a Window 534Displaying a Buffer in a Window
534 535
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 6c62fde4ffb..e1fbf9768af 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1295,16 +1295,22 @@ menus' visual appearance.
1295@node Tool Bars 1295@node Tool Bars
1296@section Tool Bars 1296@section Tool Bars
1297@cindex tool bar mode 1297@cindex tool bar mode
1298@cindex tool bar, attached to frame
1298@cindex mode, Tool Bar 1299@cindex mode, Tool Bar
1299@cindex icons, toolbar 1300@cindex icons, toolbar
1300 1301
1301 On graphical displays, Emacs puts a @dfn{tool bar} at the top of 1302 On graphical displays, Emacs puts a @dfn{tool bar} at the top of each
1302each frame, just below the menu bar. This is a row of icons which you 1303frame, just below the menu bar. This is a row of buttons with icons
1303can click on with the mouse to invoke various commands. 1304which you can click on with the mouse to invoke various commands. Emacs
1305can also optionally display a tool bar at the top of each window
1306(@pxref{Window Tool Bar}).
1304 1307
1308@vindex tool-bar-always-show-default
1305 The global (default) tool bar contains general commands. Some major 1309 The global (default) tool bar contains general commands. Some major
1306modes define their own tool bars; whenever a buffer with such a major 1310modes define their own tool bars; whenever a buffer with such a major
1307mode is current, the mode's tool bar replaces the global tool bar. 1311mode is current, the mode's tool bar replaces the global tool bar. To
1312prevent this replacement from happening, customize the variable
1313@code{tool-bar-always-show-default}.
1308 1314
1309@findex tool-bar-mode 1315@findex tool-bar-mode
1310@vindex tool-bar-mode 1316@vindex tool-bar-mode
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index 344e4831f36..e245cb81754 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -1436,10 +1436,12 @@ particular appearance or behavior. For example, you might use a theme
1436for your favorite set of faces (q.v.). 1436for your favorite set of faces (q.v.).
1437 1437
1438@item Tool Bar 1438@item Tool Bar
1439The tool bar is a line (sometimes multiple lines) of icons at the top 1439The tool bar is a line (sometimes multiple lines) of buttons with icons
1440of an Emacs frame. Clicking on one of these icons executes a command. 1440at the top of an Emacs frame. Clicking on one of these buttons executes
1441You can think of this as a graphical relative of the menu bar (q.v.). 1441a command. You can think of this as a graphical relative of the menu
1442@xref{Tool Bars}. 1442bar (q.v.). @xref{Tool Bars}. There is also a window tool bar that
1443behaves similarly, but is at the top of an Emacs window. @xref{Window
1444Tool Bar}.
1443 1445
1444@anchor{Glossary---Tooltips} 1446@anchor{Glossary---Tooltips}
1445@item Tooltips 1447@item Tooltips
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index 2776dc72a27..1321464014d 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -296,6 +296,9 @@ but the tool bar is only displayed on graphical terminals. @xref{Tool
296Bars}. 296Bars}.
297 297
298@item 298@item
299Window Tool Bar mode gives windows a tool bar. @xref{Window Tool Bar}.
300
301@item
299Tab Bar mode gives each frame a tab bar. @xref{Tab Bars}. 302Tab Bar mode gives each frame a tab bar. @xref{Tab Bars}.
300 303
301@item 304@item
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi
index ad2225b5922..80394e0e571 100644
--- a/doc/emacs/windows.texi
+++ b/doc/emacs/windows.texi
@@ -22,6 +22,7 @@ one frame.
22* Displaying Buffers:: How Emacs picks a window for displaying a buffer. 22* Displaying Buffers:: How Emacs picks a window for displaying a buffer.
23* Window Convenience:: Convenience functions for window handling. 23* Window Convenience:: Convenience functions for window handling.
24* Tab Line:: Window tab line. 24* Tab Line:: Window tab line.
25* Window Tool Bar:: A tool bar that is attached to windows.
25@end menu 26@end menu
26 27
27@node Basic Window 28@node Basic Window
@@ -689,3 +690,45 @@ Whereas tabs on the Tab Bar at the top of each frame are used to
689switch between window configurations containing several windows with buffers, 690switch between window configurations containing several windows with buffers,
690tabs on the Tab Line at the top of each window are used to switch 691tabs on the Tab Line at the top of each window are used to switch
691between buffers in the window. 692between buffers in the window.
693
694Also note that the tab line displays in the same space as the window
695tool bar, so only one of these can be display at a time unless you
696customize the value of @code{tab-line-format} in Lisp. In this case,
697add @code{(:eval (tab-line-format))} to @code{tab-line-format}.
698@xref{Mode Line Format,,, elisp, The Emacs Lisp Reference Manual}.
699
700
701@node Window Tool Bar
702@section Window Tool Bar
703
704@cindex window tool bar
705@cindex mode, window tool bar
706@cindex tool bar, attached to window
707
708@findex global-window-tool-bar-mode
709 The command @code{global-window-tool-bar-mode} toggles the display of
710a tool bar at the top of each window. When enabled, multiple windows
711can display their own tool bar simultaneously. To conserve space, a
712window tool bar is hidden if there are no buttons to show, i.e. if
713@code{tool-bar-map} is @code{nil}.
714
715@findex window-tool-bar-mode
716If you want to toggle the display of a window tool bar for only some
717buffers, run the command @code{window-tool-bar-mode} in those buffers.
718This is useful to put in a mode hook. For example, if you want the window
719tool bar to appear only for buffers that do not represent files and have
720a custom tool bar, you could add the following code to your init file
721(@pxref{Init File}):
722
723@example
724(add-hook 'special-mode-hook 'window-tool-bar-mode)
725@end example
726
727Emacs can also display a single tool bar at the top of frames
728(@pxref{Tool Bars}).
729
730Note that the window tool bar displays in the same space as the tab
731line, so only one of these can be display at a time unless you customize
732the value of @code{tab-line-format} in Lisp. In this case, add
733@code{(:eval (window-tool-bar-string))} to @code{tab-line-format}.
734@xref{Mode Line Format,,, elisp, The Emacs Lisp Reference Manual}.
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 339272d1f05..1059d0dcf61 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -925,6 +925,7 @@ Mode Line Format
925* %-Constructs:: Putting information into a mode line. 925* %-Constructs:: Putting information into a mode line.
926* Properties in Mode:: Using text properties in the mode line. 926* Properties in Mode:: Using text properties in the mode line.
927* Header Lines:: Like a mode line, but at the top. 927* Header Lines:: Like a mode line, but at the top.
928* Tab Lines:: A line that is above the header line.
928* Emulating Mode Line:: Formatting text as the mode line would. 929* Emulating Mode Line:: Formatting text as the mode line would.
929 930
930Font Lock Mode 931Font Lock Mode
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index cf67b319924..f3d4f5347b3 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2074,14 +2074,14 @@ their previous values/states (using the companion function
2074line at the bottom, which displays status information about the buffer 2074line at the bottom, which displays status information about the buffer
2075displayed in the window. The mode line contains information about the 2075displayed in the window. The mode line contains information about the
2076buffer, such as its name, associated file, depth of recursive editing, 2076buffer, such as its name, associated file, depth of recursive editing,
2077and major and minor modes. A window can also have a @dfn{header 2077and major and minor modes. A window can also have a @dfn{header line}
2078line}, which is much like the mode line but appears at the top of the 2078and a @dfn{tab line}, which are much like the mode line but they appear
2079window. 2079at the top of the window.
2080 2080
2081 This section describes how to control the contents of the mode line 2081 This section describes how to control the contents of the mode line,
2082and header line. We include it in this chapter because much of the 2082header line, and tab line. We include it in this chapter because much
2083information displayed in the mode line relates to the enabled major and 2083of the information displayed in the mode line relates to the enabled
2084minor modes. 2084major and minor modes.
2085 2085
2086@menu 2086@menu
2087* Base: Mode Line Basics. Basic ideas of mode line control. 2087* Base: Mode Line Basics. Basic ideas of mode line control.
@@ -2091,6 +2091,7 @@ minor modes.
2091* %-Constructs:: Putting information into a mode line. 2091* %-Constructs:: Putting information into a mode line.
2092* Properties in Mode:: Using text properties in the mode line. 2092* Properties in Mode:: Using text properties in the mode line.
2093* Header Lines:: Like a mode line, but at the top. 2093* Header Lines:: Like a mode line, but at the top.
2094* Tab Lines:: A line that is above the header line.
2094* Emulating Mode Line:: Formatting text as the mode line would. 2095* Emulating Mode Line:: Formatting text as the mode line would.
2095@end menu 2096@end menu
2096 2097
@@ -2101,11 +2102,13 @@ minor modes.
2101variable @code{mode-line-format} (@pxref{Mode Line Top}). This variable 2102variable @code{mode-line-format} (@pxref{Mode Line Top}). This variable
2102holds a @dfn{mode line construct}: a template that controls what is 2103holds a @dfn{mode line construct}: a template that controls what is
2103displayed on the buffer's mode line. The value of 2104displayed on the buffer's mode line. The value of
2104@code{header-line-format} specifies the buffer's header line in the same 2105@code{header-line-format} and @code{tab-line-format} specifies the
2105way. All windows for the same buffer use the same 2106buffer's header line and tab line in the same way. All windows for the
2106@code{mode-line-format} and @code{header-line-format} unless a 2107same buffer use the same @code{mode-line-format},
2107@code{mode-line-format} or @code{header-line-format} parameter has been 2108@code{header-line-format}, and @code{tab-line-format} unless a
2108specified for that window (@pxref{Window Parameters}). 2109@code{mode-line-format}, @code{header-line-format}, or
2110@code{tab-line-format} parameter has been specified for that window
2111(@pxref{Window Parameters}).
2109 2112
2110 For efficiency, Emacs does not continuously recompute each window's 2113 For efficiency, Emacs does not continuously recompute each window's
2111mode line and header line. It does so when circumstances appear to call 2114mode line and header line. It does so when circumstances appear to call
@@ -2167,8 +2170,8 @@ buffers.
2167@dfn{mode line construct}, made up of lists, strings, symbols, and 2170@dfn{mode line construct}, made up of lists, strings, symbols, and
2168numbers kept in buffer-local variables. Each data type has a specific 2171numbers kept in buffer-local variables. Each data type has a specific
2169meaning for the mode line appearance, as described below. The same data 2172meaning for the mode line appearance, as described below. The same data
2170structure is used for constructing frame titles (@pxref{Frame Titles}) 2173structure is used for constructing frame titles (@pxref{Frame Titles}),
2171and header lines (@pxref{Header Lines}). 2174header lines (@pxref{Header Lines}), and tab lines (@pxref{Tab Lines}).
2172 2175
2173 A mode line construct may be as simple as a fixed string of text, 2176 A mode line construct may be as simple as a fixed string of text,
2174but it usually specifies how to combine fixed strings with variables' 2177but it usually specifies how to combine fixed strings with variables'
@@ -2816,6 +2819,31 @@ window that is two lines tall cannot display both a mode line and a
2816header line at once; if it has a mode line, then it does not display a 2819header line at once; if it has a mode line, then it does not display a
2817header line. 2820header line.
2818 2821
2822@node Tab Lines
2823@subsection Window Tab Lines
2824@cindex tab line (of a window)
2825@cindex window tab line
2826
2827 A window can have a @dfn{tab line} at the top. If both the tab line
2828and header line are visible, the tab line appears above the header line.
2829The tab line feature is controlled like the mode line feature, except
2830that it's controlled by @code{tab-line-format}. Unlike the mode line,
2831the tab line is only expected to be used to display a list of tabs
2832(@pxref{Tab Line,,, emacs, The GNU Emacs Manual}) or the window
2833tool bar (@pxref{Window Tool Bar,,, emacs, The GNU Emacs Manual}):
2834
2835@defvar tab-line-format
2836This variable, local in every buffer, specifies how to display the tab
2837line, for windows displaying the buffer. The format of the value is the
2838same as for @code{mode-line-format} (@pxref{Mode Line Data}). It is
2839normally @code{nil}, so that ordinary buffers have no tab line.
2840@end defvar
2841
2842@defun window-tab-line-height &optional window
2843This function returns the height in pixels of @var{window}'s tab line.
2844@var{window} must be a live window, and defaults to the selected window.
2845@end defun
2846
2819@node Emulating Mode Line 2847@node Emulating Mode Line
2820@subsection Emulating Mode Line Formatting 2848@subsection Emulating Mode Line Formatting
2821 2849