aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog10
-rw-r--r--doc/lispref/frames.texi215
2 files changed, 171 insertions, 54 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 6b84026d2e5..356560f2576 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,13 @@
12014-10-22 Martin Rudalics <rudalics@gmx.at>
2
3 * frames.texi (Size Parameters): Replace "frame contents" by
4 "frame's text area". Add reference to Size and Position
5 section.
6 (Size and Position): Major rewrite. Add explanations for
7 frame's default font, text and display areas. Add descriptions
8 for `set-frame-font', `frame-text-height', `frame-text-width'
9 and `frame-inhibit-implied-resize'.
10
12014-10-20 Glenn Morris <rgm@gnu.org> 112014-10-20 Glenn Morris <rgm@gnu.org>
2 12
3 * Merge in all changes up to 24.4 release. 13 * Merge in all changes up to 24.4 release.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index a14702a7ce1..146170a967c 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -709,13 +709,13 @@ pixel sizes of these character units (@pxref{Face Attributes}).
709@table @code 709@table @code
710@vindex height, a frame parameter 710@vindex height, a frame parameter
711@item height 711@item height
712The height of the frame contents, in characters. (To get the height in 712The height of the frame's text area (@pxref{Size and Position}), in
713pixels, call @code{frame-pixel-height}; see @ref{Size and Position}.) 713characters.
714 714
715@vindex width, a frame parameter 715@vindex width, a frame parameter
716@item width 716@item width
717The width of the frame contents, in characters. (To get the width in 717The width of the frame's text area (@pxref{Size and Position}), in
718pixels, call @code{frame-pixel-width}; see @ref{Size and Position}.) 718characters.
719 719
720@vindex user-size, a frame parameter 720@vindex user-size, a frame parameter
721@item user-size 721@item user-size
@@ -739,9 +739,9 @@ with the mouse, while the latter really covers the whole screen and
739does not allow resizing by mouse dragging. 739does not allow resizing by mouse dragging.
740 740
741With some window managers you may have to customize the variable 741With some window managers you may have to customize the variable
742@code{frame-resize-pixelwise} to a non-@code{nil} value in order to make 742@code{frame-resize-pixelwise} (@pxref{Size and Position}) to a
743a frame appear ``maximized'' or ``fullscreen''. 743non-@code{nil} value in order to make a frame appear ``maximized'' or
744 744``fullscreen''.
745@end table 745@end table
746 746
747@node Layout Parameters 747@node Layout Parameters
@@ -1136,65 +1136,137 @@ equivalent to the @code{:background} attribute of the
1136@code{scroll-bar} face. 1136@code{scroll-bar} face.
1137@end table 1137@end table
1138 1138
1139
1139@node Size and Position 1140@node Size and Position
1140@subsection Frame Size And Position 1141@subsection Frame Size and Position
1141@cindex size of frame 1142@cindex size of frame
1142@cindex screen size 1143@cindex screen size
1143@cindex frame size 1144@cindex frame size
1144@cindex resize frame 1145@cindex resize frame
1145 1146
1146 You can read or change the size and position of a frame using the 1147You can read or change the size and position of a frame using the frame
1147frame parameters @code{left}, @code{top}, @code{height}, and 1148parameters @code{left}, @code{top}, @code{height}, and @code{width}.
1148@code{width}. Whatever geometry parameters you don't specify are chosen 1149Whatever geometry parameters you don't specify are chosen by the window
1149by the window manager in its usual fashion. 1150manager in its usual fashion.
1150 1151
1151 Here are some special features for working with sizes and positions. 1152 Here are some special features for working with sizes and positions.
1152(For the precise meaning of ``selected frame'' used by these functions, 1153Most of the functions described below use a @var{frame} argument which
1153see @ref{Input Focus}.) 1154has to specify a live frame. If omitted or @code{nil}, it specifies the
1155selected frame, see @ref{Input Focus}.
1154 1156
1155@defun set-frame-position frame left top 1157@defun set-frame-position frame left top
1156This function sets the position of the top left corner of @var{frame} to 1158This function sets the position of the top left corner of @var{frame} to
1157@var{left} and @var{top}. These arguments are measured in pixels, and 1159@var{left} and @var{top}. These arguments are measured in pixels, and
1158normally count from the top left corner of the screen. 1160normally count from the top left corner of the screen to the top left
1161corner of the rectangle allotted to the frame by the window manager.
1159 1162
1160Negative parameter values position the bottom edge of the window up from 1163Negative parameter values position the bottom edge of that rectangle up
1161the bottom edge of the screen, or the right window edge to the left of 1164from the bottom edge of the screen, or the right rectangle edge to the
1162the right edge of the screen. It would probably be better if the values 1165left of the right edge of the screen. It would probably be better if
1163were always counted from the left and top, so that negative arguments 1166the values were always counted from the left and top, so that negative
1164would position the frame partly off the top or left edge of the screen, 1167arguments would position the frame partly off the top or left edge of
1165but it seems inadvisable to change that now. 1168the screen, but it seems inadvisable to change that now.
1166@end defun 1169@end defun
1167 1170
1168@defun frame-height &optional frame 1171@cindex frame default font
1169@defunx frame-width &optional frame 1172@cindex default font of a frame
1170These functions return the height and width of @var{frame}, measured in 1173Each frame has a @dfn{default font} which specifies the canonical height
1171lines and columns. If you don't supply @var{frame}, they use the 1174and width of a character on that frame. The default font is used when
1172selected frame. 1175retrieving or changing the size of a frame in terms of columns or lines.
1173@end defun 1176It is also used when resizing (@pxref{Window Sizes}) or splitting
1177(@pxref{Splitting Windows}) windows.
1178
1179@defun frame-char-height &optional frame
1180@defunx frame-char-width &optional frame
1181These functions return the canonical height and width of a character in
1182@var{frame}, measured in pixels. Together, these values establish the
1183size of the default font on @var{frame}. The values depend on the
1184choice of font for @var{frame}, see @ref{Font and Color Parameters}.
1185@end defun
1186
1187The default font can be also set directly with the following function:
1188
1189@deffn Command set-frame-font font &optional keep-size frames
1190This sets the default font to @var{font}. When called interactively, it
1191prompts for the name of a font, and uses that font on the selected
1192frame. When called from Lisp, @var{font} should be a font name (a
1193string), a font object, font entity, or a font spec.
1194
1195If the optional argument @var{keep-size} is @code{nil}, this keeps the
1196number of frame lines and columns fixed. (If non-@code{nil}, the option
1197@code{frame-inhibit-implied-resize} described below will override this.)
1198If @var{keep-size} is non-@code{nil} (or with a prefix argument), it
1199tries to keep the size of the display area of the current frame fixed by
1200adjusting the number of lines and columns.
1201
1202If the optional argument @var{frames} is @code{nil}, this applies the
1203font to the selected frame only. If @var{frames} is non-@code{nil}, it
1204should be a list of frames to act upon, or @code{t} meaning all existing
1205graphical frames.
1206@end deffn
1207
1208@cindex frame display area
1209@cindex display area of a frame
1210The @dfn{display area} of a frame is a rectangular area within the area
1211allotted to the frame by the window manager. The display area neither
1212includes the title bar (@pxref{Frame Titles}) nor any other decorations
1213provided by the window manager (like an external border used for
1214resizing frames via mouse dragging).
1215
1216 The actual height of the display area depends on the window-system
1217and toolkit in use. With GTK+, the display area does not include any
1218tool bar or menu bar. With the Motif or Lucid toolkits and with
1219Windows, the display area includes the tool bar but not the menu bar.
1220In a graphical version with no toolkit, it includes both the tool bar
1221and menu bar. On a text terminal, the display area includes the menu
1222bar.
1174 1223
1175@defun frame-pixel-height &optional frame 1224@defun frame-pixel-height &optional frame
1176@defunx frame-pixel-width &optional frame 1225@defunx frame-pixel-width &optional frame
1177These functions return the height and width of the main display area 1226 These functions return the height and width of the display area of
1178of @var{frame}, measured in pixels. If you don't supply @var{frame}, 1227@var{frame}, measured in pixels. For a text terminal, the results are
1179they use the selected frame. For a text terminal, the results are in 1228in characters rather than pixels.
1180characters rather than pixels. 1229@end defun
1181 1230
1182These values include the internal borders, and windows' scroll bars 1231@cindex frame text area
1183and fringes (which belong to individual windows, not to the frame 1232@cindex text area of a frame
1184itself). The exact value of the heights depends on the window-system 1233 The @dfn{text area} of a frame is a concept implicitly used by all
1185and toolkit in use. With GTK+, the height does not include any tool 1234functions that change a frame's height or width. It is a rectangle
1186bar or menu bar. With the Motif or Lucid toolkits, it includes the 1235located within the display area. Its size is obtained from that of the
1187tool bar but not the menu bar. In a graphical version with no 1236display area by subtracting the sizes of any tool or menu bars that are
1188toolkit, it includes both the tool bar and menu bar. For a text 1237part of the display area, any internal borders, one vertical and one
1189terminal, the result includes the menu bar. 1238horizontal scroll bar, and one left and one right fringe as specified
1239for this frame, see @ref{Layout Parameters}.
1240
1241@defun frame-text-height &optional frame
1242@defunx frame-text-width &optional frame
1243These functions return the height and width of the text area of
1244@var{frame}, measured in pixels. For a text terminal, the results are
1245in characters rather than pixels.
1246
1247The value returned by @code{frame-text-height} differs from that
1248returned by @code{frame-pixel-height} by not including the heights of
1249any tool bar or menu bar, the height of one horizontal scroll bar and
1250the widths of the internal border.
1251
1252The value returned by @code{frame-text-width} differs from that returned
1253by @code{frame-pixel-width} by not including the width of one vertical
1254scroll bar, the widths of one left and one right fringe and the widths
1255of the internal border.
1190@end defun 1256@end defun
1191 1257
1192@defun frame-char-height &optional frame 1258@defun frame-height &optional frame
1193@defunx frame-char-width &optional frame 1259@defunx frame-width &optional frame
1194These functions return the height and width of a character in 1260These functions return the height and width of the text area of
1195@var{frame}, measured in pixels. The values depend on the choice of 1261@var{frame}, measured in units of the default font height and width of
1196font. If you don't supply @var{frame}, these functions use the selected 1262@var{frame}. These functions are plain shorthands for writing
1197frame. 1263@code{(frame-parameter frame 'height)} and @code{(frame-parameter frame
1264'width)}.
1265
1266If the text area of @var{frame} measured in pixles is not a multiple of
1267its default font size, the values returned by this functions are rounded
1268down to the number of characters of the default font that fully fit into
1269the text area.
1198@end defun 1270@end defun
1199 1271
1200@defopt frame-resize-pixelwise 1272@defopt frame-resize-pixelwise
@@ -1220,9 +1292,9 @@ order to make a frame appear truly ``maximized'' or ``fullscreen''.
1220@end defopt 1292@end defopt
1221 1293
1222@defun set-frame-size frame width height pixelwise 1294@defun set-frame-size frame width height pixelwise
1223This function sets the size of @var{frame}, measured in characters; 1295This function sets the size of the text area of @var{frame}, measured in
1224@var{width} and @var{height} specify the new width in columns and the 1296characters; @var{width} and @var{height} specify the new width in
1225new height in lines. 1297columns and the new height in lines.
1226 1298
1227The optional argument @var{pixelwise} non-@code{nil} means to measure 1299The optional argument @var{pixelwise} non-@code{nil} means to measure
1228the new width and height in units of pixels instead. Note that if 1300the new width and height in units of pixels instead. Note that if
@@ -1232,9 +1304,9 @@ to a multiple of its character size.
1232@end defun 1304@end defun
1233 1305
1234@defun set-frame-height frame height &optional pretend pixelwise 1306@defun set-frame-height frame height &optional pretend pixelwise
1235This function resizes @var{frame} to a height of @var{height} lines. The 1307This function resizes the text area of @var{frame} to a height of
1236sizes of existing windows in @var{frame} are altered proportionally to 1308@var{height} lines. The sizes of existing windows in @var{frame} are
1237fit. 1309altered proportionally to fit.
1238 1310
1239If @var{pretend} is non-@code{nil}, then Emacs displays @var{height} 1311If @var{pretend} is non-@code{nil}, then Emacs displays @var{height}
1240lines of output in @var{frame}, but does not change its value for the 1312lines of output in @var{frame}, but does not change its value for the
@@ -1254,8 +1326,8 @@ height to a multiple of its character height.
1254@end defun 1326@end defun
1255 1327
1256@defun set-frame-width frame width &optional pretend pixelwise 1328@defun set-frame-width frame width &optional pretend pixelwise
1257This function sets the width of @var{frame}, measured in characters. 1329This function sets the width of the text area of @var{frame}, measured
1258The argument @var{pretend} has the same meaning as in 1330in characters. The argument @var{pretend} has the same meaning as in
1259@code{set-frame-height}. 1331@code{set-frame-height}.
1260 1332
1261The optional fourth argument @var{pixelwise} non-@code{nil} means that 1333The optional fourth argument @var{pixelwise} non-@code{nil} means that
@@ -1265,6 +1337,41 @@ fully honor the request if it does not increase/decrease the frame width
1265to a multiple of its character width. 1337to a multiple of its character width.
1266@end defun 1338@end defun
1267 1339
1340None of these three functions will make a frame smaller than needed to
1341display all of its windows together with their scroll bars, fringes,
1342margins, dividers, mode and header lines. This contrasts with requests
1343by the window manager triggered, for example, by dragging the external
1344border of a frame with the mouse. Such requests are always honored by
1345clipping, if necessary, portions that cannot be displayed at the right,
1346bottom corner of the frame.
1347
1348 By default, Emacs tries to keep the number of lines and columns of a
1349frame's text area unaltered when, for example, adding or removing a menu
1350bar, changing the default font or setting the width of the frame's
1351scroll bars. This means, however, that in such case Emacs must ask the
1352window manager to resize the display area of the frame in order to
1353accommodate the size change. (Note that with the exception of GTK+
1354builds, adding, removing or wrapping the tool bar usually do not resize
1355the frame's display area, hence these may alter the number of displayed
1356lines.)
1357
1358 Occasionally, such implied resizing of the display area may be
1359unwanted, for example, when the frame is maximized or made fullscreen
1360where it's turned off by default. In other cases you can disable
1361implied resizing with the following option:
1362
1363@defopt frame-inhibit-implied-resize
1364If this option is @code{nil}, changing default font, menu bar mode,
1365fringe width, or scroll bars of a specific frame may resize the frame's
1366display area in order to preserve the number of columns or lines the
1367frame displays. If this option is non-@code{nil}, no such resizing is
1368done.
1369
1370When you add a tool bar or scroll bar to a frame that is not large
1371enough to accommodate one, Emacs will try to enlarge the frame even if
1372this option is non-@code{nil}.
1373@end defopt
1374
1268@c FIXME? Belongs more in Emacs manual than here? 1375@c FIXME? Belongs more in Emacs manual than here?
1269@c But, e.g., fit-window-to-buffer is in this manual. 1376@c But, e.g., fit-window-to-buffer is in this manual.
1270If you have a frame that displays only one window, you can fit that 1377If you have a frame that displays only one window, you can fit that