aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2014-03-09 12:36:51 +0100
committerMartin Rudalics2014-03-09 12:36:51 +0100
commit7e940b654669e8b1f4fc92ef541c165f68873248 (patch)
tree846f832b899356a1f77c1b89b2b4a144c2f37d51 /doc
parente7db54476d83d155fffb25fdec89f09224970a44 (diff)
downloademacs-7e940b654669e8b1f4fc92ef541c165f68873248.tar.gz
emacs-7e940b654669e8b1f4fc92ef541c165f68873248.zip
Update docs for window dividers and `window-text-pixel-size'.
* xdisp.c (Fwindow_text_pixel_size): Adjust doc-string. * elisp.texi (Top): Rename section "Width" to "Size of Displayed Text". * text.texi (Primitive Indent): * strings.texi (String Basics): * sequences.texi (Sequence Functions): Update references accordingly. * display.texi (Size of Displayed Text): Rename section from "Width". Add description for `window-text-pixel-size'. (Window Dividers): Reword description of window dividers. * frames.texi (Layout Parameters): Improve description of window divider parameters. * windows.texi (Window Sizes): Add descriptions of `window-mode-line-height' and `window-header-line-height'. (Coordinates and Windows): Mention window dividers.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog17
-rw-r--r--doc/lispref/display.texi105
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/frames.texi12
-rw-r--r--doc/lispref/sequences.texi6
-rw-r--r--doc/lispref/strings.texi14
-rw-r--r--doc/lispref/text.texi2
-rw-r--r--doc/lispref/windows.texi54
8 files changed, 168 insertions, 44 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 88a20fd8a2a..93153a1ecb6 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,20 @@
12014-03-09 Martin Rudalics <rudalics@gmx.at>
2
3 * elisp.texi (Top): Rename section "Width" to "Size of Displayed
4 Text".
5 * text.texi (Primitive Indent):
6 * strings.texi (String Basics):
7 * sequences.texi (Sequence Functions): Update references
8 accordingly.
9 * display.texi (Size of Displayed Text): Rename section from
10 "Width". Add description for `window-text-pixel-size'.
11 (Window Dividers): Reword description of window dividers.
12 * frames.texi (Layout Parameters): Improve description of window
13 divider parameters.
14 * windows.texi (Window Sizes): Add descriptions of
15 `window-mode-line-height' and `window-header-line-height'.
16 (Coordinates and Windows): Mention window dividers.
17
12014-03-07 Martin Rudalics <rudalics@gmx.at> 182014-03-07 Martin Rudalics <rudalics@gmx.at>
2 19
3 * buffers.texi (The Buffer List): Rename node to Buffer List. 20 * buffers.texi (The Buffer List): Rename node to Buffer List.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 56dd7185886..bffb840bfeb 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -18,7 +18,7 @@ that Emacs presents to the user.
18* Selective Display:: Hiding part of the buffer text (the old way). 18* Selective Display:: Hiding part of the buffer text (the old way).
19* Temporary Displays:: Displays that go away automatically. 19* Temporary Displays:: Displays that go away automatically.
20* Overlays:: Use overlays to highlight parts of the buffer. 20* Overlays:: Use overlays to highlight parts of the buffer.
21* Width:: How wide a character or string is on the screen. 21* Size of Displayed Text:: How large displayed text is.
22* Line Height:: Controlling the height of lines. 22* Line Height:: Controlling the height of lines.
23* Faces:: A face defines a graphics style for text characters: 23* Faces:: A face defines a graphics style for text characters:
24 font, colors, etc. 24 font, colors, etc.
@@ -1765,8 +1765,8 @@ changes.
1765 (point))) 1765 (point)))
1766@end smallexample 1766@end smallexample
1767 1767
1768@node Width 1768@node Size of Displayed Text
1769@section Width 1769@section Size of Displayed Text
1770 1770
1771Since not all characters have the same width, these functions let you 1771Since not all characters have the same width, these functions let you
1772check the width of a character. @xref{Primitive Indent}, and 1772check the width of a character. @xref{Primitive Indent}, and
@@ -1823,6 +1823,54 @@ to or less than the display width of @var{ellipsis}. If
1823@end example 1823@end example
1824@end defun 1824@end defun
1825 1825
1826The following function returns the size in pixels of text as if it were
1827displayed in a given window. This function is used by
1828@code{fit-window-to-buffer} (@pxref{Resizing Windows}) and
1829@code{fit-frame-to-buffer} (@pxref{Size and Position}) to make a window
1830exactly as large as the text it contains.
1831
1832@defun window-text-pixel-size &optional window from to x-limit y-limit mode-and-header-line
1833This function returns the size of the text of @var{window}'s buffer in
1834pixels. @var{window} must be a live window and defaults to the selected
1835one. The return value is a cons of the maximum pixel-width of any text
1836line and the maximum pixel-height of all text lines.
1837
1838The optional argument @var{from}, if non-@code{nil}, specifies the first
1839text position to consider and defaults to the minimum accessible
1840position of the buffer. If @var{from} is @code{t}, it uses the minimum
1841accessible position that is not a newline character. The optional
1842argument @var{to}, if non-@code{nil}, specifies the last text position
1843to consider and defaults to the maximum accessible position of the
1844buffer. If @var{to} is @code{t}, it uses the maximum accessible
1845position that is not a newline character.
1846
1847The optional argument @var{x-limit}, if non-@code{nil}, specifies the
1848maximum pixel-width that can be returned. @var{x-limit} @code{nil} or
1849omitted, means to use the pixel-width of @var{window}'s body
1850(@pxref{Window Sizes}); this is useful when the caller does not intend
1851to change the width of @var{window}. Otherwise, the caller should
1852specify here the maximum width @var{window}'s body may assume. Text
1853whose x-coordinate is beyond @var{x-limit} is ignored. Since
1854calculating the width of long lines can take some time, it's always a
1855good idea to make this argument as small as needed; in particular, if
1856the buffer might contain long lines that will be truncated anyway.
1857
1858The optional argument @var{y-limit}, if non-@code{nil}, specifies the
1859maximum pixel-height that can be returned. Text lines whose
1860y-coordinate is beyond @var{y-limit} are ignored. Since calculating the
1861pixel-height of a large buffer can take some time, it makes sense to
1862specify this argument; in particular, if the caller does not know the
1863size of the buffer.
1864
1865The optional argument @var{mode-and-header-line} @code{nil} or omitted
1866means to not include the height of the mode- or header-line of
1867@var{window} in the return value. If it is either the symbol
1868@code{mode-line} or @code{header-line}, include only the height of that
1869line, if present, in the return value. If it is @code{t}, include the
1870height of both, if present, in the return value.
1871@end defun
1872
1873
1826@node Line Height 1874@node Line Height
1827@section Line Height 1875@section Line Height
1828@cindex line height 1876@cindex line height
@@ -3904,28 +3952,28 @@ to use the value specified by the frame.
3904@cindex bottom dividers 3952@cindex bottom dividers
3905 3953
3906Window dividers are bars drawn between a frame's windows. A ``right'' 3954Window dividers are bars drawn between a frame's windows. A ``right''
3907divider is drawn between a window and its sibling(s) on the right. Its 3955divider is drawn between a window and any adjacent windows on the right.
3908width is specified by the frame parameter @code{right-divider-width}. A 3956Its width (thickness) is specified by the frame parameter
3909``bottom'' divider is drawn between a window and its sibling(s) on the 3957@code{right-divider-width}. A ``bottom'' divider is drawn between a
3910bottom or the echo area. Its width is specified by the frame parameter 3958window and adjacent windows on the bottom or the echo area. Its width
3911@code{bottom-divider-width}. In either case, specifying a width of zero 3959is specified by the frame parameter @code{bottom-divider-width}. In
3912means to not draw such dividers. @xref{Layout Parameters}. 3960either case, specifying a width of zero means to not draw such dividers.
3961@xref{Layout Parameters}.
3913 3962
3914 Technically, a right divider ``belongs'' to the window on its left, 3963 Technically, a right divider ``belongs'' to the window on its left,
3915which means that its width is part of the total width of that window. A 3964which means that its width contributes to the total width of that
3916bottom divider ``belongs'' to the window above it, which means that its 3965window. A bottom divider ``belongs'' to the window above it, which
3917height is part of the total height of that window. @xref{Window Sizes}. 3966means that its width contributes to the total height of that window.
3918When a window has both, a right and a bottom divider, the bottom divider 3967@xref{Window Sizes}. When a window has both, a right and a bottom
3919``prevails''. This means that the width of the bottom divider equals 3968divider, the bottom divider ``prevails''. This means that a bottom
3920the total width of the window while the height of the right divider 3969divider is drawn over the full total width of its window while the right
3921equals the total height of the window minus the height of the bottom 3970divider ends above the bottom divider.
3922divider.
3923 3971
3924 Dividers can be dragged with the mouse and are therefore useful for 3972 Dividers can be dragged with the mouse and are therefore useful for
3925adjusting the sizes of adjacent windows with the mouse. They also serve 3973adjusting the sizes of adjacent windows with the mouse. They also serve
3926to set windows visually apart from their siblings when no scroll bars or 3974to visually set apart adjacent windows when no scroll bars or mode lines
3927mode lines are present. The following three faces allow to customize 3975are present. The following three faces allow to customize the
3928the appearance of dividers: 3976appearance of dividers:
3929 3977
3930@table @code 3978@table @code
3931@item window-divider 3979@item window-divider
@@ -3944,6 +3992,23 @@ least three pixels wide. To obtain a solid appearance, set this to the
3944same value used for the @code{window-divider} face. 3992same value used for the @code{window-divider} face.
3945@end table 3993@end table
3946 3994
3995You can get the sizes of the dividers of a specific window with the
3996following two functions.
3997
3998@defun window-right-divider-width &optional window
3999Return the width (thickness) in pixels of @var{window}'s right divider.
4000@var{window} must be a live window and defaults to the selected one.
4001The return value is always zero for a rightmost window.
4002@end defun
4003
4004@defun window-bottom-divider-width &optional window
4005Return the width (thickness) in pixels of @var{window}'s bottom divider.
4006@var{window} must be a live window and defaults to the selected one.
4007The return value is zero for the minibuffer window or a bottommost
4008window on a minibuffer-less frame.
4009@end defun
4010
4011
3947@node Display Property 4012@node Display Property
3948@section The @code{display} Property 4013@section The @code{display} Property
3949@cindex display specification 4014@cindex display specification
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index f0a55968376..c0040d748c3 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1338,7 +1338,7 @@ Emacs Display
1338* Selective Display:: Hiding part of the buffer text (the old way). 1338* Selective Display:: Hiding part of the buffer text (the old way).
1339* Temporary Displays:: Displays that go away automatically. 1339* Temporary Displays:: Displays that go away automatically.
1340* Overlays:: Use overlays to highlight parts of the buffer. 1340* Overlays:: Use overlays to highlight parts of the buffer.
1341* Width:: How wide a character or string is on the screen. 1341* Size of Displayed Text:: How large displayed text is.
1342* Line Height:: Controlling the height of lines. 1342* Line Height:: Controlling the height of lines.
1343* Faces:: A face defines a graphics style 1343* Faces:: A face defines a graphics style
1344 for text characters: font, colors, etc. 1344 for text characters: font, colors, etc.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 166ec6d8dec..206f14e751e 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -747,15 +747,15 @@ widths are negative, only the left fringe gets the specified width.
747 747
748@vindex right-divider-width, a frame parameter 748@vindex right-divider-width, a frame parameter
749@item right-divider-width 749@item right-divider-width
750The width of the right divider (@pxref{Window Dividers}) of any window 750The width (thickness) reserved for the right divider (@pxref{Window
751on the frame, in pixels. A value of zero means to not draw right 751Dividers}) of any window on the frame, in pixels. A value of zero means
752dividers. 752to not draw right dividers.
753 753
754@vindex bottom-divider-width, a frame parameter 754@vindex bottom-divider-width, a frame parameter
755@item bottom-divider-width 755@item bottom-divider-width
756The width of the bottom divider (@pxref{Window Dividers}) of any window 756The width (thickness) reserved for the bottom divider (@pxref{Window
757on the frame, in pixels. A value of zero means to not draw bottom 757Dividers}) of any window on the frame, in pixels. A value of zero means
758dividers. 758to not draw bottom dividers.
759 759
760@vindex menu-bar-lines frame parameter 760@vindex menu-bar-lines frame parameter
761@item menu-bar-lines 761@item menu-bar-lines
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 52a1cf5e32c..01de4ccb0cd 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -107,9 +107,9 @@ Emacs character code.
107@noindent 107@noindent
108See also @code{string-bytes}, in @ref{Text Representations}. 108See also @code{string-bytes}, in @ref{Text Representations}.
109 109
110If you need to compute the width of a string on display, you should 110If you need to compute the width of a string on display, you should use
111use @code{string-width} (@pxref{Width}), not @code{length}, since 111@code{string-width} (@pxref{Size of Displayed Text}), not @code{length},
112@code{length} only counts the number of characters, but does not 112since @code{length} only counts the number of characters, but does not
113account for the display width of each character. 113account for the display width of each character.
114 114
115@defun elt sequence index 115@defun elt sequence index
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 5c814b22b2d..04e11fec617 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -48,13 +48,13 @@ Vectors}). Unlike in C, Emacs Lisp strings are @emph{not} terminated
48by a distinguished character code. 48by a distinguished character code.
49 49
50 Since strings are arrays, and therefore sequences as well, you can 50 Since strings are arrays, and therefore sequences as well, you can
51operate on them with the general array and sequence functions 51operate on them with the general array and sequence functions documented
52documented in @ref{Sequences Arrays Vectors}. For example, you can 52in @ref{Sequences Arrays Vectors}. For example, you can access or
53access or change individual characters in a string using the functions 53change individual characters in a string using the functions @code{aref}
54@code{aref} and @code{aset} (@pxref{Array Functions}). However, note 54and @code{aset} (@pxref{Array Functions}). However, note that
55that @code{length} should @emph{not} be used for computing the width 55@code{length} should @emph{not} be used for computing the width of a
56of a string on display; use @code{string-width} (@pxref{Width}) 56string on display; use @code{string-width} (@pxref{Size of Displayed
57instead. 57Text}) instead.
58 58
59 There are two text representations for non-@acronym{ASCII} 59 There are two text representations for non-@acronym{ASCII}
60characters in Emacs strings (and in buffers): unibyte and multibyte. 60characters in Emacs strings (and in buffers): unibyte and multibyte.
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 5a38ce1e0d3..d93f937bd81 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -2202,7 +2202,7 @@ count from zero at the left margin.
2202 2202
2203 This section describes the primitive functions used to count and 2203 This section describes the primitive functions used to count and
2204insert indentation. The functions in the following sections use these 2204insert indentation. The functions in the following sections use these
2205primitives. @xref{Width}, for related functions. 2205primitives. @xref{Size of Displayed Text}, for related functions.
2206 2206
2207@defun current-indentation 2207@defun current-indentation
2208@comment !!Type Primitive Function 2208@comment !!Type Primitive Function
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index fb022de546e..3e1cd40c459 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -618,6 +618,29 @@ argument @var{pixelwise} is passed to the function called.
618@code{window-width} is an alias for @code{window-body-width}. These 618@code{window-width} is an alias for @code{window-body-width}. These
619aliases are considered obsolete and will be removed in the future. 619aliases are considered obsolete and will be removed in the future.
620 620
621 The pixel heights of a window's mode and header line can be retrieved
622with the functions given below. Their return value is usually accurate
623unless the window has not been displayed before: In that case, the
624return value is based on an estimate of the font used for the window's
625frame.
626
627@defun window-mode-line-height &optional window
628This function returns the height in pixels of @var{window}'s mode line.
629@var{window} must be a live window and defaults to the selected one. If
630@var{window} has no mode line, the return value is zero.
631@end defun
632
633@defun window-header-line-height &optional window
634This function returns the height in pixels of @var{window}'s header
635line. @var{window} must be a live window and defaults to the selected
636one. If @var{window} has no header line, the return value is zero.
637@end defun
638
639Functions for retrieving the height and/or width of window dividers
640(@pxref{Window Dividers}), fringes (@pxref{Fringes}), scroll bars
641(@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are
642described in the corresponding sections.
643
621@cindex fixed-size window 644@cindex fixed-size window
622@vindex window-min-height 645@vindex window-min-height
623@vindex window-min-width 646@vindex window-min-width
@@ -3476,18 +3499,18 @@ coordinate of the topmost row, the X coordinate one column to the
3476right of the rightmost column, and the Y coordinate one row down from 3499right of the rightmost column, and the Y coordinate one row down from
3477the bottommost row. 3500the bottommost row.
3478 3501
3479Note that these are the actual outer edges of the window, including 3502Note that these are the actual outer edges of the window, including any
3480any header line, mode line, scroll bar, fringes, and display margins. 3503header line, mode line, scroll bar, fringes, window divider and display
3481On a text terminal, if the window has a neighbor on its right, its 3504margins. On a text terminal, if the window has a neighbor on its right,
3482right edge includes the separator line between the window and its 3505its right edge includes the separator line between the window and its
3483neighbor. 3506neighbor.
3484@end defun 3507@end defun
3485 3508
3486@defun window-inside-edges &optional window 3509@defun window-inside-edges &optional window
3487This function is similar to @code{window-edges}, but the returned edge 3510This function is similar to @code{window-edges}, but the returned edge
3488values are for the text area of the window. They exclude any header 3511values are for the text area of the window. They exclude any header
3489line, mode line, scroll bar, fringes, display margins, and vertical 3512line, mode line, scroll bar, fringes, window divider, display margins,
3490separator. 3513and vertical separator.
3491@end defun 3514@end defun
3492 3515
3493@defun window-top-line &optional window 3516@defun window-top-line &optional window
@@ -3536,6 +3559,14 @@ The coordinates are in the mode line of @var{window}.
3536@item header-line 3559@item header-line
3537The coordinates are in the header line of @var{window}. 3560The coordinates are in the header line of @var{window}.
3538 3561
3562@item right-divider
3563The coordinates are in the divider separating @var{window} from a
3564window on the right.
3565
3566@item right-divider
3567The coordinates are in the divider separating @var{window} from a
3568window beneath.
3569
3539@item vertical-line 3570@item vertical-line
3540The coordinates are in the vertical line between @var{window} and its 3571The coordinates are in the vertical line between @var{window} and its
3541neighbor to the right. This value occurs only if the window doesn't 3572neighbor to the right. This value occurs only if the window doesn't
@@ -3597,6 +3628,17 @@ returns the edge pixel coordinates relative to the top left corner of
3597the display screen. @var{window} must specify a live window. 3628the display screen. @var{window} must specify a live window.
3598@end defun 3629@end defun
3599 3630
3631@defun window-pixel-left &optional window
3632This function returns the left pixel edge of window @var{window}.
3633@var{window} must be a valid window and defaults to the selected one.
3634@end defun
3635
3636@defun window-pixel-top &optional window
3637This function returns the top pixel edge of window @var{window}.
3638@var{window} must be a valid window and defaults to the selected one.
3639@end defun
3640
3641
3600@node Window Configurations 3642@node Window Configurations
3601@section Window Configurations 3643@section Window Configurations
3602@cindex window configurations 3644@cindex window configurations