diff options
Diffstat (limited to 'doc/lispref/frames.texi')
| -rw-r--r-- | doc/lispref/frames.texi | 510 |
1 files changed, 397 insertions, 113 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 50467d1dfd5..b430f7c6fad 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -974,14 +974,7 @@ Parameters}). The text size of the initial frame can be also set with | |||
| 974 | the help of an X-style geometry specification. @xref{Emacs Invocation,, | 974 | the help of an X-style geometry specification. @xref{Emacs Invocation,, |
| 975 | Command Line Arguments for Emacs Invocation, emacs, The GNU Emacs | 975 | Command Line Arguments for Emacs Invocation, emacs, The GNU Emacs |
| 976 | Manual}. Below we list some functions to access and set the size of an | 976 | Manual}. Below we list some functions to access and set the size of an |
| 977 | existing, visible frame. | 977 | existing, visible frame, by default the selected one. |
| 978 | |||
| 979 | @defun frame-text-height &optional frame | ||
| 980 | @defunx frame-text-width &optional frame | ||
| 981 | These functions return the height and width of the text area of | ||
| 982 | @var{frame} (@pxref{Frame Layout}), measured in pixels. For a text | ||
| 983 | terminal, the results are in characters rather than pixels. | ||
| 984 | @end defun | ||
| 985 | 978 | ||
| 986 | @defun frame-height &optional frame | 979 | @defun frame-height &optional frame |
| 987 | @defunx frame-width &optional frame | 980 | @defunx frame-width &optional frame |
| @@ -997,11 +990,33 @@ rounded down to the number of characters of the default font that fully | |||
| 997 | fit into the text area. | 990 | fit into the text area. |
| 998 | @end defun | 991 | @end defun |
| 999 | 992 | ||
| 1000 | @defun frame-pixel-height &optional frame | 993 | The functions following next return the pixel widths and heights of the |
| 1001 | @defunx frame-pixel-width &optional frame | 994 | native, outer and inner frame and the text area (@pxref{Frame Layout}) |
| 1002 | These functions return the native width and height, see @ref{Frame | 995 | of a given frame. For a text terminal, the results are in characters |
| 1003 | Layout}) of @var{frame} in pixels. For a text terminal, the results are | 996 | rather than pixels. |
| 1004 | in characters rather than pixels. | 997 | |
| 998 | @defun frame-outer-width &optional frame | ||
| 999 | @defunx frame-outer-height &optional frame | ||
| 1000 | These functions return the outer width and height of @var{frame} in | ||
| 1001 | pixels. | ||
| 1002 | @end defun | ||
| 1003 | |||
| 1004 | @defun frame-native-height &optional frame | ||
| 1005 | @defunx frame-native-width &optional frame | ||
| 1006 | These functions return the native width and height of @var{frame} in | ||
| 1007 | pixels. | ||
| 1008 | @end defun | ||
| 1009 | |||
| 1010 | @defun frame-inner-width &optional frame | ||
| 1011 | @defunx frame-inner-height &optional frame | ||
| 1012 | These functions return the inner width and height of @var{frame} in | ||
| 1013 | pixels. | ||
| 1014 | @end defun | ||
| 1015 | |||
| 1016 | @defun frame-text-width &optional frame | ||
| 1017 | @defunx frame-text-height &optional frame | ||
| 1018 | These functions return the width and height of the text area of | ||
| 1019 | @var{frame} in pixels. | ||
| 1005 | @end defun | 1020 | @end defun |
| 1006 | 1021 | ||
| 1007 | On window systems that support it, Emacs tries by default to make the | 1022 | On window systems that support it, Emacs tries by default to make the |
| @@ -1345,6 +1360,8 @@ text terminals. | |||
| 1345 | * Buffer Parameters:: Which buffers have been or should be shown. | 1360 | * Buffer Parameters:: Which buffers have been or should be shown. |
| 1346 | * Frame Interaction Parameters:: Parameters for interacting with other | 1361 | * Frame Interaction Parameters:: Parameters for interacting with other |
| 1347 | frames. | 1362 | frames. |
| 1363 | * Mouse Dragging Parameters:: Parameters for resizing and moving | ||
| 1364 | frames with the mouse. | ||
| 1348 | * Management Parameters:: Communicating with the window manager. | 1365 | * Management Parameters:: Communicating with the window manager. |
| 1349 | * Cursor Parameters:: Controlling the cursor appearance. | 1366 | * Cursor Parameters:: Controlling the cursor appearance. |
| 1350 | * Font and Color Parameters:: Fonts and colors for the frame text. | 1367 | * Font and Color Parameters:: Fonts and colors for the frame text. |
| @@ -1404,18 +1421,19 @@ named, this parameter will be @code{nil}. | |||
| 1404 | @cindex frame position | 1421 | @cindex frame position |
| 1405 | 1422 | ||
| 1406 | Parameters describing the X- and Y-offsets of a frame are always | 1423 | Parameters describing the X- and Y-offsets of a frame are always |
| 1407 | measured in pixels. For normal, non-child frames they specify the | 1424 | measured in pixels. For a normal, non-child frame they specify the |
| 1408 | frame's absolute outer position (@pxref{Frame Geometry}) with respect to | 1425 | frame's outer position (@pxref{Frame Geometry}) relative to its |
| 1409 | its display's origin. For a child frame (@pxref{Child Frames}) they | 1426 | display's origin. For a child frame (@pxref{Child Frames}) they specify |
| 1410 | specify the frame's outer position relative to the native position of | 1427 | the frame's outer position relative to the native position of the |
| 1411 | the frame's parent frame. (Note that none of these parameters is | 1428 | frame's parent frame. (Note that none of these parameters is meaningful |
| 1412 | meaningful on TTY frames.) | 1429 | on TTY frames.) |
| 1413 | 1430 | ||
| 1414 | @table @code | 1431 | @table @code |
| 1415 | @vindex left, a frame parameter | 1432 | @vindex left, a frame parameter |
| 1416 | @item left | 1433 | @item left |
| 1417 | The position, in pixels, of the left outer edge of the frame with | 1434 | The position, in pixels, of the left outer edge of the frame with |
| 1418 | respect to the left edge of the frame's display or parent frame. | 1435 | respect to the left edge of the frame's display or parent frame. It can |
| 1436 | be specified in one of the following ways. | ||
| 1419 | 1437 | ||
| 1420 | @table @asis | 1438 | @table @asis |
| 1421 | @item an integer | 1439 | @item an integer |
| @@ -1436,6 +1454,30 @@ right edge of the display or parent frame. The integer @var{pos} may be | |||
| 1436 | positive or negative; a negative value specifies a position outside the | 1454 | positive or negative; a negative value specifies a position outside the |
| 1437 | screen or parent frame or on a monitor other than the primary one (for | 1455 | screen or parent frame or on a monitor other than the primary one (for |
| 1438 | multi-monitor displays). | 1456 | multi-monitor displays). |
| 1457 | |||
| 1458 | @cindex left position ratio | ||
| 1459 | @cindex top position ratio | ||
| 1460 | @item a floating-point value | ||
| 1461 | A floating-point value in the range 0.0 to 1.0 specifies the left edge's | ||
| 1462 | offset via the @dfn{left position ratio} of the frame---the ratio of the | ||
| 1463 | left edge of its outer frame to the width of the frame's workarea | ||
| 1464 | (@pxref{Multiple Terminals}) or its parent's native frame (@pxref{Child | ||
| 1465 | Frames}) minus the width of the outer frame. Thus, a left position | ||
| 1466 | ratio of 0.0 flushes a frame to the left, a ratio of 0.5 centers it and | ||
| 1467 | a ratio of 1.0 flushes it to the right of its display or parent frame. | ||
| 1468 | Similarly, the @dfn{top position ratio} of a frame is the ratio of the | ||
| 1469 | frame's top position to the height of its workarea or parent frame minus | ||
| 1470 | the height of the frame. | ||
| 1471 | |||
| 1472 | Emacs will try to keep the position ratios of a child frame unaltered if | ||
| 1473 | that frame has a non-@code{nil} @code{keep-ratio} parameter | ||
| 1474 | (@pxref{Frame Interaction Parameters}) and its parent frame is resized. | ||
| 1475 | |||
| 1476 | Since the outer size of a frame (@pxref{Frame Geometry}) is usually | ||
| 1477 | unavailable before a frame has been made visible, it is generally not | ||
| 1478 | advisable to use floating-point values when creating decorated frames. | ||
| 1479 | Floating-point values are more suited for ensuring that an (undecorated) | ||
| 1480 | child frame is positioned nicely within the area of its parent frame. | ||
| 1439 | @end table | 1481 | @end table |
| 1440 | 1482 | ||
| 1441 | Some window managers ignore program-specified positions. If you want to | 1483 | Some window managers ignore program-specified positions. If you want to |
| @@ -1448,17 +1490,19 @@ following example: | |||
| 1448 | nil '((user-position . t) (left . (+ -4)))) | 1490 | nil '((user-position . t) (left . (+ -4)))) |
| 1449 | @end example | 1491 | @end example |
| 1450 | 1492 | ||
| 1451 | In general, it is not a good idea to specify negative offsets to | 1493 | In general, it is not a good idea to position a frame relative to the |
| 1452 | position a frame relative to the right or bottom edge of its display. | 1494 | right or bottom edge of its display. Positioning the initial or a new |
| 1453 | Positioning the initial or a new frame is either not accurate (because | 1495 | frame is either not accurate (because the size of the outer frame is not |
| 1454 | the size of the outer frame is not yet fully known before the frame has | 1496 | yet fully known before the frame has been made visible) or will cause |
| 1455 | been made visible) or will cause additional flicker (if the frame is | 1497 | additional flicker (if the frame has to be repositioned after becoming |
| 1456 | repositioned after becoming visible). | 1498 | visible). |
| 1457 | 1499 | ||
| 1458 | Note also, that negative offsets are not stored internally and are not | 1500 | Note also, that positions specified relative to the right/bottom edge |
| 1459 | returned by the function @code{frame-parameters}. This means that the | 1501 | of a display, workarea or parent frame as well as floating-point offsets |
| 1460 | desktop saving routines will restore the frame from the positive offsets | 1502 | are stored internally as integer offsets relative to the left/top edge |
| 1461 | obtained by that function. | 1503 | of the display, workarea or parent frame edge. They are also returned |
| 1504 | as such by functions like @code{frame-parameters} and restored as such | ||
| 1505 | by the desktop saving routines. | ||
| 1462 | 1506 | ||
| 1463 | @vindex top, a frame parameter | 1507 | @vindex top, a frame parameter |
| 1464 | @item top | 1508 | @item top |
| @@ -1523,24 +1567,61 @@ function @code{frame-restack} (@pxref{Raising and Lowering}). | |||
| 1523 | @subsubsection Size Parameters | 1567 | @subsubsection Size Parameters |
| 1524 | @cindex window size on display | 1568 | @cindex window size on display |
| 1525 | 1569 | ||
| 1526 | Frame parameters specify frame sizes in character units. On | 1570 | Frame parameters usually specify frame sizes in character units. On |
| 1527 | graphical displays, the @code{default} face determines the actual | 1571 | graphical displays, the @code{default} face determines the actual pixel |
| 1528 | pixel sizes of these character units (@pxref{Face Attributes}). | 1572 | sizes of these character units (@pxref{Face Attributes}). |
| 1529 | 1573 | ||
| 1530 | @table @code | 1574 | @table @code |
| 1531 | @vindex width, a frame parameter | 1575 | @vindex width, a frame parameter |
| 1532 | @item width | 1576 | @item width |
| 1533 | The width of the frame's text area (@pxref{Frame Geometry}), in | 1577 | This parameter specifies the width of the frame. It can be specified as |
| 1534 | characters. The value can be also a cons cell of the symbol | 1578 | in the following ways: |
| 1535 | @code{text-pixels} and an integer denoting the width of the text area in | 1579 | |
| 1536 | pixels. | 1580 | @table @asis |
| 1581 | @item an integer | ||
| 1582 | A positive integer specifies the width of the frame's text area | ||
| 1583 | (@pxref{Frame Geometry}) in characters. | ||
| 1584 | |||
| 1585 | @item a cons cell | ||
| 1586 | If this is a cons cell with the symbol @code{text-pixels} in its | ||
| 1587 | @sc{car}, the @sc{cdr} of that cell specifies the width of the frame's | ||
| 1588 | text area in pixels. | ||
| 1589 | |||
| 1590 | @cindex frame width ratio | ||
| 1591 | @cindex frame height ratio | ||
| 1592 | @item a floating-point value | ||
| 1593 | A floating-point number between 0.0 and 1.0 can be used to specify the | ||
| 1594 | width of a frame via its @dfn{width ratio}---the ratio of its outer | ||
| 1595 | width (@pxref{Frame Geometry}) to the width of the frame's workarea | ||
| 1596 | (@pxref{Multiple Terminals}) or its parent frame's (@pxref{Child | ||
| 1597 | Frames}) native frame. Thus, a value of 0.5 makes the frame occupy half | ||
| 1598 | of the width of its workarea or parent frame, a value of 1.0 the full | ||
| 1599 | width. Similarly, the @dfn{height ratio} of a frame is the ratio of its | ||
| 1600 | outer height to the height of its workarea or its parent's native frame. | ||
| 1601 | |||
| 1602 | Emacs will try to keep the width and height ratio of a child frame | ||
| 1603 | unaltered if that frame has a non-@code{nil} @code{keep-ratio} parameter | ||
| 1604 | (@pxref{Frame Interaction Parameters}) and its parent frame is resized. | ||
| 1605 | |||
| 1606 | Since the outer size of a frame is usually unavailable before a frame | ||
| 1607 | has been made visible, it is generally not advisable to use | ||
| 1608 | floating-point values when creating decorated frames. Floating-point | ||
| 1609 | values are more suited to ensure that a child frame always fits within | ||
| 1610 | the area of its parent frame as, for example, when customizing | ||
| 1611 | @code{display-buffer-alist} (@pxref{Choosing Window}) via | ||
| 1612 | @code{display-buffer-in-child-frame}. | ||
| 1613 | @end table | ||
| 1614 | |||
| 1615 | Regardless of how this parameter was specified, functions reporting the | ||
| 1616 | value of this parameter like @code{frame-parameters} always report the | ||
| 1617 | width of the frame's text area in characters as an integer rounded, if | ||
| 1618 | necessary, to a multiple of the frame's default character width. That | ||
| 1619 | value is also used by the desktop saving routines. | ||
| 1537 | 1620 | ||
| 1538 | @vindex height, a frame parameter | 1621 | @vindex height, a frame parameter |
| 1539 | @item height | 1622 | @item height |
| 1540 | The height of the frame's text area (@pxref{Frame Geometry}), in | 1623 | This parameter specifies the height of the frame. It works just like |
| 1541 | characters. The value can be also a cons cell of the symbol | 1624 | @code{width}, except vertically instead of horizontally. |
| 1542 | @code{text-pixels} and an integer denoting the height of the text area | ||
| 1543 | in pixels. | ||
| 1544 | 1625 | ||
| 1545 | @vindex user-size, a frame parameter | 1626 | @vindex user-size, a frame parameter |
| 1546 | @item user-size | 1627 | @item user-size |
| @@ -1551,25 +1632,25 @@ user-position}) does for the position parameters @code{top} and | |||
| 1551 | 1632 | ||
| 1552 | @vindex min-width, a frame parameter | 1633 | @vindex min-width, a frame parameter |
| 1553 | @item min-width | 1634 | @item min-width |
| 1554 | This parameter specifies the minimum native width of the frame | 1635 | This parameter specifies the minimum native width (@pxref{Frame |
| 1555 | (@pxref{Frame Geometry}), in characters. Normally, the functions that | 1636 | Geometry}) of the frame, in characters. Normally, the functions that |
| 1556 | establish a frame's initial width or resize a frame horizontally make | 1637 | establish a frame's initial width or resize a frame horizontally make |
| 1557 | sure that all the frame's windows, vertical scroll bars, fringes, | 1638 | sure that all the frame's windows, vertical scroll bars, fringes, |
| 1558 | margins and vertical dividers can be displayed. This parameter, if | 1639 | margins and vertical dividers can be displayed. This parameter, if |
| 1559 | non-@code{nil} allows to make a frame narrower than that with the | 1640 | non-@code{nil} allows to make a frame narrower than that with the |
| 1560 | consequence that any components that do not fit on the frame will be | 1641 | consequence that any components that do not fit will be clipped by the |
| 1561 | clipped by the window manager. | 1642 | window manager. |
| 1562 | 1643 | ||
| 1563 | @vindex min-height, a frame parameter | 1644 | @vindex min-height, a frame parameter |
| 1564 | @item min-height | 1645 | @item min-height |
| 1565 | This parameter specifies the minimum height of the native (@pxref{Frame | 1646 | This parameter specifies the minimum native height (@pxref{Frame |
| 1566 | Geometry}), in characters. Normally, the functions that establish a | 1647 | Geometry}) of the frame, in characters. Normally, the functions that |
| 1567 | frame's initial size or resize a frame make sure that all the frame's | 1648 | establish a frame's initial size or resize a frame make sure that all |
| 1568 | windows, horizontal scroll bars and dividers, mode and header lines, the | 1649 | the frame's windows, horizontal scroll bars and dividers, mode and |
| 1569 | echo area and the internal menu and tool bar can be displayed. This | 1650 | header lines, the echo area and the internal menu and tool bar can be |
| 1570 | parameter, if non-@code{nil} allows to make a frame smaller than that | 1651 | displayed. This parameter, if non-@code{nil} allows to make a frame |
| 1571 | with the consequence that any components that do not fit on the frame | 1652 | smaller than that with the consequence that any components that do not |
| 1572 | will be clipped by the window-system or window manager. | 1653 | fit will be clipped by the window manager. |
| 1573 | 1654 | ||
| 1574 | @cindex fullboth frames | 1655 | @cindex fullboth frames |
| 1575 | @cindex fullheight frames | 1656 | @cindex fullheight frames |
| @@ -1623,6 +1704,20 @@ file as, for example | |||
| 1623 | 1704 | ||
| 1624 | This will give a new frame full height after typing in it @key{F11} for | 1705 | This will give a new frame full height after typing in it @key{F11} for |
| 1625 | the first time. | 1706 | the first time. |
| 1707 | |||
| 1708 | @vindex fit-frame-to-buffer-margins, a frame parameter | ||
| 1709 | @item fit-frame-to-buffer-margins | ||
| 1710 | This parameter allows to override the value of the option | ||
| 1711 | @code{fit-frame-to-buffer-margins} when fitting this frame to the buffer | ||
| 1712 | of its root window with @code{fit-frame-to-buffer} (@pxref{Resizing | ||
| 1713 | Windows}). | ||
| 1714 | |||
| 1715 | @vindex fit-frame-to-buffer-sizes, a frame parameter | ||
| 1716 | @item fit-frame-to-buffer-sizes | ||
| 1717 | This parameter allows to override the value of the option | ||
| 1718 | @code{fit-frame-to-buffer-sizes} when fitting this frame to the buffer | ||
| 1719 | of its root window with @code{fit-frame-to-buffer} (@pxref{Resizing | ||
| 1720 | Windows}). | ||
| 1626 | @end table | 1721 | @end table |
| 1627 | 1722 | ||
| 1628 | 1723 | ||
| @@ -1646,9 +1741,9 @@ Geometry}). | |||
| 1646 | 1741 | ||
| 1647 | @vindex vertical-scroll-bars, a frame parameter | 1742 | @vindex vertical-scroll-bars, a frame parameter |
| 1648 | @item vertical-scroll-bars | 1743 | @item vertical-scroll-bars |
| 1649 | Whether the frame has scroll bars for vertical scrolling, and which side | 1744 | Whether the frame has scroll bars (@pxref{Scroll Bars}) for vertical |
| 1650 | of the frame they should be on. The possible values are @code{left}, | 1745 | scrolling, and which side of the frame they should be on. The possible |
| 1651 | @code{right}, and @code{nil} for no scroll bars. | 1746 | values are @code{left}, @code{right}, and @code{nil} for no scroll bars. |
| 1652 | 1747 | ||
| 1653 | @vindex horizontal-scroll-bars, a frame parameter | 1748 | @vindex horizontal-scroll-bars, a frame parameter |
| 1654 | @item horizontal-scroll-bars | 1749 | @item horizontal-scroll-bars |
| @@ -1692,30 +1787,40 @@ to not draw bottom dividers. | |||
| 1692 | 1787 | ||
| 1693 | @vindex menu-bar-lines frame parameter | 1788 | @vindex menu-bar-lines frame parameter |
| 1694 | @item menu-bar-lines | 1789 | @item menu-bar-lines |
| 1695 | The number of lines to allocate at the top of the frame for a menu bar. | 1790 | The number of lines to allocate at the top of the frame for a menu bar |
| 1696 | The default is one if Menu Bar mode is enabled and zero otherwise. | 1791 | (@pxref{Menu Bar}). The default is one if Menu Bar mode is enabled and |
| 1697 | @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. For an external menu | 1792 | zero otherwise. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. For an |
| 1698 | bar, this value remains unchanged even when the menu bar wraps to two or | 1793 | external menu bar (@pxref{Frame Layout}), this value remains unchanged |
| 1699 | more lines. In that case, the @code{menu-bar-size} value returned by | 1794 | even when the menu bar wraps to two or more lines. In that case, the |
| 1700 | @code{frame-geometry} (@pxref{Frame Geometry}) allows to derive whether | 1795 | @code{menu-bar-size} value returned by @code{frame-geometry} |
| 1701 | the menu bar actually occupies one or more lines. | 1796 | (@pxref{Frame Geometry}) allows to derive whether the menu bar actually |
| 1797 | occupies one or more lines. | ||
| 1702 | 1798 | ||
| 1703 | @vindex tool-bar-lines frame parameter | 1799 | @vindex tool-bar-lines frame parameter |
| 1704 | @item tool-bar-lines | 1800 | @item tool-bar-lines |
| 1705 | The number of lines to use for the tool bar. The default is one if Tool | 1801 | The number of lines to use for the tool bar (@pxref{Tool Bar}). The |
| 1706 | Bar mode is enabled and zero otherwise. @xref{Tool Bars,,,emacs, The | 1802 | default is one if Tool Bar mode is enabled and zero otherwise. |
| 1707 | GNU Emacs Manual}. This value may change whenever the tool bar wraps. | 1803 | @xref{Tool Bars,,,emacs, The GNU Emacs Manual}. This value may change |
| 1804 | whenever the tool bar wraps (@pxref{Frame Layout}). | ||
| 1708 | 1805 | ||
| 1709 | @vindex tool-bar-position frame parameter | 1806 | @vindex tool-bar-position frame parameter |
| 1710 | @item tool-bar-position | 1807 | @item tool-bar-position |
| 1711 | The position of the tool bar. Currently only for the GTK tool bar. | 1808 | The position of the tool bar when Emacs was built with GTK+. Its value |
| 1712 | Value can be one of @code{top}, @code{bottom} @code{left}, @code{right}. | 1809 | can be one of @code{top}, @code{bottom} @code{left}, @code{right}. The |
| 1713 | The default is @code{top}. | 1810 | default is @code{top}. |
| 1714 | 1811 | ||
| 1715 | @vindex line-spacing, a frame parameter | 1812 | @vindex line-spacing, a frame parameter |
| 1716 | @item line-spacing | 1813 | @item line-spacing |
| 1717 | Additional space to leave below each text line, in pixels (a positive | 1814 | Additional space to leave below each text line, in pixels (a positive |
| 1718 | integer). @xref{Line Height}, for more information. | 1815 | integer). @xref{Line Height}, for more information. |
| 1816 | |||
| 1817 | @vindex no-special-glyphs, a frame parameter | ||
| 1818 | @item no-special-glyphs | ||
| 1819 | If this is non-@code{nil}, it suppresses the display of any truncation | ||
| 1820 | and continuation glyphs (@pxref{Truncation}) for all buffers displayed | ||
| 1821 | by this frame. This is useful to eliminate such glyphs when fitting a | ||
| 1822 | frame to its buffer via @code{fit-frame-to-buffer} (@pxref{Resizing | ||
| 1823 | Windows}). | ||
| 1719 | @end table | 1824 | @end table |
| 1720 | 1825 | ||
| 1721 | 1826 | ||
| @@ -1781,15 +1886,115 @@ Frames}. | |||
| 1781 | @item mouse-wheel-frame | 1886 | @item mouse-wheel-frame |
| 1782 | If non-@code{nil}, this parameter specifies the frame whose windows will | 1887 | If non-@code{nil}, this parameter specifies the frame whose windows will |
| 1783 | be scrolled whenever the mouse wheel is scrolled with the mouse pointer | 1888 | be scrolled whenever the mouse wheel is scrolled with the mouse pointer |
| 1784 | hovering over this frame (@pxref{Mouse Commands,,, emacs, The GNU Emacs | 1889 | hovering over this frame, see @ref{Mouse Commands,,, emacs, The GNU |
| 1785 | Manual}). | 1890 | Emacs Manual}. |
| 1786 | 1891 | ||
| 1787 | @vindex no-other-frame, a frame parameter | 1892 | @vindex no-other-frame, a frame parameter |
| 1788 | @item no-other-frame | 1893 | @item no-other-frame |
| 1789 | If this is non-@code{nil}, then this frame is not eligible as candidate | 1894 | If this is non-@code{nil}, then this frame is not eligible as candidate |
| 1790 | for the functions @code{next-frame}, @code{previous-frame} | 1895 | for the functions @code{next-frame}, @code{previous-frame} |
| 1791 | (@pxref{Finding All Frames}) and @code{other-frame} (@pxref{Frame | 1896 | (@pxref{Finding All Frames}) and @code{other-frame}, see @ref{Frame |
| 1792 | Commands,,, emacs, The GNU Emacs Manual}). | 1897 | Commands,,, emacs, The GNU Emacs Manual}. |
| 1898 | |||
| 1899 | @vindex auto-hide-function, a frame parameter | ||
| 1900 | @item auto-hide-function | ||
| 1901 | When this parameter specifies a function, that function will be called | ||
| 1902 | instead of the function specified by the variable | ||
| 1903 | @code{frame-auto-hide-function} when quitting the frame's only window | ||
| 1904 | (@pxref{Quitting Windows}) and there are other frames left. | ||
| 1905 | |||
| 1906 | @vindex minibuffer-exit, a frame parameter | ||
| 1907 | @item minibuffer-exit | ||
| 1908 | When this parameter is non-@code{nil}, Emacs will by default make this | ||
| 1909 | frame invisible whenever the minibuffer (@pxref{Minibuffers}) is exited. | ||
| 1910 | Alternatively, it can specify the functions @code{iconify-frame} and | ||
| 1911 | @code{delete-frame}. This parameter is useful to make a child frame | ||
| 1912 | disappear automatically (similar to how Emacs deals with a window) when | ||
| 1913 | exiting the minibuffer. | ||
| 1914 | |||
| 1915 | @vindex keep-ratio, a frame parameter | ||
| 1916 | @item keep-ratio | ||
| 1917 | This parameter is currently meaningful for child frames (@pxref{Child | ||
| 1918 | Frames}) only. If it is non-@code{nil}, then Emacs will try to keep the | ||
| 1919 | frame's size (width and height) ratios (@pxref{Size Parameters}) as well | ||
| 1920 | as its left and right position ratios (@pxref{Position Parameters}) | ||
| 1921 | unaltered whenever its parent frame is resized. | ||
| 1922 | |||
| 1923 | If the value of this parameter is @code{nil}, the frame's position and | ||
| 1924 | size remain unaltered when the parent frame is resized, so the position | ||
| 1925 | and size ratios may change. If the value of this parameter is @code{t}, | ||
| 1926 | Emacs will try to preserve the frame's size and position ratios, hence | ||
| 1927 | the frame's size and position relative to its parent frame may change. | ||
| 1928 | |||
| 1929 | More individual control is possible by using a cons cell: In that case | ||
| 1930 | the frame's width ratio is preserved if the @sc{car} of the cell is | ||
| 1931 | either @code{t} or @code{width-only}. The height ratio is preserved if | ||
| 1932 | the @sc{car} of the cell is either @code{t} or @code{height-only}. The | ||
| 1933 | left position ratio is preserved if the @sc{cdr} of the cell is either | ||
| 1934 | @code{t} or @code{left-only}. The top position ratio is preserved if | ||
| 1935 | the @sc{cdr} of the cell is either @code{t} or @code{top-only}. | ||
| 1936 | @end table | ||
| 1937 | |||
| 1938 | |||
| 1939 | @node Mouse Dragging Parameters | ||
| 1940 | @subsubsection Mouse Dragging Parameters | ||
| 1941 | @cindex mouse dragging parameters | ||
| 1942 | @cindex parameters for resizing frames with the mouse | ||
| 1943 | @cindex parameters for moving frames with the mouse | ||
| 1944 | |||
| 1945 | The parameters described below provide support for resizing a frame by | ||
| 1946 | dragging its internal borders with the mouse. They also allow moving a | ||
| 1947 | frame with the mouse by dragging the header line of its topmost or the | ||
| 1948 | mode line of its bottommost window. | ||
| 1949 | |||
| 1950 | These parameters are mostly useful for child frames (@pxref{Child | ||
| 1951 | Frames}) that come without window manager decorations. If necessary, | ||
| 1952 | they can be used for undecorated top-level frames as well. | ||
| 1953 | |||
| 1954 | @table @code | ||
| 1955 | @vindex drag-internal-border, a frame parameter | ||
| 1956 | @item drag-internal-border | ||
| 1957 | If non-@code{nil}, the frame can be resized by dragging its internal | ||
| 1958 | borders, if present, with the mouse. | ||
| 1959 | |||
| 1960 | @vindex drag-with-header-line, a frame parameter | ||
| 1961 | @item drag-with-header-line | ||
| 1962 | If non-@code{nil}, the frame can be moved with the mouse by dragging the | ||
| 1963 | header line of its topmost window. | ||
| 1964 | |||
| 1965 | @vindex drag-with-mode-line, a frame parameter | ||
| 1966 | @item drag-with-mode-line | ||
| 1967 | If non-@code{nil}, the frame can be moved with the mouse by dragging the | ||
| 1968 | mode line of its bottommost window. Note that such a frame is not | ||
| 1969 | allowed to have its own minibuffer window. | ||
| 1970 | |||
| 1971 | @vindex snap-width, a frame parameter | ||
| 1972 | @item snap-width | ||
| 1973 | A frame that is moved with the mouse will ``snap'' at the border(s) of | ||
| 1974 | the display or its parent frame whenever it is dragged as near to such | ||
| 1975 | an edge as the number of pixels specified by this parameter. | ||
| 1976 | |||
| 1977 | @vindex top-visible, a frame parameter | ||
| 1978 | @item top-visible | ||
| 1979 | If this parameter is a number, the top edge of the frame never appears | ||
| 1980 | above the top edge of its display or parent frame. Moreover, as many | ||
| 1981 | pixels of the frame as specified by that number will remain visible when | ||
| 1982 | the frame is moved against any of the remaining edges of its display or | ||
| 1983 | parent frame. Setting this parameter is useful to guard against | ||
| 1984 | dragging a child frame with a non-@code{nil} | ||
| 1985 | @code{drag-with-header-line} parameter completely out of the area | ||
| 1986 | of its parent frame. | ||
| 1987 | |||
| 1988 | @vindex bottom-visible, a frame parameter | ||
| 1989 | @item bottom-visible | ||
| 1990 | If this parameter is a number, the bottom edge of the frame never | ||
| 1991 | appears below the bottom edge of its display or parent frame. Moreover, | ||
| 1992 | as many pixels of the frame as specified by that number will remain | ||
| 1993 | visible when the frame is moved against any of the remaining edges of | ||
| 1994 | its display or parent frame. Setting this parameter is useful to guard | ||
| 1995 | against dragging a child frame with a non-@code{nil} | ||
| 1996 | @code{drag-with-mode-line} parameter completely out of the area of | ||
| 1997 | its parent frame. | ||
| 1793 | @end table | 1998 | @end table |
| 1794 | 1999 | ||
| 1795 | 2000 | ||
| @@ -1797,9 +2002,9 @@ Commands,,, emacs, The GNU Emacs Manual}). | |||
| 1797 | @subsubsection Window Management Parameters | 2002 | @subsubsection Window Management Parameters |
| 1798 | @cindex window manager interaction, and frame parameters | 2003 | @cindex window manager interaction, and frame parameters |
| 1799 | 2004 | ||
| 1800 | The following frame parameters control various aspects of the | 2005 | The following frame parameters control various aspects of the frame's |
| 1801 | frame's interaction with the window manager. They have no effect on | 2006 | interaction with the window manager or window system. They have no |
| 1802 | text terminals. | 2007 | effect on text terminals. |
| 1803 | 2008 | ||
| 1804 | @table @code | 2009 | @table @code |
| 1805 | @vindex visibility, a frame parameter | 2010 | @vindex visibility, a frame parameter |
| @@ -1908,7 +2113,8 @@ If non-@code{nil}, this means that this is an @dfn{override redirect} | |||
| 1908 | frame---a frame not handled by window managers under X. Override | 2113 | frame---a frame not handled by window managers under X. Override |
| 1909 | redirect frames have no window manager decorations, can be positioned | 2114 | redirect frames have no window manager decorations, can be positioned |
| 1910 | and resized only via Emacs' positioning and resizing functions and are | 2115 | and resized only via Emacs' positioning and resizing functions and are |
| 1911 | usually drawn on top of all other frames. | 2116 | usually drawn on top of all other frames. Setting this parameter has |
| 2117 | no effect on MS-Windows. | ||
| 1912 | 2118 | ||
| 1913 | @ignore | 2119 | @ignore |
| 1914 | @vindex parent-id, a frame parameter | 2120 | @vindex parent-id, a frame parameter |
| @@ -2080,6 +2286,9 @@ The @code{alpha} frame parameter can also be a cons cell | |||
| 2080 | @code{(@var{active} . @var{inactive})}, where @var{active} is the | 2286 | @code{(@var{active} . @var{inactive})}, where @var{active} is the |
| 2081 | opacity of the frame when it is selected, and @var{inactive} is the | 2287 | opacity of the frame when it is selected, and @var{inactive} is the |
| 2082 | opacity when it is not selected. | 2288 | opacity when it is not selected. |
| 2289 | |||
| 2290 | Some window systems do not support the @code{alpha} parameter for child | ||
| 2291 | frames (@pxref{Child Frames}). | ||
| 2083 | @end table | 2292 | @end table |
| 2084 | 2293 | ||
| 2085 | The following frame parameters are semi-obsolete in that they are | 2294 | The following frame parameters are semi-obsolete in that they are |
| @@ -2824,57 +3033,78 @@ unwanted frames are iconified instead. | |||
| 2824 | @cindex child frames | 3033 | @cindex child frames |
| 2825 | @cindex parent frames | 3034 | @cindex parent frames |
| 2826 | 3035 | ||
| 2827 | On some window-systems the @code{parent-frame} parameter (@pxref{Frame | 3036 | Child frames are objects halfway between windows (@pxref{Windows}) and |
| 2828 | Interaction Parameters}) can be used to make a frame a child of the | 3037 | ``normal'' frames. Like windows, they are attached to an owning frame. |
| 2829 | frame specified by that parameter. The frame specified by that | 3038 | Unlike windows, they may overlap each other---changing the size or |
| 2830 | parameter will then be the frame's parent frame as long as the parameter | 3039 | position of one child frame does not change the size or position of any |
| 2831 | is not changed or reset. Technically, this makes the child frame's | 3040 | of its sibling child frames. |
| 2832 | window-system window a child window of the parent frame's window-system | 3041 | |
| 2833 | window. | 3042 | By design, operations to make or modify child frames are implemented |
| 3043 | with the help of frame parameters (@pxref{Frame Parameters}) without any | ||
| 3044 | specialized functions or customizable variables. Note that child frames | ||
| 3045 | are meaningful on graphical terminals only. | ||
| 3046 | |||
| 3047 | To create a new child frame or to convert a normal frame into a child | ||
| 3048 | frame, set that frame's @code{parent-frame} parameter (@pxref{Frame | ||
| 3049 | Interaction Parameters}) to that of an already existing frame. The | ||
| 3050 | frame specified by that parameter will then be the frame's parent frame | ||
| 3051 | as long as the parameter is not changed or reset. Technically, this | ||
| 3052 | makes the child frame's window-system window a child window of the | ||
| 3053 | parent frame's window-system window. | ||
| 2834 | 3054 | ||
| 3055 | @cindex top-level frame | ||
| 3056 | @cindex reparent frame | ||
| 3057 | @cindex nest frame | ||
| 2835 | The @code{parent-frame} parameter can be changed at any time. Setting | 3058 | The @code{parent-frame} parameter can be changed at any time. Setting |
| 2836 | it to another frame ``reparents'' the child frame. Setting it to | 3059 | it to another frame @dfn{reparents} the child frame. Setting it to |
| 2837 | another child frame makes the frame a ``nested'' child frame. Setting | 3060 | another child frame makes the frame a @dfn{nested} child frame. Setting |
| 2838 | it to @code{nil} restores the frame's status as a top-level frame---one | 3061 | it to @code{nil} restores the frame's status as a @dfn{top-level |
| 2839 | whose window-system window is a child of its display's root window. | 3062 | frame}---a frame whose window-system window is a child of its display's |
| 3063 | root window. | ||
| 2840 | 3064 | ||
| 2841 | Since child frames can be arbitrarily nested, a frame can be both a | 3065 | Since child frames can be arbitrarily nested, a frame can be both a |
| 2842 | child and a parent frame. Also, the relative roles of child and parent | 3066 | child and a parent frame. Also, the relative roles of child and parent |
| 2843 | frame may be reversed at any time (though it's usually a good idea to | 3067 | frame may be reversed at any time (though it's usually a good idea to |
| 2844 | keep the size of child frames sufficiently smaller than that of their | 3068 | keep the size of a child frame sufficiently smaller than that of its |
| 2845 | parent). An error will be signaled for the attempt to make a frame an | 3069 | parent). An error will be signaled for the attempt to make a frame an |
| 2846 | ancestor of itself. | 3070 | ancestor of itself. |
| 2847 | 3071 | ||
| 2848 | A child frame is clipped at the native edges (@pxref{Frame Geometry}) | 3072 | Most window-systems clip a child frame at the native edges |
| 2849 | of its parent frame---everything outside these edges is invisible. Its | 3073 | (@pxref{Frame Geometry}) of its parent frame---everything outside these |
| 2850 | @code{left} and @code{top} parameters specify positions relative to the | 3074 | edges is usually invisible. A child frame's @code{left} and @code{top} |
| 2851 | top-left corner of its parent's native frame. When either of the frames | 3075 | parameters specify a position relative to the top-left corner of its |
| 2852 | is resized, the relative position of the child frame remains unaltered. | 3076 | parent's native frame. When the parent frame is resized, this position |
| 2853 | Hence, resizing either of these frames can hide or reveal parts of the | 3077 | remains conceptually unaltered. |
| 2854 | child frame. | ||
| 2855 | 3078 | ||
| 2856 | NS builds do not clip child frames at the parent frame's edges, | 3079 | NS builds do not clip child frames at the parent frame's edges, |
| 2857 | allowing them to be positioned so they do not obscure the parent | 3080 | allowing them to be positioned so they do not obscure the parent frame |
| 2858 | frame while still being visible themselves. | 3081 | while still being visible themselves. |
| 2859 | 3082 | ||
| 2860 | Usually, moving a parent frame moves along all its child frames and | 3083 | Usually, moving a parent frame moves along all its child frames and |
| 2861 | their descendants as well, keeping their relative positions unaltered. | 3084 | their descendants as well, keeping their relative positions unaltered. |
| 2862 | The hook @code{move-frame-functions} (@pxref{Frame Position}) is run for | 3085 | Note that the hook @code{move-frame-functions} (@pxref{Frame Position}) |
| 2863 | a child frame only when the position of the child frame relative to its | 3086 | is run for a child frame only when the position of the child frame |
| 2864 | parent frame changes. When a parent frame is resized, the child frame | 3087 | relative to its parent frame changes. It is not run for a child frame |
| 2865 | retains its position respective to the left and upper native edges of | 3088 | when the position of the parent frame changes. |
| 2866 | its parent. In this case, the position respective to the lower or right | 3089 | |
| 2867 | native edge of the parent frame is usually lost. | 3090 | When a parent frame is resized, its child frames conceptually retain |
| 3091 | their previous sizes and their positions relative to the left upper | ||
| 3092 | corner of the parent. This means that a child frame may become | ||
| 3093 | (partially) invisible when its parent frame shrinks. The parameter | ||
| 3094 | @code{keep-ratio} (@pxref{Frame Interaction Parameters}) can be used to | ||
| 3095 | resize and reposition a child frame proportionally whenever its parent | ||
| 3096 | frame is resized. This may avoid obscuring parts of a frame when its | ||
| 3097 | parent frame is shrunk. | ||
| 2868 | 3098 | ||
| 2869 | A visible child frame always appears on top of its parent frame thus | 3099 | A visible child frame always appears on top of its parent frame thus |
| 2870 | obscuring parts of it, except on NS builds where it may be positioned | 3100 | obscuring parts of it, except on NS builds where it may be positioned |
| 2871 | beneath the parent. This is comparable to the window-system window of | 3101 | beneath the parent. This is comparable to the window-system window of a |
| 2872 | a top-level frame which also always appears on top of its parent | 3102 | top-level frame which also always appears on top of its parent |
| 2873 | window---the desktop's root window. When a parent frame is iconified | 3103 | window---the desktop's root window. When a parent frame is iconified or |
| 2874 | or made invisible (@pxref{Visibility of Frames}), its child frames are | 3104 | made invisible (@pxref{Visibility of Frames}), its child frames are made |
| 2875 | made invisible. When a parent frame is deiconified or made visible, | 3105 | invisible. When a parent frame is deiconified or made visible, its |
| 2876 | its child frames are made visible. When a parent frame is about to be | 3106 | child frames are made visible. When a parent frame is about to be |
| 2877 | deleted, (@pxref{Deleting Frames}) its child frames are recursively | 3107 | deleted (@pxref{Deleting Frames}), its child frames are recursively |
| 2878 | deleted before it. | 3108 | deleted before it. |
| 2879 | 3109 | ||
| 2880 | Whether a child frame can have a menu or tool bar is window-system or | 3110 | Whether a child frame can have a menu or tool bar is window-system or |
| @@ -2892,7 +3122,55 @@ outer border can be used. On MS-Windows, specifying a non-zero outer | |||
| 2892 | border width will show a one-pixel wide external border. Under all | 3122 | border width will show a one-pixel wide external border. Under all |
| 2893 | window-systems, the internal border can be used. In either case, it's | 3123 | window-systems, the internal border can be used. In either case, it's |
| 2894 | advisable to disable a child frame's window manager decorations with the | 3124 | advisable to disable a child frame's window manager decorations with the |
| 2895 | @code{undecorated} frame parameter @pxref{Management Parameters}). | 3125 | @code{undecorated} frame parameter (@pxref{Management Parameters}). |
| 3126 | |||
| 3127 | To resize or move an undecorated child frame with the mouse, special | ||
| 3128 | frame parameters (@pxref{Mouse Dragging Parameters}) have to be used. | ||
| 3129 | The internal border of a child frame, if present, can be used to resize | ||
| 3130 | the frame with the mouse, provided that frame has a non-@code{nil} | ||
| 3131 | @code{drag-internal-border} parameter. If set, the @code{snap-width} | ||
| 3132 | parameter indicates the number of pixels where the frame @dfn{snaps} at | ||
| 3133 | the respective edge or corner of its parent frame. | ||
| 3134 | |||
| 3135 | There are two ways to drag an entire child frame with the mouse: The | ||
| 3136 | @code{drag-with-mode-line} parameter, if non-@code{nil}, allows to drag | ||
| 3137 | a frame without minibuffer window (@pxref{Minibuffer Windows}) via the | ||
| 3138 | mode line area of its bottommost window. The | ||
| 3139 | @code{drag-with-header-line} parameter, if non-@code{nil}, allows to | ||
| 3140 | drag the frame via the header line area of its topmost window. | ||
| 3141 | |||
| 3142 | In order to give a child frame a draggable header or mode line, the | ||
| 3143 | window parameters @code{mode-line-format} and @code{header-line-format} | ||
| 3144 | are handy (@pxref{Window Parameters}). These allow to remove an | ||
| 3145 | unwanted mode line (when @code{drag-with-header-line} is chosen) and to | ||
| 3146 | remove mouse-sensitive areas which might interfere with frame dragging. | ||
| 3147 | |||
| 3148 | To avoid that dragging moves a frame completely out of its parent's | ||
| 3149 | native frame, something which might happen when the mouse cursor | ||
| 3150 | overshoots and makes the frame difficult to retrieve once the mouse | ||
| 3151 | button has been released, it is advisable to set the frame's | ||
| 3152 | @code{top-visible} or @code{bottom-visible} parameter correspondingly. | ||
| 3153 | |||
| 3154 | The @code{top-visible} parameter specifies the number of pixels at the | ||
| 3155 | top of the frame that always remain visible within the parent's native | ||
| 3156 | frame during dragging and should be set when specifying a non-@code{nil} | ||
| 3157 | @code{drag-with-header-line} parameter. The @code{bottom-visible} | ||
| 3158 | parameter specifies the number of pixels at the bottom of the frame that | ||
| 3159 | always remain visible within the parent's native frame during dragging | ||
| 3160 | and should be preferred when specifying a non-@code{nil} | ||
| 3161 | @code{drag-with-mode-line} parameter. | ||
| 3162 | |||
| 3163 | When a child frame is used for displaying a buffer via | ||
| 3164 | @code{display-buffer-in-child-frame} (@pxref{Display Action Functions}), | ||
| 3165 | the frame's @code{auto-hide-function} parameter (@pxref{Frame | ||
| 3166 | Interaction Parameters}) can be set to a function, in order to | ||
| 3167 | appropriately deal with the frame when the window displaying the buffer | ||
| 3168 | shall be quit. | ||
| 3169 | |||
| 3170 | When a child frame is used during minibuffer interaction, for example, | ||
| 3171 | to display completions in a separate window, the @code{minibuffer-exit} | ||
| 3172 | parameter (@pxref{Frame Interaction Parameters}) is useful in order to | ||
| 3173 | deal with the frame when the minibuffer is exited. | ||
| 2896 | 3174 | ||
| 2897 | The behavior of child frames deviates from that of top-level frames in | 3175 | The behavior of child frames deviates from that of top-level frames in |
| 2898 | a number of other ways as well. Here we sketch a few of them: | 3176 | a number of other ways as well. Here we sketch a few of them: |
| @@ -2930,7 +3208,7 @@ work on all window-systems. Some will drop the object on the parent | |||
| 2930 | frame or on some ancestor instead. | 3208 | frame or on some ancestor instead. |
| 2931 | @end itemize | 3209 | @end itemize |
| 2932 | 3210 | ||
| 2933 | The following two functions may be useful when working with child and | 3211 | The following two functions can be useful when working with child and |
| 2934 | parent frames: | 3212 | parent frames: |
| 2935 | 3213 | ||
| 2936 | @defun frame-parent &optional frame | 3214 | @defun frame-parent &optional frame |
| @@ -2951,6 +3229,12 @@ of @var{descendant}'s parent frame. Both, @var{ancestor} and | |||
| 2951 | frame. | 3229 | frame. |
| 2952 | @end defun | 3230 | @end defun |
| 2953 | 3231 | ||
| 3232 | Note also the function @code{window-largest-empty-rectangle} | ||
| 3233 | (@pxref{Coordinates and Windows}) which can be used to inscribe a child | ||
| 3234 | frame in the largest empty area of an existing window. This can be | ||
| 3235 | useful to avoid that a child frame obscures any text shown in that | ||
| 3236 | window. | ||
| 3237 | |||
| 2954 | 3238 | ||
| 2955 | @node Mouse Tracking | 3239 | @node Mouse Tracking |
| 2956 | @section Mouse Tracking | 3240 | @section Mouse Tracking |