1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561
|
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998 Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../info/frames
@node Frames, Positions, Windows, Top
@c @chapter Frames
@chapter $B%U%l!<%`(B
@c @cindex frame
@cindex $B%U%l!<%`(B
@c A @dfn{frame} is a rectangle on the screen that contains one or more
@c Emacs windows. A frame initially contains a single main window (plus
@c perhaps a minibuffer window), which you can subdivide vertically or
@c horizontally into smaller windows.
@dfn{$B%U%l!<%`(B}$B!J(Bframe$B!K$H$O!"(B1$B$D$+$=$l0J>e$N(BEmacs$B$N%&%#%s%I%&$r(B
$B<}$a$F$$$k%9%/%j!<%s>e$N6k7A$G$9!#(B
$B%U%l!<%`$K$O:G=i$O(B1$B$D$N%&%#%s%I%&!J$*$h$S%_%K%P%C%U%!MQ%&%#%s%I%&!K$,(B
$B$"$j$^$9$,!"$=$l$r>e2<$d:81&$K>.$5$J%&%#%s%I%&$KJ,3d$G$-$^$9!#(B
@c @cindex terminal frame
@cindex $BC<Kv%U%l!<%`(B
@c When Emacs runs on a text-only terminal, it starts with one
@c @dfn{terminal frame}. If you create additional ones, Emacs displays
@c one and only one at any given time---on the terminal screen, of course.
Emacs$B$rJ8;zC<Kv$G<B9T$9$k$H!"(B
1$B$D$N(B@dfn{$BC<Kv%U%l!<%`(B}$B!J(Bterminal frame$B!K$r;H$$$^$9!#(B
$BJL$N%U%l!<%`$r:n@.$9$k$H!"$b$A$m$sC<Kv2hLL>e$G$O!"(B
Emacs$B$O0lEY$K(B1$B$D$N%U%l!<%`$7$+I=<($7$^$;$s!#(B
@c @cindex window frame
@cindex $B%&%#%s%I%&%U%l!<%`(B
@c When Emacs communicates directly with a supported window system, such
@c as X Windows, it does not have a terminal frame; instead, it starts with
@c a single @dfn{window frame}, but you can create more, and Emacs can
@c display several such frames at once as is usual for window systems.
Emacs$B$,(BX$B%&%#%s%I%&$N$h$&$JBP1~$7$F$$$k%&%#%s%I%&%7%9%F%`$H(B
$BD>@\DL?.$7$F$$$k$H$-$K$O!"C<Kv%U%l!<%`$O;H$$$^$;$s!#(B
$B$=$N$+$o$j$K!"(B1$B$D$N(B@dfn{$B%&%#%s%I%&%U%l!<%`(B}$B!J(Bwindow frame$B!K$G;O$^$j$^$9$,!"(B
$B$$$/$D$G$b%U%l!<%`$r:n$l$^$9$7!"%&%#%s%I%&%7%9%F%`$G$OIaDL$N$3$H$G$9$,!"(B
Emacs$B$O$=$N$h$&$J%U%l!<%`$rF1;~$KJ#?tI=<($G$-$^$9!#(B
@defun framep object
@c This predicate returns @code{t} if @var{object} is a frame, and
@c @code{nil} otherwise.
$B$3$N4X?t$O!"(B@var{object}$B$,%U%l!<%`$J$i$P(B@code{t}$B$rJV$7!"(B
$B$5$b$J$1$l$P(B@code{nil}$B$rJV$9!#(B
@end defun
@menu
* Creating Frames:: Creating additional frames.
* Multiple Displays:: Creating frames on other displays.
* Frame Parameters:: Controlling frame size, position, font, etc.
* Frame Titles:: Automatic updating of frame titles.
* Deleting Frames:: Frames last until explicitly deleted.
* Finding All Frames:: How to examine all existing frames.
* Frames and Windows:: A frame contains windows;
display of text always works through windows.
* Minibuffers and Frames:: How a frame finds the minibuffer to use.
* Input Focus:: Specifying the selected frame.
* Visibility of Frames:: Frames may be visible or invisible, or icons.
* Raising and Lowering:: Raising a frame makes it hide other windows;
lowering it makes the others hide them.
* Frame Configurations:: Saving the state of all frames.
* Mouse Tracking:: Getting events that say when the mouse moves.
* Mouse Position:: Asking where the mouse is, or moving it.
* Pop-Up Menus:: Displaying a menu for the user to select from.
* Dialog Boxes:: Displaying a box to ask yes or no.
* Pointer Shapes:: Specifying the shape of the mouse pointer.
* Window System Selections:: Transferring text to and from other X clients.
* Font Names:: Looking up font names.
* Fontsets:: A fontset is a collection of fonts
for displaying various character sets.
* Color Names:: Getting the definitions of color names.
* Resources:: Getting resource values from the server.
* Server Data:: Getting info about the X server.
@end menu
@c @xref{Display}, for information about the related topic of
@c controlling Emacs redisplay.
Emacs$B$N:FI=<($N@)8f$K4XO"$9$k>pJs$K$D$$$F$O(B@xref{Display}$B!#(B
@node Creating Frames
@c @section Creating Frames
@section $B%U%l!<%`$N:n@.(B
@c To create a new frame, call the function @code{make-frame}.
$B?7$?$J%U%l!<%`$r:n@.$9$k$K$O!"4X?t(B@code{make-frame}$B$r8F$S=P$7$^$9!#(B
@defun make-frame &optional alist
@c This function creates a new frame. If you are using a supported window
@c system, it makes a window frame; otherwise, it makes a terminal frame.
$B$3$N4X?t$O?7$?$J%U%l!<%`$r:n@.$9$k!#(B
$BBP1~$7$F$$$k%&%#%s%I%&%7%9%F%`$r;H$C$F$$$l$P!"%&%#%s%I%&%U%l!<%`$r:n$k!#(B
$B$5$b$J$1$l$PC<Kv%U%l!<%`$r:n$k!#(B
@c The argument is an alist specifying frame parameters. Any parameters
@c not mentioned in @var{alist} default according to the value of the
@c variable @code{default-frame-alist}; parameters not specified even there
@c default from the standard X resources or whatever is used instead on
@c your system.
$B0z?t(B@var{alist}$B$O%U%l!<%`%Q%i%a!<%?$r;XDj$9$kO"A[%j%9%H$G$"$k!#(B
@var{alist}$B$G;XDj$7$F$$$J$$%Q%i%a!<%?$O!"(B
$BJQ?t(B@code{default-frame-alist}$B$NCM$K=>$C$F7h$^$k!#(B
$B$=$l$G$b7h$^$i$J$$%Q%i%a!<%?$O!"(B
$BI8=`$N(BX$B%j%=!<%9$d$=$l$K$+$o$kFI<T$N%7%9%F%`$N@_Dj$r;H$&!#(B
@c The set of possible parameters depends in principle on what kind of
@c window system Emacs uses to display its frames. @xref{Window Frame
@c Parameters}, for documentation of individual parameters you can specify.
$B;XDj2DG=$J%Q%i%a!<%?$O!"(BEmacs$B$,%U%l!<%`$NI=<($K;H$&(B
$B%&%#%s%I%&%7%9%F%`$N<oN`$K86M}E*$K$O0MB8$7$^$9!#(B
$B;XDj2DG=$J3F%Q%i%a!<%?$N@bL@$O!"(B@pxref{Window Frame Parameters}$B!#(B
@end defun
@defvar before-make-frame-hook
@tindex before-make-frame-hook
@c A normal hook run by @code{make-frame} before it actually creates the
@c frame.
@code{make-frame}$B$,%U%l!<%`$r<B:]$K:n@.$9$kD>A0$K<B9T$9$k%N!<%^%k%U%C%/!#(B
@end defvar
@defvar after-make-frame-hook
@tindex after-make-frame-hook
@c An abnormal hook run by @code{make-frame} after it creates the frame.
@c Each function in @code{after-make-frame-hook} receives one argument, the
@c frame just created.
@code{make-frame}$B$,%U%l!<%`$r:n@.8e$K<B9T$9$k%"%V%N!<%^%k%U%C%/!#(B
@code{after-make-frame-hook}$B$N3F4X?t$O!"(B1$B$D$N0z?t!"(B
$B$D$^$j!":n@.$7$?$P$+$j$N%U%l!<%`$r<u$1<h$k!#(B
@end defvar
@node Multiple Displays
@c @section Multiple Displays
@section $BJ#?t%G%#%9%W%l%$(B
@c @cindex multiple X displays
@c @cindex displays, multiple
@cindex $BJ#?t$N(BX$B%G%#%9%W%l%$(B
@cindex $B%G%#%9%W%l%$!"J#?t(B
@c A single Emacs can talk to more than one X display.
@c Initially, Emacs uses just one display---the one chosen with the
@c @code{DISPLAY} environment variable or with the @samp{--display} option
@c (@pxref{Initial Options,,, emacs, The GNU Emacs Manual}). To connect to
@c another display, use the command @code{make-frame-on-display} or specify
@c the @code{display} frame parameter when you create the frame.
1$B$D$N(BEmacs$B$OJ#?t$N(BX$B%G%#%9%W%l%$$HDL?.$G$-$^$9!#(B
Emacs$B$O;O$a$O(B1$B$D$N%G%#%9%W%l%$!"$D$^$j!"(B
$B4D6-JQ?t(B@code{DISPLAY}$B$+%*%W%7%g%s(B@samp{--display}
$B!J(B@pxref{Initial Options,, $B=i4|2=%*%W%7%g%s(B, emacs,
GNU Emacs $B%^%K%e%"%k(B}$B!K$G7h$^$k(B
$B$b$N$r;H$$$^$9!#(B
$BJL$N%G%#%9%W%l%$$K@\B3$9$k$K$O!"(B
$B%3%^%s%I(B@code{make-frame-on-display}$B$r;H$&$+!"(B
$B%U%l!<%`$r:n$k$H$-$K%U%l!<%`%Q%i%a!<%?(B@code{display}$B$r;XDj$7$^$9!#(B
@c Emacs treats each X server as a separate terminal, giving each one its
@c own selected frame and its own minibuffer windows.
Emacs$B$O3F(BX$B%5!<%P!<$rJL!9$NC<Kv$H$7$F07$$!"(B
$B$=$l$i$N$*$N$*$N$K$OA*Br$5$l$F$$$k%U%l!<%`$H(B
$B%_%K%P%C%U%!MQ%&%#%s%I%&$,$"$j$^$9!#(B
@c A few Lisp variables are @dfn{terminal-local}; that is, they have a
@c separate binding for each terminal. The binding in effect at any time
@c is the one for the terminal that the currently selected frame belongs
@c to. These variables include @code{default-minibuffer-frame},
@c @code{defining-kbd-macro}, @code{last-kbd-macro}, and
@c @code{system-key-alist}. They are always terminal-local, and can never
@c be buffer-local (@pxref{Buffer-Local Variables}) or frame-local.
$B>/?t$N(BLisp$BJQ?t$O(B@dfn{$BC<Kv$K%m!<%+%k(B}$B!J(Bterminal-local$B!K$G$9!#(B
$B$D$^$j!"3FC<Kv$4$H$KJL!9$NB+G{$,$"$j$^$9!#(B
$B$"$k;~E@$GM-8z$JB+G{$O!"A*Br$5$l$F$$$k%U%l!<%`$,B0$9$kC<Kv$N$b$N$G$9!#(B
$B$3$N$h$&$JJQ?t$K$O!"(B@code{default-minibuffer-frame}$B!"(B
@code{defining-kbd-macro}$B!"(B@code{last-kbd-macro}$B!"(B
@code{system-key-alist}$B$,$"$j$^$9!#(B
$B$3$l$i$O$D$M$KC<Kv$K%m!<%+%k$G$"$j!"(B
$B%P%C%U%!%m!<%+%k!J(B@pxref{Buffer-Local Variables}$B!K$d(B
$B%U%l!<%`%m!<%+%k$K$O$1$C$7$F$J$j$^$;$s!#(B
@c A single X server can handle more than one screen. A display name
@c @samp{@var{host}:@var{server}.@var{screen}} has three parts; the last
@c part specifies the screen number for a given server. When you use two
@c screens belonging to one server, Emacs knows by the similarity in their
@c names that they share a single keyboard, and it treats them as a single
@c terminal.
1$B$D$N(BX$B%5!<%P!<$OJ#?t$N%9%/%j!<%s$r07$($^$9!#(B
$B%G%#%9%W%l%$L>(B@samp{@var{host}:@var{server}.@var{screen}}$B$K$O(B3$B$D$NItJ,$,$"$j!"(B
$B:G8e$NItJ,$G;XDj$7$?%5!<%P!<$N%9%/%j!<%sHV9f$r;XDj$7$^$9!#(B
1$B$D$N%5!<%P!<$KB0$9$k(B2$B$D$N%9%/%j!<%s$r;H$&$H!"(B
Emacs$B$O$=$l$i$NL>A0$NN`;w@-$+$i$=$l$i$,(B1$B$D$N%-!<%\!<%I$r6&M-$7$F$$$k$HH=CG$7!"(B
$B$=$l$i$N%9%/%j!<%s$r(B1$B$D$NC<Kv$H$7$F07$$$^$9!#(B
@c @deffn Command make-frame-on-display display &optional parameters
@deffn $B%3%^%s%I(B make-frame-on-display display &optional parameters
@c This creates a new frame on display @var{display}, taking the other
@c frame parameters from @var{parameters}. Aside from the @var{display}
@c argument, it is like @code{make-frame} (@pxref{Creating Frames}).
$B?7$?$J%U%l!<%`$r%G%#%9%W%l%$(B@var{display}$B>e$K:n@.$9$k!#(B
$BB>$N%U%l!<%`%Q%i%a!<%?$O(B@var{parameters}$B$+$iF@$k!#(B
$B0z?t(B@var{display}$B$r=|$1$P(B@code{make-frame}$B!J(B@pxref{Creating Frames}$B!K$H(B
$BF1MM$G$"$k!#(B
@end deffn
@defun x-display-list
@c This returns a list that indicates which X displays Emacs has a
@c connection to. The elements of the list are strings, and each one is
@c a display name.
Emacs$B$,@\B3$7$F$$$k(BX$B%G%#%9%W%l%$$rI=$9%j%9%H$rJV$9!#(B
$B%j%9%H$NMWAG$OJ8;zNs$G$"$j!"$=$l$>$l$O%G%#%9%W%l%$L>$G$"$k!#(B
@end defun
@defun x-open-connection display &optional xrm-string
@c This function opens a connection to the X display @var{display}. It
@c does not create a frame on that display, but it permits you to check
@c that communication can be established with that display.
$B$3$N4X?t$O(BX$B%G%#%9%W%l%$(B@var{display}$B$H$N@\B3$r3+$/!#(B
$BEv3:%G%#%9%W%l%$>e$K%U%l!<%`$O:n$i$J$$$,!"(B
$B$3$l$K$h$jEv3:%G%#%9%W%l%$$HDL?.2DG=$+$I$&$+8!::$G$-$k!#(B
@c The optional argument @var{xrm-string}, if not @code{nil}, is a
@c string of resource names and values, in the same format used in the
@c @file{.Xresources} file. The values you specify override the resource
@c values recorded in the X server itself; they apply to all Emacs frames
@c created on this display. Here's an example of what this string might
@c look like:
$B>JN,2DG=$J0z?t(B@var{xrm-string}$B$,(B@code{nil}$B$G$J$1$l$P!"(B
$B%U%!%$%k(B@file{.Xresources}$B$G;H$o$l=q<0$HF1$8(B
$B%j%=!<%9L>$HCM$rI=$9J8;zNs$G$"$k!#(B
$B$3$l$K;XDj$7$?CM$O!"(BX$B%5!<%P!<<+BN$K5-O?$5$l$F$$$k%j%=!<%9$NCM$KM%@h$7!"(B
Emacs$B$,Ev3:%G%#%9%W%l%$>e$K:n@.$9$k$9$Y$F$N%U%l!<%`$KE,MQ$5$l$k!#(B
$B$3$NJ8;zNs$NNc$r0J2<$K<($9!#(B
@example
"*BorderWidth: 3\n*InternalBorder: 2\n"
@end example
@c @xref{Resources}.
@pxref{Resources}$B!#(B
@end defun
@defun x-close-connection display
@c This function closes the connection to display @var{display}. Before
@c you can do this, you must first delete all the frames that were open on
@c that display (@pxref{Deleting Frames}).
$B$3$N4X?t$O%G%#%9%W%l%$(B@var{display}$B$H$N@\B3$rJD$8$k!#(B
$B$3$l$r9T$&$^$($K!"(B
$B$^$:Ev3:%G%#%9%W%l%$>e$K:n$C$?%U%l!<%`$r$9$Y$F:o=|$7$F$*$/$3$H!#(B
@end defun
@node Frame Parameters
@c @section Frame Parameters
@section $B%U%l!<%`%Q%i%a!<%?(B
@c A frame has many parameters that control its appearance and behavior.
@c Just what parameters a frame has depends on what display mechanism it
@c uses.
$B%U%l!<%`$K$O!"$=$N8+$?$a$d$U$k$^$$$r@)8f$9$kB?$/$N%Q%i%a!<%?$,$"$j$^$9!#(B
$B%U%l!<%`$N%Q%i%a!<%?$N<oN`$O!";HMQ$9$kI=<(5!9=$K0MB8$7$^$9!#(B
@c Frame parameters exist for the sake of window systems. A terminal frame
@c has a few parameters, mostly for compatibility's sake; only the @code{height},
@c @code{width}, @code{name}, @code{title}, @code{buffer-list} and
@c @code{buffer-predicate} parameters do something special.
$B%U%l!<%`%Q%i%a!<%?$O%&%#%s%I%&%7%9%F%`8~$1$G$9!#(B
$BC<Kv%U%l!<%`$K$O$4$/>/?t$N%Q%i%a!<%?$,$"$j$^$9$,!"(B
$B$=$N$[$H$s$I$O8_49@-$N$?$a$G$"$j!"(B
@code{height}$B!"(B@code{width}$B!"(B@code{name}$B!"(B@code{title}$B!"(B
@code{buffer-list}$B!"(B@code{buffer-predicate}$B$N%Q%i%a!<%?$@$1$,0UL#$r;}$A$^$9!#(B
@menu
* Parameter Access:: How to change a frame's parameters.
* Initial Parameters:: Specifying frame parameters when you make a frame.
* Window Frame Parameters:: List of frame parameters for window systems.
* Size and Position:: Changing the size and position of a frame.
@end menu
@node Parameter Access
@c @subsection Access to Frame Parameters
@subsection $B%U%l!<%`%Q%i%a!<%?$N;2>H(B
@c These functions let you read and change the parameter values of a
@c frame.
$B$3$l$i$N4X?t$O!"%U%l!<%`$N%Q%i%a!<%?$NCM$rFI$s$@$jJQ99$9$k$?$a$N$b$N$G$9!#(B
@defun frame-parameters frame
@c The function @code{frame-parameters} returns an alist listing all the
@c parameters of @var{frame} and their values.
$B4X?t(B@code{frame-parameters}$B$O!"(B
@var{frame}$B$N$9$Y$F$N%Q%i%a!<%?$H$=$l$i$NCM$+$i@.$kO"A[%j%9%H$rJV$9!#(B
@end defun
@defun modify-frame-parameters frame alist
@c This function alters the parameters of frame @var{frame} based on the
@c elements of @var{alist}. Each element of @var{alist} has the form
@c @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming a
@c parameter. If you don't mention a parameter in @var{alist}, its value
@c doesn't change.
$B$3$N4X?t$O!"(B@var{alist}$B$NMWAG$K4p$E$$$F%U%l!<%`(B@var{frame}$B$N(B
$B%Q%i%a!<%?$rJQ99$9$k!#(B
@var{alist}$B$N3FMWAG$O(B@code{(@var{parm} . @var{value})}$B$N7A$G$"$j!"(B
@var{parm}$B$O%Q%i%a!<%?$rI=$9%7%s%\%k$G$"$k!#(B
@var{alist}$B$K;XDj$7$J$$%Q%i%a!<%?$NCM$OJQ99$5$l$J$$!#(B
@end defun
@node Initial Parameters
@c @subsection Initial Frame Parameters
@subsection $B=i4|%U%l!<%`$N%Q%i%a!<%?(B
@c You can specify the parameters for the initial startup frame
@c by setting @code{initial-frame-alist} in your @file{.emacs} file.
$BFI<T$N%U%!%$%k(B@file{.emacs}$B$G(B@code{initial-frame-alist}$B$K@_Dj$9$l$P!"(B
$B5/F0;~$N=i4|%U%l!<%`$N%Q%i%a!<%?$r;XDj$G$-$^$9!#(B
@defvar initial-frame-alist
@c This variable's value is an alist of parameter values used when creating
@c the initial window frame. You can set this variable to specify the
@c appearance of the initial frame without altering subsequent frames.
@c Each element has the form:
$B$3$NJQ?t$NCM$O!"=i4|%U%l!<%`$r:n$k$H$-$K(B
$B;HMQ$9$k%Q%i%a!<%?$NCM$+$i@.$kO"A[%j%9%H$G$"$k!#(B
$B$3$NJQ?t$r;XDj$9$l$P=i4|%U%l!<%`$N8+$?$a$r;XDj$G$-$k$,!"(B
$B$=$l0J9_$K:n@.$9$k%U%l!<%`$K$O1F6A$7$J$$!#(B
$B3FMWAG$O$D$.$N7A$G$"$k!#(B
@example
(@var{parameter} . @var{value})
@end example
@c Emacs creates the initial frame before it reads your @file{~/.emacs}
@c file. After reading that file, Emacs checks @code{initial-frame-alist},
@c and applies the parameter settings in the altered value to the already
@c created initial frame.
Emacs$B$OFI<T$N%U%!%$%k(B@file{~/.emacs}$B$rFI$`$^$($K=i4|%U%l!<%`$r:n$k!#(B
$B$3$N%U%!%$%k$rFI$s$@$"$H$K!"(BEmacs$B$O(B@code{initial-frame-alist}$B$r8!::$7(B
$B0[$J$kCM$,@_Dj$5$l$F$$$k%Q%i%a!<%?$r$9$G$K:n@.$7$?=i4|%U%l!<%`$KE,MQ$9$k!#(B
@c If these settings affect the frame geometry and appearance, you'll see
@c the frame appear with the wrong ones and then change to the specified
@c ones. If that bothers you, you can specify the same geometry and
@c appearance with X resources; those do take affect before the frame is
@c created. @xref{Resources X,, X Resources, emacs, The GNU Emacs Manual}.
$B$3$l$i$N@_Dj$,%U%l!<%`$NBg$-$5$H0LCV$d8+$?$a$K4X$9$k$b$N$G$"$k$H!"(B
$B;XDj$H$O0c$&%U%l!<%`$,8=$l$F$+$i;XDj$7$?$b$N$KJQ$o$k$N$rL\$K$9$k!#(B
$B$3$l$,$o$:$i$o$7$$>l9g$K$O!"(BX$B%j%=!<%9$K$bF1$8Bg$-$5$H0LCV$d8+$?$a$r;XDj$9$k!#(B
X$B%j%=!<%9$O%U%l!<%`$r:n@.$9$k$^$($KE,MQ$5$l$k!#(B
@pxref{Resources X,, X$B%j%=!<%9(B, emacs, GNU Emacs $B%^%K%e%"%k(B}$B!#(B
@c X resource settings typically apply to all frames. If you want to
@c specify some X resources solely for the sake of the initial frame, and
@c you don't want them to apply to subsequent frames, here's how to achieve
@c this. Specify parameters in @code{default-frame-alist} to override the
@c X resources for subsequent frames; then, to prevent these from affecting
@c the initial frame, specify the same parameters in
@c @code{initial-frame-alist} with values that match the X resources.
X$B%j%=!<%9$N@_Dj$O!"E57?E*$K$O$9$Y$F$N%U%l!<%`$KE,MQ$5$l$k!#(B
$B=i4|%U%l!<%`$@$1$KFCDj$N(BX$B%j%=!<%9$r;XDj$7!"(B
$B$=$l0J9_$N%U%l!<%`$KE,MQ$7$?$/$J$$>l9g$K$O!"$D$.$N$h$&$K$9$k!#(B
$B%Q%i%a!<%?$r(B@code{default-frame-alist}$B$G;XDj$7!"(B
$B0J9_$N%U%l!<%`8~$1$N(BX$B%j%=!<%9$rL58z$K$9$k!#(B
$B$=$7$F$=$l$i$,=i4|%U%l!<%`$K1F6A$7$J$$$h$&$K!"(B
@code{initial-frame-alist}$B$N%Q%i%a!<%?$G(BX$B%j%=!<%9$K0lCW$9$kCM$r;XDj$9$k!#(B
@end defvar
@c If these parameters specify a separate minibuffer-only frame with
@c @code{(minibuffer . nil)}, and you have not created one, Emacs creates
@c one for you.
$B$3$l$i$N%Q%i%a!<%?$K%_%K%P%C%U%!@lMQ$N%U%l!<%`$r:n$k(B
@code{(minibuffer . nil)}$B$r;XDj$7$F$$$k$N$K(B
$B%_%K%P%C%U%!@lMQ%U%l!<%`$r:n$C$F$$$J$$$H!"(BEmacs$B$,$=$l$r:n@.$7$^$9!#(B
@defvar minibuffer-frame-alist
@c This variable's value is an alist of parameter values used when creating
@c an initial minibuffer-only frame---if such a frame is needed, according
@c to the parameters for the main initial frame.
$B$3$NJQ?t$NCM$O!"=i4|$N%_%K%P%C%U%!@lMQ%U%l!<%`$r:n$k$H$-$K;HMQ$9$k(B
$B%Q%i%a!<%?$NO"A[%j%9%H$G$"$k!#(B
$B=i4|%U%l!<%`$N%Q%i%a!<%?$+$i%_%K%P%C%U%!@lMQ%U%l!<%`$,(B
$BI,MW$G$"$k$HH=CG$9$k$H$=$l$r:n$k!#(B
@end defvar
@defvar default-frame-alist
@c This is an alist specifying default values of frame parameters for all
@c Emacs frames---the first frame, and subsequent frames. When using the X
@c Window System, you can get the same results by means of X resources
@c in many cases.
$B$3$l$O!"(BEmacs$B$N$9$Y$F$N%U%l!<%`!"$D$^$j!"(B
$B=i4|%U%l!<%`$H$=$l0J9_$N%U%l!<%`$N%U%l!<%`%Q%i%a!<%?$N%G%U%)%k%HCM$r(B
$B;XDj$9$kO"A[%j%9%H$G$"$k!#(B
X$B%&%#%s%I%&%7%9%F%`$r;H$C$F$$$k$H$-$K$O!"B?$/$N>l9g!"(B
X$B%j%=!<%9$K$h$C$F$bF1$87k2L$rF@$i$l$k!#(B
@end defvar
@c See also @code{special-display-frame-alist}, in @ref{Choosing Window}.
@ref{Choosing Window}$B$N(B@code{special-display-frame-alist}$B$b(B
$B;2>H$7$F$/$@$5$$!#(B
@c If you use options that specify window appearance when you invoke Emacs,
@c they take effect by adding elements to @code{default-frame-alist}. One
@c exception is @samp{-geometry}, which adds the specified position to
@c @code{initial-frame-alist} instead. @xref{Command Arguments,,, emacs,
@c The GNU Emacs Manual}.
Emacs$B$r5/F0$9$k$H$-$K%&%#%s%I%&$N8+$?$a$r;XDj$9$k%*%W%7%g%s$r;H$&$H!"(B
$B$=$l$i$O(B@code{default-frame-alist}$B$KMWAG$rDI2C$9$k$3$H$G8z2L$rH/4x$7$^$9!#(B
1$B$D$NNc30$O(B@samp{-geometry}$B$G!";XDj0LCV$O(B@code{initial-frame-alist}$B$K(B
$BDI2C$5$l$^$9!#(B
@xref{Command Arguments,, $B%3%^%s%I9T0z?t(B, emacs, GNU Emacs $B%^%K%e%"%k(B}$B!#(B
@node Window Frame Parameters
@c @subsection Window Frame Parameters
@subsection $B%&%#%s%I%&%U%l!<%`$N%Q%i%a!<%?(B
@c Just what parameters a frame has depends on what display mechanism it
@c uses. Here is a table of the parameters that have special meanings in a
@c window frame; of these, @code{name}, @code{title}, @code{height},
@c @code{width}, @code{buffer-list} and @code{buffer-predicate} provide
@c meaningful information in terminal frames.
$B%U%l!<%`$N%Q%i%a!<%?$N<oN`$O!";HMQ$9$kI=<(5!9=$K0MB8$7$^$9!#(B
$B%&%#%s%I%&%U%l!<%`$K$*$$$FFCJL$J0UL#$r;}$D%Q%i%a!<%?$N0lMw$r$D$.$K<($7$^$9!#(B
$B$3$l$i$N$&$A!"(B@code{name}$B!"(B@code{title}$B!"(B@code{height}$B!"(B
@code{width}$B!"(B@code{buffer-list}$B!"(B@code{buffer-predicate}$B$O(B
$BC<Kv%U%l!<%`$G$b0UL#$r;}$A$^$9!#(B
@table @code
@item display
@c The display on which to open this frame. It should be a string of the
@c form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the
@c @code{DISPLAY} environment variable.
$B$3$N%U%l!<%`$r3+$/%G%#%9%W%l%$!#(B
$B4D6-JQ?t(B@code{DISPLAY}$B$HF1MM$K!"(B
@code{"@var{host}:@var{dpy}.@var{screen}"}$B$N7A$NJ8;zNs$G$"$k$3$H!#(B
@item title
@c If a frame has a non-@code{nil} title, it appears in the window system's
@c border for the frame, and also in the mode line of windows in that frame
@c if @code{mode-line-frame-identification} uses @samp{%F}
@c (@pxref{%-Constructs}). This is normally the case when Emacs is not
@c using a window system, and can only display one frame at a time.
@c @xref{Frame Titles}.
$B%U%l!<%`$N%?%$%H%k(B@code{title}$B$,(B@code{nil}$B0J30$G$"$k$H!"(B
$B%U%l!<%`8~$1$N%&%#%s%I%&%7%9%F%`$NOH$K%?%$%H%k$,8=$l$k!#(B
$B$^$?!"(B@code{mode-line-frame-identification}$B$K(B@samp{%F}
$B!J(B@pxref{%-Constructs}$B!K$r;H$C$F$$$l$P!"(B
$BEv3:%U%l!<%`$N%b!<%I9T$K$b%?%$%H%k$,8=$l$k!#(B
Emacs$B$,%&%#%s%I%&%7%9%F%`$r;H$C$F$$$J$$>l9g$K$O!"(B
$B$3$l$OIaDL$O%b!<%I9T$KI=<($5$l0lEY$K(B1$B$D$N%U%l!<%`$@$1$rI=<($G$-$k!#(B
@pxref{Frame Titles}$B!#(B
@item name
@c The name of the frame. The frame name serves as a default for the frame
@c title, if the @code{title} parameter is unspecified or @code{nil}. If
@c you don't specify a name, Emacs sets the frame name automatically
@c (@pxref{Frame Titles}).
$B%U%l!<%`$NL>A0!#(B
$B%Q%i%a!<%?(B@code{title}$B$r;XDj$7$J$$$+(B@code{nil}$B$G$"$k$H!"(B
$B%U%l!<%`L>$O%U%l!<%`%?%$%H%k$N%G%U%)%k%H$K$J$k!#(B
@code{name}$B$r;XDj$7$J$$$H!"(BEmacs$B$,<+F0E*$K%U%l!<%`L>$r@_Dj$9$k(B
$B!J(B@pxref{Frame Titles}$B!K!#(B
@c If you specify the frame name explicitly when you create the frame, the
@c name is also used (instead of the name of the Emacs executable) when
@c looking up X resources for the frame.
$B%U%l!<%`$r:n$k$H$-$K%U%l!<%`L>$rL@<(E*$K;XDj$9$k$H!"(B
$B$=$NL>A0$O!J(BEmacs$B$N<B9T7A<0%U%!%$%k$NL>A0$N$+$o$j$K!K(B
$B%U%l!<%`8~$1$N(BX$B%j%=!<%9$rC5$9$?$a$K$b;H$o$l$k!#(B
@item left
@c The screen position of the left edge, in pixels, with respect to the
@c left edge of the screen. The value may be a positive number @var{pos},
@c or a list of the form @code{(+ @var{pos})} which permits specifying a
@c negative @var{pos} value.
$B%9%/%j!<%s$N:8C<$r4p=`$K$7$?%T%/%;%kC10L$N:8C<0LCV!#(B
$B$3$NCM$O@5$N?t(B@var{pos}$B$G$"$k$+!"(B
$BIi$N(B@var{pos}$B$NCM$r;XDj$G$-$k(B@code{(+ @var{pos})}$B$N7A$N%j%9%H$G$"$k!#(B
@c A negative number @minus{}@var{pos}, or a list of the form @code{(-
@c @var{pos})}, actually specifies the position of the right edge of the
@c window with respect to the right edge of the screen. A positive value
@c of @var{pos} counts toward the left. @strong{Reminder:} if the
@c parameter is a negative integer @minus{}@var{pos}, then @var{pos} is
@c positive.
$BIi$N?t(B@minus{}@var{pos}$B$d(B@code{(- @var{pos})}$B$N7A$N%j%9%H$O!"(B
$B<B:]$K$O!"%9%/%j!<%s$N1&C<$r4p=`$K$7$?%&%#%s%I%&$N1&C<0LCV$r;XDj$9$k!#(B
@var{pos}$B$N@5$NCM$O:8$X8~$1$F?t$($k!#(B
@strong{$BCm0U!'(B}@code{ }$B%Q%i%a!<%?$,Ii$N@0?t(B@minus{}@var{pos}$B$G$"$k$H!"(B
@var{pos}$B$O@5$G$"$k!#(B
@c Some window managers ignore program-specified positions. If you want to
@c be sure the position you specify is not ignored, specify a
@c non-@code{nil} value for the @code{user-position} parameter as well.
$B%W%m%0%i%`$,;XDj$7$?0LCV$rL5;k$9$k%&%#%s%I%&%^%M!<%8%c$b$"$k!#(B
$B;XDj$7$?0LCV$,L5;k$5$l$J$$$h$&$KJ]>Z$7$?$$>l9g$K$O!"(B
$B%Q%i%a!<%?(B@code{user-position}$B$K$b(B@code{nil}$B0J30$NCM$r;XDj$9$k!#(B
@item top
@c The screen position of the top edge, in pixels, with respect to the
@c top edge of the screen. The value may be a positive number @var{pos},
@c or a list of the form @code{(+ @var{pos})} which permits specifying a
@c negative @var{pos} value.
$B%9%/%j!<%s$N>eC<$r4p=`$K$7$?%T%/%;%kC10L$N>eC<0LCV!#(B
$B$3$NCM$O@5$N?t(B@var{pos}$B$G$"$k$+!"(B
$BIi$N(B@var{pos}$B$NCM$r;XDj$G$-$k(B@code{(+ @var{pos})}$B$N7A$N%j%9%H$G$"$k!#(B
@c A negative number @minus{}@var{pos}, or a list of the form @code{(-
@c @var{pos})}, actually specifies the position of the bottom edge of the
@c window with respect to the bottom edge of the screen. A positive value
@c of @var{pos} counts toward the top. @strong{Reminder:} if the
@c parameter is a negative integer @minus{}@var{pos}, then @var{pos} is
@c positive.
$BIi$N?t(B@minus{}@var{pos}$B$d(B@code{(- @var{pos})}$B$N7A$N%j%9%H$O!"(B
$B<B:]$K$O!"%9%/%j!<%s$N2<C<$r4p=`$K$7$?%&%#%s%I%&$N2<C<0LCV$r;XDj$9$k!#(B
@var{pos}$B$N@5$NCM$O>e$X8~$1$F?t$($k!#(B
@strong{$BCm0U!'(B}@code{ }$B%Q%i%a!<%?$,Ii$N@0?t(B@minus{}@var{pos}$B$G$"$k$H!"(B
@var{pos}$B$O@5$G$"$k!#(B
@c Some window managers ignore program-specified positions. If you want to
@c be sure the position you specify is not ignored, specify a
@c non-@code{nil} value for the @code{user-position} parameter as well.
$B%W%m%0%i%`$,;XDj$7$?0LCV$rL5;k$9$k%&%#%s%I%&%^%M!<%8%c$b$"$k!#(B
$B;XDj$7$?0LCV$,L5;k$5$l$J$$$h$&$KJ]>Z$7$?$$>l9g$K$O!"(B
$B%Q%i%a!<%?(B@code{user-position}$B$K$b(B@code{nil}$B0J30$NCM$r;XDj$9$k!#(B
@item icon-left
@c The screen position of the left edge @emph{of the frame's icon}, in
@c pixels, counting from the left edge of the screen. This takes effect if
@c and when the frame is iconified.
$B%9%/%j!<%s$N:8C<$r4p=`$K$7$?(B
@emph{$B%U%l!<%`$N%"%$%3%s(B}$B$N%T%/%;%kC10L$N:8C<0LCV!#(B
$B%U%l!<%`$r%"%$%3%s$K$7$?$H$-$K8z2L$rH/4x$9$k!#(B
@item icon-top
@c The screen position of the top edge @emph{of the frame's icon}, in
@c pixels, counting from the top edge of the screen. This takes effect if
@c and when the frame is iconified.
$B%9%/%j!<%s$N>eC<$r4p=`$K$7$?(B
@emph{$B%U%l!<%`$N%"%$%3%s(B}$B$N%T%/%;%kC10L$N>eC<0LCV!#(B
$B%U%l!<%`$r%"%$%3%s$K$7$?$H$-$K8z2L$rH/4x$9$k!#(B
@item user-position
@c When you create a frame and specify its screen position with the
@c @code{left} and @code{top} parameters, use this parameter to say whether
@c the specified position was user-specified (explicitly requested in some
@c way by a human user) or merely program-specified (chosen by a program).
@c A non-@code{nil} value says the position was user-specified.
$B%Q%i%a!<%?(B@code{left}$B$H(B@code{top}$B$G%9%/%j!<%s>e$N0LCV$r;XDj$7$F(B
$B%U%l!<%`$r:n$k$H$-$K!"$3$N%Q%i%a!<%?$O;XDj0LCV$,!"(B
$B!JMxMQ<T$,$J$s$i$+$NJ}K!$GM?$($?!K%f!<%6!<;XDj$N$b$N$J$N$+!"(B
$B!J%W%m%0%i%`$,A*$s$@!K%W%m%0%i%`;XDj$N$b$N$J$N$+$r;XDj$9$k!#(B
@code{nil}$B0J30$NCM$G$"$k$H%f!<%6!<;XDj$N0LCV$G$"$k$3$H$r0UL#$9$k!#(B
@c Window managers generally heed user-specified positions, and some heed
@c program-specified positions too. But many ignore program-specified
@c positions, placing the window in a default fashion or letting the user
@c place it with the mouse. Some window managers, including @code{twm},
@c let the user specify whether to obey program-specified positions or
@c ignore them.
$B%&%#%s%I%&%^%M!<%8%c$O%f!<%6!<;XDj$N0LCV$r0lHL$KB:=E$7!"(B
$B%W%m%0%i%`;XDj$N0LCV$bB:=E$9$k$b$N$b$"$k!#(B
$B$7$+$7$=$NB?$/$O%W%m%0%i%`;XDj$N0LCV$rL5;k$7!"(B
$B%G%U%)%k%H$K4p$E$$$F%&%#%s%I%&$rG[CV$7$?$j!"(B
$B%^%&%9$G%f!<%6!<$KG[CV$5$;$k!#(B
@code{twm}$B$r4^$`%&%#%s%I%&%^%M!<%8%c$K$O!"(B
$B%W%m%0%i%`;XDj$N0LCV$K=>$&$+$=$l$i$rL5;k$9$k$+$r(B
$B%f!<%6!<$,;XDj$G$-$k$b$N$b$"$k!#(B
@c When you call @code{make-frame}, you should specify a non-@code{nil}
@c value for this parameter if the values of the @code{left} and @code{top}
@c parameters represent the user's stated preference; otherwise, use
@c @code{nil}.
@code{make-frame}$B$r8F$S=P$9$H$-$K$O!"(B
$B%Q%i%a!<%?(B@code{left}$B$H(B@code{top}$B$NCM$,%f!<%6!<$N4uK>$rI=$9>l9g$K$O(B
$B$3$N%Q%i%a!<%?$NCM$K$O(B@code{nil}$B0J30$r;XDj$9$k$3$H!#(B
$B$5$b$J$1$l$P(B@code{nil}$B$r;XDj$9$k!#(B
@item height
@c The height of the frame contents, in characters. (To get the height in
@c pixels, call @code{frame-pixel-height}; see @ref{Size and Position}.)
$B%U%l!<%`$NFbB&$NJ8;zC10L$N9b$5!#(B
$B!J%T%/%;%kC10L$N9b$5$rF@$k$K$O(B@code{frame-pixel-height}$B$r8F$S=P$9!#(B
@ref{Size and Position}$B$r;2>H!#!K(B
@item width
@c The width of the frame contents, in characters. (To get the height in
@c = $B8m?"(B width
@c pixels, call @code{frame-pixel-width}; see @ref{Size and Position}.)
$B%U%l!<%`$NFbB&$NJ8;zC10L$NI}!#(B
$B!J%T%/%;%kC10L$NI}$rF@$k$K$O(B@code{frame-pixel-width}$B$r8F$S=P$9!#(B
@ref{Size and Position}$B$r;2>H!#!K(B
@item window-id
@c The number of the window-system window used by the frame.
$B%U%l!<%`$H$7$F;H$&%&%#%s%I%&%7%9%F%`$N%&%#%s%I%&HV9f!#(B
@item minibuffer
@c Whether this frame has its own minibuffer. The value @code{t} means
@c yes, @code{nil} means no, @code{only} means this frame is just a
@c minibuffer. If the value is a minibuffer window (in some other frame),
@c the new frame uses that minibuffer.
$B$3$N%U%l!<%`$KFH<+$N%_%K%P%C%U%!$,$"$k$+$I$&$+$rI=$9!#(B
$BCM(B@code{t}$B$O$"$k$3$H$rI=$7!"(B@code{nil}$B$O$J$$$3$H$rI=$9!#(B
@code{only}$B$O!"$3$N%U%l!<%`$,%_%K%P%C%U%!$@$1$G$"$k$3$H$rI=$9!#(B
$B!JJL$N%U%l!<%`$N!KCM$,%_%K%P%C%U%!$@$1$G$"$k$H!"(B
$B?7$?$J%U%l!<%`$O$=$N%_%K%P%C%U%!$r;H$&!#(B
@item buffer-predicate
@c The buffer-predicate function for this frame. The function
@c @code{other-buffer} uses this predicate (from the selected frame) to
@c decide which buffers it should consider, if the predicate is not
@c @code{nil}. It calls the predicate with one argument, a buffer, once for
@c each buffer; if the predicate returns a non-@code{nil} value, it
@c considers that buffer.
$B$3$N%U%l!<%`8~$1$N%P%C%U%!=R8l4X?t!#(B
$B$3$l$,(B@code{nil}$B$G$J$1$l$P!"(B
$B4X?t(B@code{other-buffer}$B$,!JA*Br$5$l$F$$$k%U%l!<%`$+$i!K$3$N=R8l$r;HMQ$7$F!"(B
$B$I$N%P%C%U%!$K$9$k$+$r7hDj$9$k!#(B
@code{other-buffer}$B$O3F%P%C%U%!$4$H$K%P%C%U%!$r0z?t$H$7$F$3$N=R8l$r8F$S=P$9!#(B
$B$3$N=R8l$,(B@code{nil}$B0J30$rJV$9$HEv3:%P%C%U%!$rA*$V!#(B
@item buffer-list
@c A list of buffers that have been selected in this frame,
@c ordered most-recently-selected first.
$B$3$N%U%l!<%`$GA*Br$5$l$?%P%C%U%!$r(B
$B$b$C$H$b:G6a$KA*Br$5$l$?$b$N$+$i=g$KJB$Y$?%j%9%H!#(B
@item font
@c The name of the font for displaying text in the frame. This is a
@c string, either a valid font name for your system or the name of an Emacs
@c fontset (@pxref{Fontsets}).
$B%U%l!<%`Fb$G%F%-%9%H$NI=<($K;H$&%U%)%s%H$NL>A0!#(B
$B$3$l$O!"FI<T$N%7%9%F%`$K$*$$$F@5$7$$%U%)%s%H$NL>A0$G$"$k$+(B
Emacs$B$N%U%)%s%H%;%C%H!J(B@pxref{Fontsets}$B!K$NL>A0$rI=$9J8;zNs$G$"$k!#(B
@item auto-raise
@c Whether selecting the frame raises it (non-@code{nil} means yes).
$B%U%l!<%`$rA*Br$7$?$H$-$K%U%l!<%`$r<jA0$K0\F0$9$k$+$I$&$+$rI=$9(B
$B!J(B@code{nil}$B0J30$G$"$k$H$=$N$h$&$K$9$k!K!#(B
@item auto-lower
@c Whether deselecting the frame lowers it (non-@code{nil} means yes).
$B%U%l!<%`$NA*Br$r;_$a$?$H$-$K%U%l!<%`$r1|$X0\F0$9$k$+$I$&$+$rI=$9(B
$B!J(B@code{nil}$B0J30$G$"$k$H$=$N$h$&$K$9$k!K!#(B
@item vertical-scroll-bars
@c Whether the frame has scroll bars for vertical scrolling, and which side
@c of the frame they should be on. The possible values are @code{left},
@c @code{right}, and @code{nil} for no scroll bars.
$B%U%l!<%`$K?bD>%9%/%m!<%kMQ$N%9%/%m!<%k%P!<$rIU$1$k$+$I$&$+!"(B
$B$I$A$iB&$KIU$1$k$+$rI=$9!#(B
$B;XDj$G$-$kCM$O!"(B@code{left}$B!"(B@code{right}$B!"$"$k$$$O(B
$B%9%/%m!<%k%P!<$J$7$r0UL#$9$k(B@code{nil}$B!#(B
@item horizontal-scroll-bars
@c Whether the frame has scroll bars for horizontal scrolling
@c (non-@code{nil} means yes). (Horizontal scroll bars are not currently
@c implemented.)
$B?eJ?%9%/%m!<%kMQ$N%9%/%m!<%k%P!<$rIU$1$k$+$I$&$+$rI=$9(B
$B!J(B@code{nil}$B0J30$@$HIU$1$k!K!#(B
$B!J?eJ?%9%/%m!<%k%P!<$O$$$^$N$H$3$m<BAu$7$F$J$$!#!K(B
@item scroll-bar-width
@c The width of the vertical scroll bar, in pixels.
$B?bD>%9%/%m!<%k%P!<$N%T%/%;%kC10L$NI}!#(B
@item icon-type
@c The type of icon to use for this frame when it is iconified. If the
@c value is a string, that specifies a file containing a bitmap to use.
@c Any other non-@code{nil} value specifies the default bitmap icon (a
@c picture of a gnu); @code{nil} specifies a text icon.
$B$3$N%U%l!<%`$r%"%$%3%s$K$7$?$H$-$K;H$&%"%$%3%s$N<oN`!#(B
$BCM$,J8;zNs$G$"$k$H!";HMQ$9$k%S%C%H%^%C%W$r<}$a$?%U%!%$%k$r;XDj$9$k!#(B
$B$=$l0J30$N(B@code{nil}$B0J30$NCM$O%G%U%)%k%H$N%S%C%H%^%C%W%"%$%3%s(B
$B!J(Bgnu$B$N3(!K$r;XDj$9$k!#(B
@code{nil}$B$O%F%-%9%H$N%"%$%3%s$r;XDj$9$k!#(B
@item icon-name
@c The name to use in the icon for this frame, when and if the icon
@c appears. If this is @code{nil}, the frame's title is used.
$B$3$N%U%l!<%`8~$1$N%"%$%3%s$rI=<($9$k$H$-$K;HMQ$9$k%"%$%3%s$NL>A0!#(B
$B$3$l$,(B@code{nil}$B$G$"$k$H!"%U%l!<%`$N%?%$%H%k$r;H$&!#(B
@item foreground-color
@c The color to use for the image of a character. This is a string; the
@c window system defines the meaningful color names.
$BJ8;z$NIA2h$K;H$&I=<(?'!#(B
$B$3$l$OJ8;zNs$G$"$k!#(B
$B%&%#%s%I%&%7%9%F%`$,BEEv$JI=<(?'$NL>>N$rDj5A$9$k!#(B
@c If you set the @code{foreground-color} frame parameter, you should
@c call @code{frame-update-face-colors} to update faces accordingly.
$B%U%l!<%`%Q%i%a!<%?(B@code{foreground-color}$B$K@_Dj$7$?$H$-$K$O!"(B
$B$=$l$KBP1~$7$F%U%'%$%9$r99?7$9$k$?$a$K(B
@code{frame-update-face-colors}$B$r8F$S=P$9$3$H!#(B
@item background-color
@c The color to use for the background of characters.
$BJ8;z$NGX7J$K;H$&I=<(?'!#(B
@c If you set the @code{background-color} frame parameter, you should
@c call @code{frame-update-face-colors} to update faces accordingly.
@c @xref{Face Functions}.
$B%U%l!<%`%Q%i%a!<%?(B@code{background-color}$B$K@_Dj$7$?$H$-$K$O!"(B
$B$=$l$KBP1~$7$F%U%'%$%9$r99?7$9$k$?$a$K(B
@code{frame-update-face-colors}$B$r8F$S=P$9$3$H!#(B
@pxref{Face Functions}$B!#(B
@item background-mode
@c This parameter is either @code{dark} or @code{light}, according
@c to whether the background color is a light one or a dark one.
$BGX7J?'$,L@$k$$$+0E$$$+$K$7$?$,$C$F!"(B
$B$3$N%Q%i%a!<%?$O(B@code{dark}$B$+(B@code{light}$B$G$"$k!#(B
@item mouse-color
@c The color for the mouse pointer.
$B%^%&%9%]%$%s%?$NI=<(?'!#(B
@item cursor-color
@c The color for the cursor that shows point.
$B%]%$%s%H$rI=$9%+!<%=%k$NI=<(?'!#(B
@item border-color
@c The color for the border of the frame.
$B%U%l!<%`$NOH$NI=<(?'!#(B
@item display-type
@c This parameter describes the range of possible colors that can be used
@c in this frame. Its value is @code{color}, @code{grayscale} or
@c @code{mono}.
$B$3$N%Q%i%a!<%?$O$3$N%U%l!<%`$G;HMQ2DG=$JI=<(?'$NHO0O$rI=$9!#(B
$BCM$O!"(B@code{color}$B!"(B@code{grayscale}$B!"(B@code{mono}$B$N$$$:$l$+$G$"$k!#(B
@item cursor-type
@c The way to display the cursor. The legitimate values are @code{bar},
@c @code{box}, and @code{(bar . @var{width})}. The symbol @code{box}
@c specifies an ordinary black box overlaying the character after point;
@c that is the default. The symbol @code{bar} specifies a vertical bar
@c between characters as the cursor. @code{(bar . @var{width})} specifies
@c a bar @var{width} pixels wide.
$B%+!<%=%k$NI=<(J}K!!#(B
$B@5$7$$CM$O!"(B@code{bar}$B!"(B@code{box}$B!"(B
@code{(bar . @var{width})}$B$N$$$:$l$+$G$"$k!#(B
$B%7%s%\%k(B@code{box}$B$O!"%]%$%s%HD>8e$NJ8;z$K=E$J$kDL>o$N9u$$H"7?$N(B
$B%+!<%=%k$r;XDj$7!"$3$l$,%G%U%)%k%H$G$"$k!#(B
$B%7%s%\%k(B@code{bar}$B$O!"%+!<%=%k$H$7$FJ8;z$N$"$$$@$K=DK@$rCV$/;XDj$G$"$k!#(B
@code{(bar . @var{width})}$B$O!"%T%/%;%kI}(B@var{width}$B$N=DK@$r;XDj$9$k!#(B
@item border-width
@c The width in pixels of the window border.
$B%&%#%s%I%&OH$N%T%/%;%kC10L$NI}!#(B
@item internal-border-width
@c The distance in pixels between text and border.
$BOH$H%F%-%9%H$N$"$$$@$N%T%/%;%kC10L$N4V3V!#(B
@item unsplittable
@c If non-@code{nil}, this frame's window is never split automatically.
@code{nil}$B0J30$G$"$k$H!"$3$N%U%l!<%`$N%&%#%s%I%&$r$1$C$7$F<+F0E*$KJ,3d$7$J$$!#(B
@item visibility
@c The state of visibility of the frame. There are three possibilities:
@c @code{nil} for invisible, @code{t} for visible, and @code{icon} for
@c iconified. @xref{Visibility of Frames}.
$B%U%l!<%`$N2D;k@-!#(B
$BIT2D;k$rI=$9(B@code{nil}$B!"2D;k$rI=$9(B@code{t}$B!"(B
$B%"%$%3%s$K$J$C$F$$$k$3$H$rI=$9(B@code{icon}$B$N(B3$B$N2DG=@-$,$"$k!#(B
@pxref{Visibility of Frames}$B!#(B
@item menu-bar-lines
@c The number of lines to allocate at the top of the frame for a menu bar.
@c The default is 1. @xref{Menu Bar}. (In Emacs versions that use the X
@c toolkit, there is only one menu bar line; all that matters about the
@c number you specify is whether it is greater than zero.)
$B%U%l!<%`$N>eC<$K3d$jEv$F$k%a%K%e!<%P!<8~$1$N9T$N8D?t!#(B
$B%G%U%)%k%H$O(B1$B$G$"$k!#(B
@pxref{Menu Bar}$B!#(B
$B!J(BX$B%D!<%k%-%C%H$r;H$&(BEmacs$B$G$O!"%a%K%e!<%P!<$O(B1$B9T$@$1$G$"$k!#(B
$B$3$N>l9g!"(B0$B$h$jBg$-$J?t$r;XDj$7$?$+$I$&$+$K0UL#$,$"$k!#!K(B
@ignore
@item parent-id
@c ??? Not yet working.
The X window number of the window that should be the parent of this one.
Specifying this lets you create an Emacs window inside some other
application's window. (It is not certain this will be implemented; try
it and see if it works.)
@end ignore
@end table
@node Size and Position
@c @subsection Frame Size And Position
@subsection $B%U%l!<%`$N%5%$%:$H0LCV(B
@c @cindex size of frame
@c @cindex screen size
@c @cindex frame size
@c @cindex resize frame
@cindex $B%U%l!<%`%5%$%:(B
@cindex $B%5%$%:!"%U%l!<%`(B
@cindex $B%9%/%j!<%s%5%$%:(B
@cindex $B%5%$%:!"%9%/%j!<%s(B
@cindex $B%U%l!<%`$N%j%5%$%:(B
@cindex $B%j%5%$%:!"%U%l!<%`(B
@c You can read or change the size and position of a frame using the
@c frame parameters @code{left}, @code{top}, @code{height}, and
@c @code{width}. Whatever geometry parameters you don't specify are chosen
@c by the window manager in its usual fashion.
$B%U%l!<%`%Q%i%a!<%?(B@code{left}$B!"(B@code{top}$B!"(B@code{height}$B!"(B@code{width}$B$r(B
$B;H$C$F!"%U%l!<%`$N%5%$%:$d0LCV$rFI$_<h$C$?$jJQ99$G$-$^$9!#(B
$B;XDj$7$J$+$C$?Bg$-$5$H0LCV$N%Q%i%a!<%?$O!"(B
$B%&%#%s%I%&%^%M!<%8%c$,DL>o$I$*$j$KA*$S$^$9!#(B
@c Here are some special features for working with sizes and positions:
$B0J2<$O%5%$%:$d0LCV$rA`:n$9$kFCJL$J5!G=$G$9!#(B
@defun set-frame-position frame left top
@c This function sets the position of the top left corner of @var{frame} to
@c @var{left} and @var{top}. These arguments are measured in pixels, and
@c normally count from the top left corner of the screen.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$N:8>e6y$N0LCV$r(B
@var{left}$B!J:8C<!K$H(B@var{top}$B!J>eC<!K$K$9$k!#(B
$B$3$l$i$N0z?t$O!"%9%/%j!<%s$N:8>e6y$+$i%T%/%;%kC10L$G?t$($k!#(B
@c Negative parameter values position the bottom edge of the window up from
@c the bottom edge of the screen, or the right window edge to the left of
@c the right edge of the screen. It would probably be better if the values
@c were always counted from the left and top, so that negative arguments
@c would position the frame partly off the top or left edge of the screen,
@c but it seems inadvisable to change that now.
$B%Q%i%a!<%?CM$,Ii$G$"$k$H!"%9%/%j!<%s$N2<C<$+$iB,$C$F%&%#%s%I%&$N2<C<$r(B
$B0LCV7h$a$7$?$j!"%9%/%j!<%s$N1&C<$+$iB,$C$F%&%#%s%I%&$N1&C<$r0LCV7h$a$9$k!#(B
$B$D$M$K:8C<$d>eC<$+$iB,$C$?CM$K$7$F!"Ii$NCM$O%U%l!<%`$r(B
$B%9%/%j!<%s$N>eC<$d:8C<$+$iItJ,E*$K$O$_=P$7$F0LCV7h$a$9$k(B
$B0UL#$K$9$k$[$&$,$h$$$+$b$7$l$J$$$,!"(B
$B8=>u$G$O$=$N$h$&$KJQ$($k$N$OITE,Ev$H;W$o$l$k!#(B
@end defun
@defun frame-height &optional frame
@defunx frame-width &optional frame
@c These functions return the height and width of @var{frame}, measured in
@c lines and columns. If you don't supply @var{frame}, they use the
@c selected frame.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$N9b$5$dI}$r9TC10L$d%3%i%`C10L$GJV$9!#(B
@var{frame}$B$r;XDj$7$J$$$H!"A*Br$5$l$F$$$k%U%l!<%`$r;H$&!#(B
@end defun
@defun screen-height
@defunx screen-width
@c These functions are old aliases for @code{frame-height} and
@c @code{frame-width}. When you are using a non-window terminal, the size
@c of the frame is normally the same as the size of the terminal screen.
$B$3$l$i$N4X?t$O(B@code{frame-height}$B$d(B@code{frame-width}$B$N8E$$JLL>$G$"$k!#(B
$BJ8;zC<Kv$r;H$C$F$$$k>l9g!"DL>o!"%U%l!<%`$NBg$-$5$O(B
$BC<Kv%9%/%j!<%s$NBg$-$5$HF1$8$G$"$k!#(B
@end defun
@defun frame-pixel-height &optional frame
@defunx frame-pixel-width &optional frame
@c These functions return the height and width of @var{frame}, measured in
@c pixels. If you don't supply @var{frame}, they use the selected frame.
$B$3$l$i$N4X?t$O!"%U%l!<%`(B@var{frame}$B$N9b$5$dI}$r%T%/%;%kC10L$GJV$9!#(B
@var{frame}$B$r;XDj$7$J$$$H!"A*Br$5$l$F$$$k%U%l!<%`$r;H$&!#(B
@end defun
@defun frame-char-height &optional frame
@defunx frame-char-width &optional frame
@c These functions return the height and width of a character in
@c @var{frame}, measured in pixels. The values depend on the choice of
@c font. If you don't supply @var{frame}, these functions use the selected
@c frame.
$B$3$l$i$N4X?t$O!"%U%l!<%`Fb$NJ8;z$N9b$5$dI}$r%T%/%;%kC10L$GJV$9!#(B
@var{frame}$B$r;XDj$7$J$$$H!"A*Br$5$l$F$$$k%U%l!<%`$r;H$&!#(B
@end defun
@defun set-frame-size frame cols rows
@c This function sets the size of @var{frame}, measured in characters;
@c @var{cols} and @var{rows} specify the new width and height.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$NBg$-$5$rJ8;zC10L$G;XDj$9$k!#(B
@var{cols}$B$H(B@var{rows}$B$O!"?7$?$JI}$H9b$5$r;XDj$9$k!#(B
@c To set the size based on values measured in pixels, use
@c @code{frame-char-height} and @code{frame-char-width} to convert
@c them to units of characters.
$B%T%/%;%kC10L$GBg$-$5$r;XDj$9$k$K$O!"(B
@code{frame-char-height}$B$H(B@code{frame-char-width}$B$G(B
$B%T%/%;%kC10L$NCM$rJ8;zC10L$KJQ49$9$k!#(B
@end defun
@defun set-frame-height frame lines &optional pretend
@c This function resizes @var{frame} to a height of @var{lines} lines. The
@c sizes of existing windows in @var{frame} are altered proportionally to
@c fit.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$N9b$5$r(B@var{lines}$B9T$KJQ$($k!#(B
$B$=$l$K9g$o$;$F(B@var{frame}$BFb$N4{B8$N%&%#%s%I%&$NBg$-$5$OHfNc$7$FJQ$o$k!#(B
@c If @var{pretend} is non-@code{nil}, then Emacs displays @var{lines}
@c lines of output in @var{frame}, but does not change its value for the
@c actual height of the frame. This is only useful for a terminal frame.
@c Using a smaller height than the terminal actually implements may be
@c useful to reproduce behavior observed on a smaller screen, or if the
@c terminal malfunctions when using its whole screen. Setting the frame
@c height ``for real'' does not always work, because knowing the correct
@c actual size may be necessary for correct cursor positioning on a
@c terminal frame.
@var{pretend}$B$,(B@code{nil}$B0J30$G$"$k$H!"(B
Emacs$B$O(B@var{frame}$B$N(B@var{lines}$B$@$1$rI=<($9$k$,!"(B
$B%U%l!<%`$N<B:]$N9b$5$OJQ99$7$J$$!#(B
$B$3$l$OC<Kv%U%l!<%`$G$N$_M-MQ$G$"$k!#(B
$B<B:]$NC<Kv$h$j>.$5$J9b$5$r;H$&$H!">.$5$J%9%/%j!<%s$G$NF0:n$r:F8=$7$?$j!"(B
$B%9%/%j!<%sA4BN$r;H$&$HC<Kv$,8mF0:n$9$k$h$&$J>l9g$KM-MQ$G$"$k!#(B
$B%U%l!<%`$N!X<B:]!Y$N9b$5$r;XDj$7$F$b$D$M$K$=$&$J$k$H$O8B$i$J$$!#(B
$BC<Kv%U%l!<%`>e$G@5$7$/%+!<%=%k$r0LCV7h$a$9$k$K$O!"(B
$B<B%5%$%:$rCN$kI,MW$,$"$k>l9g$b$"$k$+$i$G$"$k!#(B
@end defun
@defun set-frame-width frame width &optional pretend
@c This function sets the width of @var{frame}, measured in characters.
@c The argument @var{pretend} has the same meaning as in
@c @code{set-frame-height}.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$NI}$r@_Dj$9$k!#(B
$B0z?t(B@var{pretend}$B$O(B@code{set-frame-height}$B$HF1$80UL#$r;}$D!#(B
@end defun
@findex set-screen-height
@findex set-screen-width
@c The older functions @code{set-screen-height} and
@c @code{set-screen-width} were used to specify the height and width of the
@c screen, in Emacs versions that did not support multiple frames. They
@c are semi-obsolete, but still work; they apply to the selected frame.
@code{set-screen-height}$B$H(B@code{set-screen-width}$B$N8E$$4X?t$O!"(B
$BJ#?t%U%l!<%`$r07$($J$$(BEmacs$B$NHG$G%9%/%j!<%s$N9b$5$dI}$r(B
$B;XDj$9$k$?$a$K;H$o$l$F$$$^$7$?!#(B
$B$3$l$i$O$[$\GQ$l$F$$$^$9$,!"$^$@F0:n$7$^$9!#(B
$B$3$l$i$OA*Br$5$l$F$$$k%U%l!<%`$KE,MQ$5$l$^$9!#(B
@defun x-parse-geometry geom
@c @cindex geometry specification
@cindex $B%8%*%a%H%j;XDj(B
@c The function @code{x-parse-geometry} converts a standard X window
@c geometry string to an alist that you can use as part of the argument to
@c @code{make-frame}.
$B4X?t(B@code{x-parse-geometry}$B$O!"(BX$B%&%#%s%I%&$NI8=`$N%8%*%a%H%jJ8;zNs$r(B
@code{make-frame}$B$N0z?t$N0lIt$K;H$($k$h$&$KO"A[%j%9%H$KJQ49$9$k!#(B
@c The alist describes which parameters were specified in @var{geom}, and
@c gives the values specified for them. Each element looks like
@c @code{(@var{parameter} . @var{value})}. The possible @var{parameter}
@c values are @code{left}, @code{top}, @code{width}, and @code{height}.
$B$3$NO"A[%j%9%H$O!"(B@var{geom}$B$G;XDj$5$l$F$$$k%Q%i%a!<%?$H$=$NCM$r5-=R$9$k!#(B
$B3FMWAG$O(B@code{(@var{parameter} . @var{value})}$B$N7A$G$"$k!#(B
@var{parameter}$B$N2DG=$JCM$O!"(B
@code{left}$B!"(B@code{top}$B!"(B@code{width}$B!"(B@code{height}$B$G$"$k!#(B
@c For the size parameters, the value must be an integer. The position
@c parameter names @code{left} and @code{top} are not totally accurate,
@c because some values indicate the position of the right or bottom edges
@c instead. These are the @var{value} possibilities for the position
@c parameters:
$BBg$-$5$rI=$9%Q%i%a!<%?$G$O!"$=$NCM$O@0?t$G$"$k$3$H!#(B
$B0LCV$rI=$9%Q%i%a!<%?$G$O!"1&C<$d2<C<$N0LCV$rI=$9CM$b$"$k$N$G!"(B
@code{left}$B$d(B@code{top}$B$H$$$&%Q%i%a!<%?L>$OI,$:$7$b@53N$G$O$J$$!#(B
$B0LCV$rI=$9%Q%i%a!<%?$N2DG=$J(B@var{value}$B$O$D$.$N$H$*$j$G$"$k!#(B
@table @asis
@c @item an integer
@item $B@0?t(B
@c A positive integer relates the left edge or top edge of the window to
@c the left or top edge of the screen. A negative integer relates the
@c right or bottom edge of the window to the right or bottom edge of the
@c screen.
$B@5$N@0?t$O!"%&%#%s%I%&$N:8C<$d>eC<$r%9%/%j!<%s$N:8C<$d>eC<$K4XO"IU$1$k!#(B
$BIi$N@0?t$O!"%&%#%s%I%&$N1&C<$d2<C<$r%9%/%j!<%s$N1&C<$d2<C<$K4XO"IU$1$k!#(B
@item @code{(+ @var{position})}
@c This specifies the position of the left or top edge of the window
@c relative to the left or top edge of the screen. The integer
@c @var{position} may be positive or negative; a negative value specifies a
@c position outside the screen.
$B%9%/%j!<%s$N:8C<$d>eC<$r4p=`$K$7$?%&%#%s%I%&$N:8C<$d>eC<$N0LCV$r;XDj$9$k!#(B
$B@0?t(B@var{position}$B$O@5$G$bIi$G$b$h$$$,!"(B
$BIi$NCM$O%9%/%j!<%s$+$i$O$_=P$7$?0LCV$r;XDj$9$k!#(B
@item @code{(- @var{position})}
@c This specifies the position of the right or bottom edge of the window
@c relative to the right or bottom edge of the screen. The integer
@c @var{position} may be positive or negative; a negative value specifies a
@c position outside the screen.
$B%9%/%j!<%s$N1&C<$d2<C<$r4p=`$K$7$?%&%#%s%I%&$N1&C<$d2<C<$N0LCV$r;XDj$9$k!#(B
$B@0?t(B@var{position}$B$O@5$G$bIi$G$b$h$$$,!"(B
$BIi$NCM$O%9%/%j!<%s$+$i$O$_=P$7$?0LCV$r;XDj$9$k!#(B
@end table
@c Here is an example:
$BNc$r<($9!#(B
@example
(x-parse-geometry "35x70+0-0")
@result{} ((height . 70) (width . 35)
(top - 0) (left . 0))
@end example
@end defun
@node Frame Titles
@c @section Frame Titles
@section $B%U%l!<%`%?%$%H%k(B
@c Every frame has a @code{name} parameter; this serves as the default
@c for the frame title which window systems typically display at the top of
@c the frame. You can specify a name explicitly by setting the @code{name}
@c frame property.
$B3F%U%l!<%`$K$O%Q%i%a!<%?(B@code{name}$B$,$"$j$^$9!#(B
$B$3$l$O!"E57?E*$K$O%&%#%s%I%&%7%9%F%`$,%U%l!<%`$N@hF,$KI=<($9$k(B
$B%U%l!<%`%?%$%H%k$N%G%U%)%k%H$K$b$J$j$^$9!#(B
$B%U%l!<%`B0@-(B@code{name}$B$K@_Dj$9$k$3$H$GL@<(E*$KL>A0$r;XDj$G$-$^$9!#(B
@c Normally you don't specify the name explicitly, and Emacs computes the
@c frame name automatically based on a template stored in the variable
@c @code{frame-title-format}. Emacs recomputes the name each time the
@c frame is redisplayed.
$BDL>o$OL>A0$rL@<(E*$K;XDj$7$J$$$G$7$g$&$+$i!"(B
$BJQ?t(B@code{frame-title-format}$B$KJ];}$7$F$"$k?w7?$+$i(B
Emacs$B$,<+F0E*$K%U%l!<%`L>$r7W;;$7$^$9!#(B
Emacs$B$O!"%U%l!<%`$r:FI=<($9$k$?$S$KL>A0$r:F7W;;$7$^$9!#(B
@defvar frame-title-format
@c This variable specifies how to compute a name for a frame when you have
@c not explicitly specified one. The variable's value is actually a mode
@c line construct, just like @code{mode-line-format}. @xref{Mode Line
@c Data}.
$B$3$NJQ?t$O!"FI<T$,%U%l!<%`L>$rL@<(E*$K;XDj$7$J$+$C$?$H$-$N(B
$B%U%l!<%`8~$1$NL>A0$N7W;;J}K!$r;XDj$9$k!#(B
$BJQ?t$NCM$O<B:]$K$O!"(B@code{mode-line-format}$B$N$h$&$J%b!<%I9T9=@.$G$"$k!#(B
@pxref{Mode Line Data}$B!#(B
@end defvar
@defvar icon-title-format
@c This variable specifies how to compute the name for an iconified frame,
@c when you have not explicitly specified the frame title. This title
@c appears in the icon itself.
$B$3$NJQ?t$O!"%U%l!<%`%?%$%H%k$rL@<(E*$K;XDj$7$J$+$C$?$H$-$N(B
$B%"%$%3%s$K$7$?%U%l!<%`8~$1$NL>A0$N7W;;J}K!$r;XDj$9$k!#(B
$B$3$l$O%"%$%3%s$=$N$b$N$K8=$l$k!#(B
@end defvar
@defvar multiple-frames
@c This variable is set automatically by Emacs. Its value is @code{t} when
@c there are two or more frames (not counting minibuffer-only frames or
@c invisible frames). The default value of @code{frame-title-format} uses
@c @code{multiple-frames} so as to put the buffer name in the frame title
@c only when there is more than one frame.
$B$3$NJQ?t$O(BEmacs$B$,<+F0E*$K@_Dj$9$k!#(B
$B!J%_%K%P%C%U%!@lMQ$N%U%l!<%`$dIT2D;k%U%l!<%`$r?t$($:$K!K(B
$BJ#?t8D$N%U%l!<%`$,$"$k$H$3$NCM$,(B@code{t}$B$G$"$k!#(B
@code{frame-title-format}$B$N%G%U%)%k%HCM$G$O(B@code{multiple-frames}$B$r;H$C$F$*$j!"(B
$BJ#?t$N%U%l!<%`$,$"$k$H$-$K8B$j%U%l!<%`%?%$%H%k$K%P%C%U%!L>$,F~$k$h$&$K$9$k!#(B
@end defvar
@node Deleting Frames
@c @section Deleting Frames
@section $B%U%l!<%`$N:o=|(B
@c @cindex deletion of frames
@cindex $B%U%l!<%`$N:o=|(B
@cindex $B:o=|!"%U%l!<%`(B
@c Frames remain potentially visible until you explicitly @dfn{delete}
@c them. A deleted frame cannot appear on the screen, but continues to
@c exist as a Lisp object until there are no references to it. There is no
@c way to cancel the deletion of a frame aside from restoring a saved frame
@c configuration (@pxref{Frame Configurations}); this is similar to the
@c way windows behave.
$B%U%l!<%`$rL@<(E*$K(B@dfn{$B:o=|(B}$B!J(Bdelete$B!K$7$J$$8B$j!"(B
$B%U%l!<%`$O8+$($k2DG=@-$,$"$j$^$9!#(B
$B%U%l!<%`$r:o=|$9$k$H%9%/%j!<%s$KI=<($G$-$J$/$J$j$^$9$,!"(B
$B$=$l$r;2>H$9$k$b$N$,$J$/$J$i$J$$8B$j(BLisp$B%*%V%8%'%/%H$H$7$F$OB8:_$7B3$1$^$9!#(B
$BJ]B8$7$?%U%l!<%`9=@.!J(B@pxref{Frame Configurations}$B!K$rI|85$9$k0J30$K$O!"(B
$B%U%l!<%`$N:o=|$r<h$j>C$9$3$H$O$G$-$^$;$s!#(B
$B$3$l$O%&%#%s%I%&$HF1MM$G$9!#(B
@c @deffn Command delete-frame &optional frame
@deffn $B%3%^%s%I(B delete-frame &optional frame
@c This function deletes the frame @var{frame}. By default, @var{frame} is
@c the selected frame.
$B$3$N4X?t$O%U%l!<%`(B@var{frame}$B$r:o=|$9$k!#(B
$B%G%U%)%k%H$G$O!"(B@var{frame}$B$OA*Br$5$l$F$$$k%U%l!<%`$G$"$k!#(B
@end deffn
@defun frame-live-p frame
@c The function @code{frame-live-p} returns non-@code{nil} if the frame
@c @var{frame} has not been deleted.
$B4X?t(B@code{frame-live-p}$B$O!"%U%l!<%`(B@var{frame}$B$,:o=|$5$l$F$$$J$1$l$P(B
@code{nil}$B0J30$rJV$9!#(B
@end defun
@c Some window managers provide a command to delete a window. These work
@c by sending a special message to the program that operates the window.
@c When Emacs gets one of these commands, it generates a
@c @code{delete-frame} event, whose normal definition is a command that
@c calls the function @code{delete-frame}. @xref{Misc Events}.
$B%&%#%s%I%&$r:o=|$9$k%3%^%s%I$rM?$($k%&%#%s%I%&%^%M!<%8%c$b$"$j$^$9!#(B
$B$=$l$i$O!"%&%#%s%I%&$rA`:n$7$F$$$k%W%m%0%i%`$KFCJL$J%a%C%;!<%8$r(B
$BAw$k$3$H$GF0:n$7$^$9!#(B
Emacs$B$,$=$N$h$&$J%3%^%s%I$r<u$1<h$k$H!"(B
$B%$%Y%s%H(B@code{delete-frame}$B$r@8@.$7$^$9!#(B
$B$3$N%$%Y%s%H$NIaDL$NDj5A$O!"4X?t(B@code{delete-frame}$B$r8F$S=P$9%3%^%s%I$G$9!#(B
@xref{Misc Events}$B!#(B
@node Finding All Frames
@c @section Finding All Frames
@section $B$9$Y$F$N%U%l!<%`$rC5$9(B
@defun frame-list
@c The function @code{frame-list} returns a list of all the frames that
@c have not been deleted. It is analogous to @code{buffer-list} for
@c buffers. The list that you get is newly created, so modifying the list
@c doesn't have any effect on the internals of Emacs.
$B4X?t(B@code{frame-list}$B$O!":o=|$5$l$F$$$J$$$9$Y$F$N%U%l!<%`$+$i@.$k%j%9%H$rJV$9!#(B
$B$3$l$O!"%P%C%U%!$KBP$9$k(B@code{buffer-list}$B$KAjEv$9$k!#(B
$BF@$i$l$k%j%9%H$O?7$?$K:n@.$7$?$b$N$G$"$j!"(B
$B$3$N%j%9%H$rJQ99$7$F$b(BEmacs$BFbIt$K$O$J$s$N8z2L$b$J$$!#(B
@end defun
@defun visible-frame-list
@c This function returns a list of just the currently visible frames.
@c @xref{Visibility of Frames}. (Terminal frames always count as
@c ``visible'', even though only the selected one is actually displayed.)
$B$3$N4X?t$O!"8=:_2D;k$N%U%l!<%`$@$1$N%j%9%H$rJV$9!#(B
@pxref{Visibility of Frames}$B!#(B
$B!JA*Br$5$l$F$$$k%U%l!<%`$@$1$,<B:]$KI=<($5$l$F$$$k>l9g$G$b!"(B
$BC<Kv%U%l!<%`$O$9$Y$F$D$M$K!X2D;k!Y$H$_$J$9!#!K(B
@end defun
@defun next-frame &optional frame minibuf
@c The function @code{next-frame} lets you cycle conveniently through all
@c the frames from an arbitrary starting point. It returns the ``next''
@c frame after @var{frame} in the cycle. If @var{frame} is omitted or
@c @code{nil}, it defaults to the selected frame.
$B4X?t(B@code{next-frame}$B$K$h$j!"(B
$BG$0U$N0LCV$+$i;O$a$F$9$Y$F$N%U%l!<%`$rJXMx$K=d2s$G$-$k!#(B
$B=d2s=g$NCf$G(B@var{frame}$B$N!X$D$.!Y$N%U%l!<%`$rJV$9!#(B
@var{frame}$B$r>JN,$7$?$j(B@code{nil}$B$G$"$k$H!"(B
$B%G%U%)%k%H$G$OA*Br$5$l$F$$$k%U%l!<%`$r;H$&!#(B
@c The second argument, @var{minibuf}, says which frames to consider:
$BBh(B2$B0z?t(B@var{minibuf}$B$O!"BP>]$H$9$k%U%l!<%`$r;XDj$9$k!#(B
@table @asis
@item @code{nil}
@c Exclude minibuffer-only frames.
$B%_%K%P%C%U%!@lMQ$N%U%l!<%`$r=|30$9$k!#(B
@item @code{visible}
@c Consider all visible frames.
$B$9$Y$F$N2D;k$J%U%l!<%`$rBP>]$K$9$k!#(B
@item 0
@c Consider all visible or iconified frames.
$B$9$Y$F$N2D;k$J%U%l!<%`$d%"%$%3%s$K$7$?%U%l!<%`$rBP>]$K$9$k!#(B
@c @item a window
@item $B%&%#%s%I%&(B
@c Consider only the frames using that particular window as their
@c minibuffer.
$B%_%K%P%C%U%!$H$7$FFCDj$N%&%#%s%I%&$r;H$C$F$$$k%U%l!<%`$N$_$rBP>]$K$9$k!#(B
@c @item anything else
@item $B$=$NB>(B
@c Consider all frames.
$B$9$Y$F$N%U%l!<%`$rBP>]$K$9$k!#(B
@end table
@end defun
@defun previous-frame &optional frame minibuf
@c Like @code{next-frame}, but cycles through all frames in the opposite
@c direction.
@code{next-frame}$B$HF1MM$G$"$k$,!"$9$Y$F$N%U%l!<%`$r5UJ}8~$K=d2s$9$k!#(B
@end defun
@c See also @code{next-window} and @code{previous-window}, in @ref{Cyclic
@c Window Ordering}.
@ref{Cyclic Window Ordering}$B$N(B@code{next-window}$B$H(B@code{previous-window}$B$b(B
$B;2>H$7$F$/$@$5$$!#(B
@node Frames and Windows
@c @section Frames and Windows
@section $B%U%l!<%`$H%&%#%s%I%&(B
@c Each window is part of one and only one frame; you can get the frame
@c with @code{window-frame}.
$B3F%&%#%s%I%&$O$"$k(B1$B$D$N%U%l!<%`$@$1$N0lIt$G$"$j!"(B
@code{window-frame}$B$GEv3:%U%l!<%`$rF@$i$l$^$9!#(B
@defun window-frame window
@c This function returns the frame that @var{window} is on.
$B$3$N4X?t$O!"(B@var{window}$B$,B0$9$k%U%l!<%`$rJV$9!#(B
@end defun
@c All the non-minibuffer windows in a frame are arranged in a cyclic
@c order. The order runs from the frame's top window, which is at the
@c upper left corner, down and to the right, until it reaches the window at
@c the lower right corner (always the minibuffer window, if the frame has
@c one), and then it moves back to the top. @xref{Cyclic Window Ordering}.
$B%U%l!<%`Fb$N%_%K%P%C%U%!MQ0J30$N$9$Y$F%&%#%s%I%&$K$O!"(B
$B=d2s=g=x$,$D$$$F$$$^$9!#(B
$B$=$N=g=x$O!"%U%l!<%`$N:8>e6y$N@hF,$N%&%#%s%I%&$+$i;O$^$C$F!"(B
$B1&2<6y$N%&%#%s%I%&!J%U%l!<%`$K%_%K%P%C%U%!$,$"$l$P!"(B
$B$3$l$O$D$M$K%_%K%P%C%U%!MQ%&%#%s%I%&!K$KC#$9$k$^$G2<8~$-1&8~$-$K?J$_!"(B
$B$=$7$F@hF,$XLa$j$^$9!#(B
@defun frame-top-window frame
@c This returns the topmost, leftmost window of frame @var{frame}.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$N$b$C$H$b>eC<$N$b$C$H$b:8C<$N(B
$B@hF,$N%&%#%s%I%&$rJV$9!#(B
@end defun
@c At any time, exactly one window on any frame is @dfn{selected within the
@c frame}. The significance of this designation is that selecting the
@c frame also selects this window. You can get the frame's current
@c selected window with @code{frame-selected-window}.
$B$"$k;~E@$G$O!"3F%U%l!<%`$G$O$?$C$?(B1$B$D$N%U%l!<%`$,(B
@dfn{$BEv3:%U%l!<%`$GA*Br$5$l$F$$$k(B}$B$N$G$9!#(B
$B$3$N$h$&$J6hJL$N0UL#$O!"(B
$B%U%l!<%`$rA*Br$9$k$H$=$N$h$&$J%&%#%s%I%&$bA*Br$5$l$k$H$$$&$3$H$G$9!#(B
$B%U%l!<%`$G8=:_A*Br$5$l$F$$$k%U%l!<%`$O(B
@code{frame-selected-window}$B$GF@$i$l$^$9!#(B
@defun frame-selected-window frame
@c This function returns the window on @var{frame} that is selected within
@c @var{frame}.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$GA*Br$5$l$F$$$k(B
@var{frame}$BFb$N%&%#%s%I%&$rJV$9!#(B
@end defun
@c Conversely, selecting a window for Emacs with @code{select-window} also
@c makes that window selected within its frame. @xref{Selecting Windows}.
$B5U$K!"(B@code{select-window}$B$G(BEmacs$B$N%&%#%s%I%&$rA*$V$H!"(B
$B$=$l$,$=$N%U%l!<%`$GA*Br$5$l$F$$$k%&%#%s%I%&$K$J$j$^$9!#(B
@pxref{Selecting Windows}$B!#(B
@c Another function that (usually) returns one of the windows in a given
@c frame is @code{minibuffer-window}. @xref{Minibuffer Misc}.
$B;XDj$7$?%U%l!<%`$N%&%#%s%I%&$N(B1$B$D$rJV$9JL$N4X?t$O(B
@code{minibuffer-window}$B$G$9!#(B
@xref{Minibuffer Misc}$B!#(B
@node Minibuffers and Frames
@c @section Minibuffers and Frames
@section $B%_%K%P%C%U%!$H%U%l!<%`(B
@c Normally, each frame has its own minibuffer window at the bottom, which
@c is used whenever that frame is selected. If the frame has a minibuffer,
@c you can get it with @code{minibuffer-window} (@pxref{Minibuffer Misc}).
$BDL>o!"3F%U%l!<%`$K$O$=$lFH<+$N%_%K%P%C%U%!MQ%&%#%s%I%&$,Dl$K$"$j!"(B
$B%U%l!<%`$,A*Br$5$l$F$$$k$H$-$K$O$$$D$b$=$l$,;H$o$l$^$9!#(B
$B%U%l!<%`$K%_%K%P%C%U%!$,$"$l$P!"(B@code{minibuffer-window}
$B!J(B@pxref{Minibuffer Misc}$B!K$G$=$l$rF@$i$l$^$9!#(B
@c However, you can also create a frame with no minibuffer. Such a frame
@c must use the minibuffer window of some other frame. When you create the
@c frame, you can specify explicitly the minibuffer window to use (in some
@c other frame). If you don't, then the minibuffer is found in the frame
@c which is the value of the variable @code{default-minibuffer-frame}. Its
@c value should be a frame that does have a minibuffer.
$B$7$+$7!"%_%K%P%C%U%!$N$J$$%U%l!<%`$r:n$k$3$H$b$G$-$^$9!#(B
$B$=$N$h$&$J%U%l!<%`$G$O!"JL$N%U%l!<%`$N%_%K%P%C%U%!MQ%&%#%s%I%&$r(B
$B;H$&I,MW$,$"$j$^$9!#(B
$B$=$N$h$&$J%U%l!<%`$r:n@.$9$k$H$-$K$O!"(B
$B;HMQ$9$k!JB>$N%U%l!<%`$N!K%_%K%P%C%U%!$rL@<(E*$K;XDj$G$-$^$9!#(B
$B$=$&$7$J$$$H!"JQ?t(B@code{default-minibuffer-frame}$B$NCM$G;XDj$5$l$k(B
$B%U%l!<%`$N%_%K%P%C%U%!$r;H$$$^$9!#(B
$B$=$NCM$O!"%_%K%P%C%U%!$rM-$7$?%U%l!<%`$G$"$kI,MW$,$"$j$^$9!#(B
@c If you use a minibuffer-only frame, you might want that frame to raise
@c when you enter the minibuffer. If so, set the variable
@c @code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}.
$B%_%K%P%C%U%!@lMQ$N%U%l!<%`$r;H$&$H$-$O!"(B
$B%_%K%P%C%U%!$GF~NO$9$k$H$-$K$=$N%U%l!<%`$,(B
$B<+F0E*$K<jA0$K$/$k$h$&$K$7$?$$$G$7$g$&!#(B
$B$=$&$7$?$$>l9g$K$O!"JQ?t(B@code{minibuffer-auto-raise}$B$K(B@code{t}$B$K@_Dj$7$^$9!#(B
@xref{Raising and Lowering}$B!#(B
@defvar default-minibuffer-frame
@c This variable specifies the frame to use for the minibuffer window, by
@c default. It is always local to the current terminal and cannot be
@c buffer-local. @xref{Multiple Displays}.
$B$3$NJQ?t$O!"%G%U%)%k%H$G;H$&%_%K%P%C%U%!MQ%&%#%s%I%&$N%U%l!<%`$r;XDj$9$k!#(B
$B$3$NJQ?t$O8=:_$NC<Kv$K$D$M$K%m!<%+%k$G$"$j!"(B
$B%P%C%U%!%m!<%+%k$K$O$J$j$($J$$!#(B
@pxref{Multiple Displays}$B!#(B
@end defvar
@node Input Focus
@c @section Input Focus
@section $BF~NO%U%)!<%+%9(B
@c @cindex input focus
@c @cindex selected frame
@cindex $BF~NO%U%)!<%+%9(B
@cindex $BA*Br$5$l$F$$$k%U%l!<%`(B
@c At any time, one frame in Emacs is the @dfn{selected frame}. The selected
@c window always resides on the selected frame.
$B$"$k;~E@$G$O!"(BEmacs$B$N(B1$B$D$N%U%l!<%`$,(B@dfn{$BA*Br$5$l$F$$$k%U%l!<%`(B}
$B!J(Bselected frame$B!K$G$9!#(B
$BA*Br$5$l$F$$$k%&%#%s%I%&$OA*Br$5$l$F$$$k%U%l!<%`$NCf$K$D$M$K$"$j$^$9!#(B
@defun selected-frame
@c This function returns the selected frame.
$B$3$N4X?t$OA*Br$5$l$F$$$k%U%l!<%`$rJV$9!#(B
@end defun
@c Some window systems and window managers direct keyboard input to the
@c window object that the mouse is in; others require explicit clicks or
@c commands to @dfn{shift the focus} to various window objects. Either
@c way, Emacs automatically keeps track of which frame has the focus.
$B%^%&%9$,F~$C$F$$$k%&%#%s%I%&$K%-!<%\!<%IF~NO$r?6$j8~$1$k(B
$B%&%#%s%I%&%7%9%F%`$d%&%#%s%I%&%^%M!<%8%c$,$"$j$^$9!#(B
$B%&%#%s%I%&$K(B@dfn{$B%U%)!<%+%9$rCV$/$?$a$K(B}$B!"(B
$BL@<(E*$K%/%j%C%/$7$?$j%3%^%s%I$rI,MW$H$9$k$b$N$b$"$j$^$9!#(B
$B$$$:$l$G$"$C$F$b!"(BEmacs$B$O$I$N%U%l!<%`$K%U%)!<%+%9$,$"$k$+$r(B
$B<+F0E*$KDI@W$7$^$9!#(B
@c Lisp programs can also switch frames ``temporarily'' by calling the
@c function @code{select-frame}. This does not alter the window system's
@c concept of focus; rather, it escapes from the window manager's control
@c until that control is somehow reasserted.
Lisp$B%W%m%0%i%`$+$i$O!"4X?t(B@code{select-frame}$B$r8F$V$3$H$G!"(B
$B!X0l;~E*$K!Y%U%l!<%`$r@Z$jBX$($k$3$H$b$G$-$^$9!#(B
$B$3$l$O!"%&%#%s%I%&%7%9%F%`$N%U%)!<%+%9$OJQ$($^$;$s!#(B
$B$H$$$&$h$j$O!"%W%m%0%i%`$G;XDj$9$k$^$G(B
$B%&%#%s%I%&%7%9%F%`$N@)8f$r2sHr$7$^$9!#(B
@c When using a text-only terminal, only the selected terminal frame is
@c actually displayed on the terminal. @code{switch-frame} is the only way
@c to switch frames, and the change lasts until overridden by a subsequent
@c call to @code{switch-frame}. Each terminal screen except for the
@c initial one has a number, and the number of the selected frame appears
@c in the mode line before the buffer name (@pxref{Mode Line Variables}).
$BJ8;zC<Kv$r;H$C$F$$$k$H$-$K$O!"(B
$BA*Br$5$l$F$$$k%U%l!<%`$N$_$,C<Kv$K<B:]$KI=<($5$l$^$9!#(B
$B%U%l!<%`$r@Z$jBX$($kM#0l$NJ}K!$O(B@code{switch-frame}$B$G$"$j!"(B
$B$=$l0J9_$K(B@code{switch-frame}$B$r8F$S=P$9$^$G@Z$jBX$($?8z2L$O;}B3$7$^$9!#(B
$B=i4|%U%l!<%`0J30$N3FC<Kv%U%l!<%`$K$OHV9f$,IU$$$F$$$F!"(B
$BA*Br$5$l$F$$$k%U%l!<%`$NHV9f$,%b!<%I9TFb$N%P%C%U%!L>$N$^$($K8=$l$^$9(B
$B!J(B@pxref{Mode Line Variables}$B!K!#(B
@c ??? This is not yet implemented properly.
@defun select-frame frame
@c This function selects frame @var{frame}, temporarily disregarding the
@c focus of the X server if any. The selection of @var{frame} lasts until
@c the next time the user does something to select a different frame, or
@c until the next time this function is called.
$B$3$N4X?t$O%U%l!<%`(B@var{frame}$B$rA*Br$7!"(B
X$B%5!<%P!<$N%U%)!<%+%9$r0l;~E*$KL5;k$9$k!#(B
@var{frame}$B$rA*Br$7$F$$$k>uBV$O!"(B
$B%f!<%6!<$,JL$N%U%l!<%`$rA*Br$9$kF0:n$r9T$&$+(B
$B:FEY$3$N4X?t$,8F$P$l$k$^$G;}B3$9$k!#(B
@end defun
@c Emacs cooperates with the window system by arranging to select frames as
@c the server and window manager request. It does so by generating a
@c special kind of input event, called a @dfn{focus} event, when
@c appropriate. The command loop handles a focus event by calling
@c @code{handle-switch-frame}. @xref{Focus Events}.
$B%5!<%P!<$d%&%#%s%I%&%^%M%8%c!<$NMW@A$K$7$?$,$C$F(B
$B%U%l!<%`$rA*Br$9$k$h$&$K$7$F!"(B
Emacs$B$O%&%#%s%I%&%7%9%F%`$H6(D4$7$^$9!#(B
$BI,MW$J$H$-$K$O(B@dfn{focus}$B%$%Y%s%H$H8F$P$l$kFCJL$JF~NO%$%Y%s%H$r(B
$B@8@.$9$k$3$H$G$3$N$h$&$K$7$^$9!#(B
$B%3%^%s%I%k!<%W$O(B@code{handle-switch-frame}$B$r8F$S=P$9$3$H$G(B
$B%$%Y%s%H(B@dfn{focus}$B$r=hM}$7$^$9!#(B
@xref{Focus Events}$B!#(B
@c @deffn Command handle-switch-frame frame
@deffn $B%3%^%s%I(B handle-switch-frame frame
@c This function handles a focus event by selecting frame @var{frame}.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$rA*Br$9$k$3$H$G%U%)!<%+%9%$%Y%s%H$r(B
$B=hM}$9$k!#(B
@c Focus events normally do their job by invoking this command.
@c Don't call it for any other reason.
$B%U%)!<%+%9%$%Y%s%H$O!"DL>o!"$3$N%3%^%s%I$r5/F0$9$k$3$H$G=hM}$5$l$k!#(B
$B$=$l0J30$NM}M3$G$O$3$l$r8F$S=P$5$J$$$3$H!#(B
@end deffn
@defun redirect-frame-focus frame focus-frame
@c This function redirects focus from @var{frame} to @var{focus-frame}.
@c This means that @var{focus-frame} will receive subsequent keystrokes and
@c events intended for @var{frame}. After such an event, the value of
@c @code{last-event-frame} will be @var{focus-frame}. Also, switch-frame
@c events specifying @var{frame} will instead select @var{focus-frame}.
$B$3$N4X?t$O!"%U%)!<%+%9$r(B@var{frame}$B$+$i(B@var{focus-frame}$B$X?6$j8~$1$k!#(B
$B$D$^$j!"0J9_$NBG80$d%$%Y%s%H$O!"(B@var{focus}$B$G$O$J$/!"(B
@var{focus-frame}$B$,<u$1<h$k$3$H$K$J$k!#(B
$B$=$N$h$&$J%$%Y%s%H$N$"$H$G$O!"(B
@code{last-event-frame}$B$NCM$O(B@var{focus-frame}$B$K$J$k!#(B
$B$^$?!"(B@var{focus}$B$r;XDj$7$?%$%Y%s%H(B@code{switch-frame}$B$O!"(B
@var{focus-frame}$B$rA*$V$3$H$K$J$k!#(B
@c If @var{focus-frame} is @code{nil}, that cancels any existing
@c redirection for @var{frame}, which therefore once again receives its own
@c events.
@var{focus-frame}$B$,(B@code{nil}$B$G$"$k$H!"(B@var{frame}$B$G$N?6$j8~$1$r<h$j>C$9!#(B
$B$D$^$j!"(B@var{frame}$B$O%$%Y%s%H$r$U$?$?$S<u$1$k$h$&$K$J$k!#(B
@c One use of focus redirection is for frames that don't have minibuffers.
@c These frames use minibuffers on other frames. Activating a minibuffer
@c on another frame redirects focus to that frame. This puts the focus on
@c the minibuffer's frame, where it belongs, even though the mouse remains
@c in the frame that activated the minibuffer.
$B%U%)!<%+%9$N?6$j8~$1$NMQES$N(B1$B$D$O!"(B
$B%_%K%P%C%U%!$r;}$?$J$$%U%l!<%`$N$?$a$G$"$k!#(B
$B$3$l$i$N%U%l!<%`$G$O!"JL$N%U%l!<%`$N%_%K%P%C%U%!$r;H$&!#(B
$BJL$N%U%l!<%`$N%_%K%P%C%U%!$r3h@-$K$9$k$H!"(B
$B%U%)!<%+%9$rEv3:%U%l!<%`$X?6$j8~$1$k!#(B
$B$3$l$K$h$j!"%_%K%P%C%U%!$r3h@-$K$7$?%U%l!<%`$K%^%&%9$,F~$C$F$$$F$b!"(B
$B%_%K%P%C%U%!$N%U%l!<%`$K%U%)!<%+%9$rCV$1$k!#(B
@c Selecting a frame can also change focus redirections. Selecting frame
@c @code{bar}, when @code{foo} had been selected, changes any redirections
@c pointing to @code{foo} so that they point to @code{bar} instead. This
@c allows focus redirection to work properly when the user switches from
@c one frame to another using @code{select-window}.
$B%U%l!<%`$rA*Br$7$F$b%U%)!<%+%9$N?6$j8~$1$rJQ99$9$k!#(B
$B%U%l!<%`(B@code{foo}$B$rA*Br$7$F$$$k$H$-$K%U%l!<%`(B@code{bar}$B$rA*Br$9$k$H!"(B
@code{foo}$B$X$N?6$j8~$1$r(B@code{bar}$B$X?6$j8~$1$k$h$&$KJQ99$9$k!#(B
$B$3$l$K$h$j!"(B@code{select-window}$B$r;H$C$F%f!<%6!<$,(B
$BJL$N%U%l!<%`$X@Z$jBX$($F$b!"%U%)!<%+%9$N?6$j8~$1$,@5$7$/F0:n$9$k!#(B
@c This means that a frame whose focus is redirected to itself is treated
@c differently from a frame whose focus is not redirected.
@c @code{select-frame} affects the former but not the latter.
$B$3$l$O!"%U%)!<%+%9$r<+J,<+?H$X?6$j8~$1$F$$$k%U%l!<%`$O!"(B
$B%U%)!<%+%9$r?6$j8~$1$F$$$J$$%U%l!<%`$H$O0[$J$k07$$$r<u$1$k$3$H$r0UL#$9$k!#(B
@code{select-frame}$B$OA0<T$K1F6A$9$k$,8e<T$K$O1F6A$7$J$$!#(B
@c The redirection lasts until @code{redirect-frame-focus} is called to
@c change it.
@code{redirect-frame-focus}$B$GJQ99$9$k$^$G!"?6$j8~$1$O;}B3$9$k!#(B
@end defun
@defopt focus-follows-mouse
@tindex focus-follows-mouse
@c This option is how you inform Emacs whether the window manager transfers
@c focus when the user moves the mouse. Non-@code{nil} says that it does.
@c When this is so, the command @code{other-frame} moves the mouse to a
@c position consistent with the new selected frame.
$B$3$N%*%W%7%g%s$O!"%f!<%6!<$,%^%&%9$rF0$+$7$?$H$-$K(B
$B%&%#%s%I%&%^%M!<%8%c$,%U%)!<%+%9$r0\F0$9$k$+$I$&$+$r(BEmacs$B$KEA$($k!#(B
@code{nil}$B0J30$G$"$k$H%U%)!<%+%9$,0\F0$9$k$3$H$r0UL#$9$k!#(B
$B$=$N>l9g!"%3%^%s%I(B@code{other-frame}$B$O!"(B
$B?7$?$KA*Br$5$l$?%U%l!<%`$KE,9g$9$k$h$&$J0LCV$K%^%&%9$r0\F0$9$k!#(B
@end defopt
@node Visibility of Frames
@c @section Visibility of Frames
@section $B%U%l!<%`$N2D;k@-(B
@c @cindex visible frame
@c @cindex invisible frame
@c @cindex iconified frame
@c @cindex frame visibility
@cindex $B2D;k$J%U%l!<%`(B
@cindex $BIT2D;k$J%U%l!<%`(B
@cindex $B%"%$%3%s$K$7$?%U%l!<%`(B
@cindex $B%U%l!<%`$N2D;k@-(B
@c A window frame may be @dfn{visible}, @dfn{invisible}, or
@c @dfn{iconified}. If it is visible, you can see its contents. If it is
@c iconified, the frame's contents do not appear on the screen, but an icon
@c does. If the frame is invisible, it doesn't show on the screen, not
@c even as an icon.
$B%&%#%s%I%&%U%l!<%`$O!"(B@dfn{$B2D;k(B}$B!"(B
@dfn{$BIT2D;k(B}$B!"(B@dfn{$B%"%$%3%s$K$J$C$F$$$k(B}$B$N$$$:$l$+$G$9!#(B
$B%U%l!<%`$,2D;k$G$"$k$H!"$=$NFbMF$r8+$k$3$H$,$G$-$^$9!#(B
$B%"%$%3%s$K$J$C$F$$$k$H%U%l!<%`$NFbMF$O%9%/%j!<%s$G8+$($^$;$s$,!"(B
$B%"%$%3%s$O8+$($^$9!#(B
$B%U%l!<%`$,IT2D;k$G$"$k$H!"$=$l$O%9%/%j!<%s>e$K8+$($:(B
$B%"%$%3%s$G$b$"$j$^$;$s!#(B
@c Visibility is meaningless for terminal frames, since only the selected
@c one is actually displayed in any case.
$BC<Kv%U%l!<%`$OA*Br$5$l$F$$$k$b$N$@$1$,I=<($5$l$k$N$G!"(B
$BC<Kv%U%l!<%`$G$O2D;k@-$O0UL#$,$"$j$^$;$s!#(B
@c @deffn Command make-frame-visible &optional frame
@deffn $B%3%^%s%I(B make-frame-visible &optional frame
@c This function makes frame @var{frame} visible. If you omit @var{frame},
@c it makes the selected frame visible.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$r2D;k$K$9$k!#(B
@var{frame}$B$r>JN,$9$k$H!"A*Br$5$l$F$$$k%U%l!<%`$r2D;k$K$9$k!#(B
@end deffn
@c @deffn Command make-frame-invisible &optional frame
@deffn $B%3%^%s%I(B make-frame-invisible &optional frame
@c This function makes frame @var{frame} invisible. If you omit
@c @var{frame}, it makes the selected frame invisible.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$rIT2D;k$K$9$k!#(B
@var{frame}$B$r>JN,$9$k$H!"A*Br$5$l$F$$$k%U%l!<%`$rIT2D;k$K$9$k!#(B
@end deffn
@c @deffn Command iconify-frame &optional frame
@deffn $B%3%^%s%I(B iconify-frame &optional frame
@c This function iconifies frame @var{frame}. If you omit @var{frame}, it
@c iconifies the selected frame.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$r%"%$%3%s$K$9$k!#(B
@var{frame}$B$r>JN,$9$k$H!"A*Br$5$l$F$$$k%U%l!<%`$r%"%$%3%s$K$9$k!#(B
@end deffn
@defun frame-visible-p frame
@c This returns the visibility status of frame @var{frame}. The value is
@c @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and
@c @code{icon} if it is iconified.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$N2D;k@-$rJV$9!#(B
$B$=$NCM$O!"(B@var{frame}$B$,2D;k$J$i$P(B@code{t}$B!"(B
$BIT2D;k$J$i$P(B@code{nil}$B!"%"%$%3%s$K$J$C$F$$$l$P(B@code{icon}$B$G$"$k!#(B
@end defun
@c The visibility status of a frame is also available as a frame
@c parameter. You can read or change it as such. @xref{Window Frame
@c Parameters}.
$B%U%l!<%`$N2D;k@-$O!"%U%l!<%`%Q%i%a!<%?$H$7$F$bF@$i$l$^$9!#(B
$B%U%l!<%`%Q%i%a!<%?$H$7$FFI$s$@$jJQ99$G$-$^$9!#(B
@xref{Window Frame Parameters}$B!#(B
@c The user can iconify and deiconify frames with the window manager.
@c This happens below the level at which Emacs can exert any control, but
@c Emacs does provide events that you can use to keep track of such
@c changes. @xref{Misc Events}.
$B%f!<%6!<$O!"%&%#%s%I%&%^%M!<%8%c$rMQ$$$F(B
$B%U%l!<%`$r%"%$%3%s$K$7$?$j%"%$%3%s$r3+$1$^$9!#(B
$B$3$l$O!"(BEmacs$B$,@)8f$G$-$k%l%Y%k$h$j$7$?$G9T$o$l$^$9$,!"(B
Emacs$B$O$=$N$h$&$JJQ99$rDI@W$G$-$k$h$&$K%$%Y%s%H$rDs6!$7$^$9!#(B
@xref{Misc Events}$B!#(B
@node Raising and Lowering
@c @section Raising and Lowering Frames
@section $B%U%l!<%`$r<jA0$K$7$?$j1|$XCV$/(B
@c Most window systems use a desktop metaphor. Part of this metaphor is
@c the idea that windows are stacked in a notional third dimension
@c perpendicular to the screen surface, and thus ordered from ``highest''
@c to ``lowest''. Where two windows overlap, the one higher up covers
@c the one underneath. Even a window at the bottom of the stack can be
@c seen if no other window overlaps it.
$B$[$H$s$I$N%&%#%s%I%&%7%9%F%`$G$O!"4y$N$?$H$($r;H$$$^$9!#(B
$B$D$^$j!"%9%/%j!<%s$NLL$K?bD>$JJ}8~$r35G0E*$J(B3$B<4L\$H9M$($F!"(B
$B%&%#%s%I%&$O@Q$_=E$J$C$F$$$F!"(B
$B$b$C$H$b<jA0$+$i$b$C$H$b1|$K=g=x$,$D$$$F$$$^$9!#(B
2$B$D$N%&%#%s%I%&$,=E$J$j9g$C$F$$$k$H$3$m$G$O!"(B
$B<jA0$N$b$N$,$=$N$7$?$N$b$N$r1#$7$F$$$^$9!#(B
$B$b$C$H$b1|$K$"$k%&%#%s%I%&$G$"$C$F$b!"(B
$B$=$l$K=E$J$k%&%#%s%I%&$,$J$1$l$P8+$k$3$H$,$G$-$^$9!#(B
@c @cindex raising a frame
@c @cindex lowering a frame
@cindex $B%U%l!<%`$r<jA0$KCV$/(B
@cindex $B%U%l!<%`$r1|$KCV$/(B
@c A window's place in this ordering is not fixed; in fact, users tend
@c to change the order frequently. @dfn{Raising} a window means moving
@c it ``up'', to the top of the stack. @dfn{Lowering} a window means
@c moving it to the bottom of the stack. This motion is in the notional
@c third dimension only, and does not change the position of the window
@c on the screen.
$B%&%#%s%I%&$N$3$N$h$&$J=g=x$O8GDj$5$l$F$$$^$;$s!#(B
$B<B:]!"%f!<%6!<$O=g=x$rIQHK$KJQ99$7$^$9!#(B
$B%&%#%s%I%&$r(B@dfn{$B<jA0$KCV$/(B}$B!J(Braising$B!K$H$O!"(B
$B%&%#%s%I%&$r@Q$_=E$M$N$b$C$H$b>e$K0\F0$9$k$3$H$G$9!#(B
$B%&%#%s%I%&$r(B@dfn{$B1|$KCV$/(B}$B!J(Blowering$B!K$H$O!"(B
$B%&%#%s%I%&$r@Q$_=E$M$N$b$C$H$b2<$K0\F0$9$k$3$H$G$9!#(B
$B$3$N0\F0$O35G0E*$J(B3$B<4L\$K8B$j!"(B
$B%9%/%j!<%s>e$G$N%&%#%s%I%&$N0LCV$OJQ$($^$;$s!#(B
@c You can raise and lower Emacs frame Windows with these functions:
Emacs$B$N%U%l!<%`$rI=$9%&%#%s%I%&$O!"$D$.$N4X?t$G(B
$B<jA0$XCV$$$?$j1|$XCV$1$^$9!#(B
@c @deffn Command raise-frame &optional frame
@deffn $B%3%^%s%I(B raise-frame &optional frame
@c This function raises frame @var{frame} (default, the selected frame).
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$r<jA0$KCV$/(B
$B!J%G%U%)%k%H$OA*Br$5$l$F$$$k%U%l!<%`!K!#(B
@end deffn
@c @deffn Command lower-frame &optional frame
@deffn $B%3%^%s%I(B lower-frame &optional frame
@c This function lowers frame @var{frame} (default, the selected frame).
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$B$r1|$KCV$/(B
$B!J%G%U%)%k%H$OA*Br$5$l$F$$$k%U%l!<%`!K!#(B
@end deffn
@defopt minibuffer-auto-raise
@c If this is non-@code{nil}, activation of the minibuffer raises the frame
@c that the minibuffer window is in.
$B$3$l$,(B@code{nil}$B0J30$G$"$k$H!"%_%K%P%C%U%!$,3h@-$K$J$k$H(B
$B%_%K%P%C%U%!MQ%&%#%s%I%&$,$"$k%U%l!<%`$r<jA0$KCV$/!#(B
@end defopt
@c You can also enable auto-raise (raising automatically when a frame is
@c selected) or auto-lower (lowering automatically when it is deselected)
@c for any frame using frame parameters. @xref{Window Frame Parameters}.
$B%U%l!<%`%Q%i%a!<%?$r;H$&$H!"%U%l!<%`$,(B
$BA*Br$5$l$k$H<+F0E*$K<jA0$KCV$$$?$j!J(B@code{auto-raise}$B!K!"(B
$BA*Br$r;_$a$k$H1|$XCV$1!J(B@code{auto-lower}$B!K$^$9!#(B
@xref{Window Frame Parameters}$B!#(B
@node Frame Configurations
@c @section Frame Configurations
@section $B%U%l!<%`9=@.(B
@c @cindex frame configuration
@cindex $B%U%l!<%`9=@.(B
@c A @dfn{frame configuration} records the current arrangement of frames,
@c all their properties, and the window configuration of each one.
@c (@xref{Window Configurations}.)
@dfn{$B%U%l!<%`9=@.(B}$B!J(Bframe configuration$B!K$O!"(B
$B8=:_$N%U%l!<%`$NG[CV!"$=$l$i$N$9$Y$F$NB0@-!"$=$l$>$l$N%&%#%s%I%&9=@.$r(B
$B5-O?$7$?$b$N$G$9!#(B
$B!J(B@pxref{Window Configurations}$B!#!K(B
@defun current-frame-configuration
@c This function returns a frame configuration list that describes
@c the current arrangement of frames and their contents.
$B$3$N4X?t$O!"8=:_$N%U%l!<%`$NG[CV$H$=$l$i$NFbMF$r5-=R$7$?(B
$B%U%l!<%`9=@.$N%j%9%H$rJV$9!#(B
@end defun
@defun set-frame-configuration configuration
@c This function restores the state of frames described in
@c @var{configuration}.
$B$3$N4X?t$O!"(B@var{configuration}$B$G5-=R$5$l$?%U%l!<%`$N>uBV$KI|85$9$k!#(B
@end defun
@node Mouse Tracking
@c @section Mouse Tracking
@section $B%^%&%9$NDI@W(B
@c @cindex mouse tracking
@c @cindex tracking the mouse
@cindex $B%^%&%9$NDI@W(B
@cindex $BDI@W!"%^%&%9(B
@c Sometimes it is useful to @dfn{track} the mouse, which means to display
@c something to indicate where the mouse is and move the indicator as the
@c mouse moves. For efficient mouse tracking, you need a way to wait until
@c the mouse actually moves.
$B%^%&%9$r(B@dfn{$BDI@W(B}$B!J(Btrack$B!K$G$-$k$HM-MQ$J$3$H$,$"$j$^$9!#(B
$B$D$^$j!"%^%&%9$,$I$3$K$"$k$+$rI=$9;X<(;R$rI=<($7$F(B
$B%^%&%9$N0\F0$K=>$C$F;X<(;R$rF0$+$9$N$G$9!#(B
$B8zN($h$/%^%&%9$rDI@W$9$k$K$O!"%^%&%9$,<B:]$K0\F0$9$k$^$GBT$D<jCJ$,I,MW$G$9!#(B
@c The convenient way to track the mouse is to ask for events to represent
@c mouse motion. Then you can wait for motion by waiting for an event. In
@c addition, you can easily handle any other sorts of events that may
@c occur. That is useful, because normally you don't want to track the
@c mouse forever---only until some other event, such as the release of a
@c button.
$B%^%&%9$rDI@W$9$kJXMx$JJ}K!$O!"%^%&%9$N0\F0$rI=$9%$%Y%s%H$rBT$D$3$H$G$9!#(B
$B$=$&$9$l$P!"$=$N$h$&$J%$%Y%s%H$rBT$F$P%^%&%9$N0\F0$rBT$F$^$9!#(B
$B$5$i$K!"H/@8$7$&$k$=$l0J30$N<oN`$N%$%Y%s%H$r07$&$N$b4JC1$G$9!#(B
$BIaDL$O%^%&%9$r1J1s$KDI@W$7B3$1$?$$$N$G$O$J$/(B
$B%\%?%s$rN%$9$J$I$NJL$N%$%Y%s%H$rBT$A$?$$$N$G$7$g$&$+$i!"(B
$B$3$l$OM-MQ$G$9!#(B
@defspec track-mouse body@dots{}
@c This special form executes @var{body}, with generation of mouse motion
@c events enabled. Typically @var{body} would use @code{read-event} to
@c read the motion events and modify the display accordingly. @xref{Motion
@c Events}, for the format of mouse motion events.
$B$3$N%9%Z%7%c%k%U%)!<%`$O!"%^%&%9%b!<%7%g%s%$%Y%s%H$r@8@.$9$k$h$&$K$7$F(B
@var{body}$B$r<B9T$9$k!#(B
$BE57?E*$K$O(B@var{body}$B$G$O(B@code{read-event}$B$r;H$C$F(B
$B%b!<%7%g%s%$%Y%s%H$rFI$_!"$=$l$K=>$C$FI=<($rJQ99$9$k!#(B
$B%^%&%9%b!<%7%g%s%$%Y%s%H$N7A<0$K$D$$$F$O!"(B
@pxref{Motion Events}$B!#(B
@c The value of @code{track-mouse} is that of the last form in @var{body}.
@c You should design @var{body} to return when it sees the up-event that
@c indicates the release of the button, or whatever kind of event means
@c it is time to stop tracking.
@code{track-mouse}$B$NCM$O(B@var{body}$B$N:G8e$N%U%)!<%`$NCM$G$"$k!#(B
@var{body}$B$O!"%\%?%s$rN%$7$?$3$H$rI=$9%$%Y%s%H$d(B
$BDI@W$r=*$($k$Y$-%$%Y%s%H$K=P2q$&$HLa$k$h$&$K@_7W$9$k$3$H!#(B
@end defspec
@c The usual purpose of tracking mouse motion is to indicate on the screen
@c the consequences of pushing or releasing a button at the current
@c position.
$B%^%&%9$N0\F0$rDI@W$9$kIaDL$NL\E*$O!"(B
$B8=:_$N0LCV$G%\%?%s$r2!$7$?$jN%$9$H$J$K$,5/$3$k$+$r(B
$B%9%/%j!<%s>e$K<($9$3$H$G$9!#(B
@c In many cases, you can avoid the need to track the mouse by using
@c the @code{mouse-face} text property (@pxref{Special Properties}).
@c That works at a much lower level and runs more smoothly than
@c Lisp-level mouse tracking.
$BB?$/$N>lLL$G$O!"%F%-%9%HB0@-(B@code{mouse-face}$B!J(B@pxref{Special Properties}$B!K(B
$B$r;H$($P!"%^%&%9$rDI@W$9$kI,MW$O$J$/$J$j$^$9!#(B
$B$3$l$O$H$F$bDc$$%l%Y%k$GF0:n$7!"(B
Lisp$B%l%Y%k$G%^%&%9$rDI@W$9$k$h$j3j$i$+$KF0:n$7$^$9!#(B
@ignore
@c These are not implemented yet.
These functions change the screen appearance instantaneously. The
effect is transient, only until the next ordinary Emacs redisplay. That
is OK for mouse tracking, since it doesn't make sense for mouse tracking
to change the text, and the body of @code{track-mouse} normally reads
the events itself and does not do redisplay.
@defun x-contour-region window beg end
This function draws lines to make a box around the text from @var{beg}
to @var{end}, in window @var{window}.
@end defun
@defun x-uncontour-region window beg end
This function erases the lines that would make a box around the text
from @var{beg} to @var{end}, in window @var{window}. Use it to remove
a contour that you previously made by calling @code{x-contour-region}.
@end defun
@defun x-draw-rectangle frame left top right bottom
This function draws a hollow rectangle on frame @var{frame} with the
specified edge coordinates, all measured in pixels from the inside top
left corner. It uses the cursor color, the one used for indicating the
location of point.
@end defun
@defun x-erase-rectangle frame left top right bottom
This function erases a hollow rectangle on frame @var{frame} with the
specified edge coordinates, all measured in pixels from the inside top
left corner. Erasure means redrawing the text and background that
normally belong in the specified rectangle.
@end defun
@end ignore
@node Mouse Position
@c @section Mouse Position
@section $B%^%&%9$N0LCV(B
@c @cindex mouse position
@c @cindex position of mouse
@cindex $B%^%&%9$N0LCV(B
@cindex $B0LCV!"%^%&%9(B
@c The functions @code{mouse-position} and @code{set-mouse-position}
@c give access to the current position of the mouse.
$B4X?t(B@code{mouse-position}$B$H(B@code{set-mouse-position}$B$G!"(B
$B%^%&%9$N8=:_0LCV$r;2>H$G$-$^$9!#(B
@defun mouse-position
@c This function returns a description of the position of the mouse. The
@c value looks like @code{(@var{frame} @var{x} . @var{y})}, where @var{x}
@c and @var{y} are integers giving the position in characters relative to
@c the top left corner of the inside of @var{frame}.
$B$3$N4X?t$O!"%^%&%9$N0LCV$rI=$9$b$N$rJV$9!#(B
$B$=$NCM$O(B@code{(@var{frame} @var{x} . @var{y})}$B$N7A$G$"$j!"(B
@var{x}$B$H(B@var{y}$B$O%U%l!<%`(B@var{frame}$B$NFbB&$N:8>e6y$r4p=`$K$7$?(B
$BJ8;z?t$G?t$($?0LCV$rI=$9@0?t$G$"$k!#(B
@end defun
@defun set-mouse-position frame x y
@c This function @dfn{warps the mouse} to position @var{x}, @var{y} in
@c frame @var{frame}. The arguments @var{x} and @var{y} are integers,
@c giving the position in characters relative to the top left corner of the
@c inside of @var{frame}. If @var{frame} is not visible, this function
@c does nothing. The return value is not significant.
$B$3$N4X?t$O!"%U%l!<%`(B@var{frame}$BFb$G(B@var{x}$B$H(B@var{y}$B$N0LCV$K%^%&%9$r0\F0$9$k!#(B
$B0z?t(B@var{x}$B$H(B@var{y}$B$O@0?t$G$"$j!"(B
$B%U%l!<%`(B@var{frame}$B$NFbB&$N:8>e6y$r4p=`$K$7$?J8;z?t$G?t$($?0LCV$G$"$k!#(B
@var{frame}$B$,IT2D;k$G$"$k$H!"$3$N4X?t$O$J$K$b$7$J$$!#(B
$BLa$jCM$K$O0UL#$O$J$$!#(B
@end defun
@defun mouse-pixel-position
@c This function is like @code{mouse-position} except that it returns
@c coordinates in units of pixels rather than units of characters.
$B$3$N4X?t$O(B@code{mouse-position}$B$K;w$F$$$k$,!"(B
$BJ8;zC10L$G$O$J$/%T%/%;%kC10L$G:BI8$rJV$9!#(B
@end defun
@defun set-mouse-pixel-position frame x y
@c This function warps the mouse like @code{set-mouse-position} except that
@c @var{x} and @var{y} are in units of pixels rather than units of
@c characters. These coordinates are not required to be within the frame.
$B$3$N4X?t$O(B@code{set-mouse-position}$B$N$h$&$K%^%&%9$r0\F0$9$k$,!"(B
@var{x}$B$H(B@var{y}$B$OJ8;zC10L$G$J$/%T%/%;%kC10L$G$"$k!#(B
$B$3$l$i$N:BI8$O%U%l!<%`$NFbB&$K$"$kI,MW$O$J$$!#(B
@c If @var{frame} is not visible, this function does nothing. The return
@c value is not significant.
@var{frame}$B$,IT2D;k$G$"$k$H!"$3$N4X?t$O$J$K$b$7$J$$!#(B
$BLa$jCM$K$O0UL#$O$J$$!#(B
@end defun
@need 3000
@node Pop-Up Menus
@c @section Pop-Up Menus
@section $B%]%C%W%"%C%W%a%K%e!<(B
@c When using a window system, a Lisp program can pop up a menu so that
@c the user can choose an alternative with the mouse.
$B%&%#%s%I%&%7%9%F%`$r;H$C$F$$$k$H$-$K$O!"(B
$B%f!<%6!<$,%^%&%9$GA*Br$G$-$k$h$&$K(B
Lisp$B%W%m%0%i%`$+$i%a%K%e!<$r%]%C%W%"%C%W$G$-$^$9!#(B
@defun x-popup-menu position menu
@c This function displays a pop-up menu and returns an indication of
@c what selection the user makes.
$B$3$N4X?t$O%]%C%W%"%C%W%a%K%e!<$rI=<($7!"(B
$B%f!<%6!<$,9T$C$?A*Br$rI=$9;X<(;R$rJV$9!#(B
@c The argument @var{position} specifies where on the screen to put the
@c menu. It can be either a mouse button event (which says to put the menu
@c where the user actuated the button) or a list of this form:
$B0z?t(B@var{position}$B$O!"%9%/%j!<%s$N$I$3$K%a%K%e!<$rCV$/$+$r;XDj$9$k!#(B
$B$=$l$O%^%&%9$N%\%?%s%$%Y%s%H!J%f!<%6!<$,%\%?%s$r2!$7$?>l=j$K%a%K%e!<$rCV$/!K$+(B
$B$D$.$N7A$N%j%9%H$G$b$h$$!#(B
@example
((@var{xoffset} @var{yoffset}) @var{window})
@end example
@noindent
@c where @var{xoffset} and @var{yoffset} are coordinates, measured in
@c pixels, counting from the top left corner of @var{window}'s frame.
$B$3$3$G!"(B@var{xoffset}$B$H(B@var{yoffset}$B$O(B
$B%&%#%s%I%&(B@var{window}$B$N%U%l!<%`$N:8>e6y$+$iB,$C$?%T%/%;%kC10L$N:BI8$G$"$k!#(B
@c If @var{position} is @code{t}, it means to use the current mouse
@c position. If @var{position} is @code{nil}, it means to precompute the
@c key binding equivalents for the keymaps specified in @var{menu},
@c without actually displaying or popping up the menu.
@var{position}$B$,(B@code{t}$B$G$"$k$H%^%&%9$N8=:_0LCV$r;H$&$3$H$r0UL#$9$k!#(B
@var{position}$B$,(B@code{nil}$B$G$"$k$H!"(B
$B%a%K%e!<$r<B:]$K$OI=<($;$:$K!"(B
@var{menu}$B$K;XDj$7$F$"$k%-!<%^%C%W$KEy2A$J%-!<%P%$%s%G%#%s%0$r(B
$B$"$i$+$8$a7W;;$9$k$3$H$r0UL#$9$k!#(B
@c The argument @var{menu} says what to display in the menu. It can be a
@c keymap or a list of keymaps (@pxref{Menu Keymaps}). Alternatively, it
@c can have the following form:
$B0z?t(B@var{menu}$B$O!"%a%K%e!<$KI=<($9$k$b$N$r;XDj$9$k!#(B
$B$=$l$O%-!<%^%C%W$+%-!<%^%C%W$N%j%9%H$G$"$k!J(B@pxref{Menu Keymaps}$B!K!#(B
$B$"$k$$$O!"$D$.$N7A$G$b$h$$!#(B
@example
(@var{title} @var{pane1} @var{pane2}...)
@end example
@noindent
@c where each pane is a list of form
$B$3$3$G!"3F%Z%$%s$O$D$.$N7A$N%j%9%H$G$"$k!#(B
@example
(@var{title} (@var{line} . @var{item})...)
@end example
@c Each @var{line} should be a string, and each @var{item} should be the
@c value to return if that @var{line} is chosen.
$B3F(B@var{line}$B$OJ8;zNs$G$"$j!"(B
$B3F(B@var{item}$B$OBP1~$9$k(B@var{line}$B$,A*$P$l$?$H$-$KJV$5$l$kCM$G$"$k$3$H!#(B
@end defun
@c @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu
@c if you could do the job with a prefix key defined with a menu keymap.
@c If you use a menu keymap to implement a menu, @kbd{C-h c} and @kbd{C-h
@c a} can see the individual items in that menu and provide help for them.
@c If instead you implement the menu by defining a command that calls
@c @code{x-popup-menu}, the help facilities cannot know what happens inside
@c that command, so they cannot give any help for the menu's items.
@strong{$B;HMQ>e$NCm0U!'(B}@code{ }
$B%a%K%e!<%-!<%^%C%W$GDj5A$7$?%W%l%U%#%C%/%9%-!<$G$G$-$k$3$H$K$O!"(B
$B%a%K%e!<$rI=<($9$k$?$a$K(B@code{x-popup-menu}$B$r;H$o$J$$$3$H!#(B
$B%a%K%e!<%-!<%^%C%W$r;H$C$F%a%K%e!<$r<BAu$9$k$H!"(B
@kbd{C-h c}$B$d(B@kbd{C-h a}$B$GEv3:%a%K%e!<$N8D!9$N9`L\$r8+$k$3$H$,$G$-!"(B
$B$=$l$i$KBP$9$k%X%k%W$rDs6!$G$-$k!#(B
@code{x-popup-menu}$B$r8F$S=P$9%3%^%s%I$rDj5A$7$F%a%K%e!<$r<BAu$9$k$H!"(B
$B%X%k%W5!G=$K$OEv3:%3%^%s%I$NFbB&$G$J$K$,$J$5$l$k$+$o$+$i$J$$$N$G!"(B
$B%a%K%e!<$N9`L\$KBP$9$k%X%k%W$rDs6!$G$-$J$$!#(B
@c The menu bar mechanism, which lets you switch between submenus by
@c moving the mouse, cannot look within the definition of a command to see
@c that it calls @code{x-popup-menu}. Therefore, if you try to implement a
@c submenu using @code{x-popup-menu}, it cannot work with the menu bar in
@c an integrated fashion. This is why all menu bar submenus are
@c implemented with menu keymaps within the parent menu, and never with
@c @code{x-popup-menu}. @xref{Menu Bar},
$B%^%&%9$N0\F0$G%5%V%a%K%e!<$r@Z$jBX$($i$l$k%a%K%e!<%P!<$N5!9=$G$O!"(B
@code{x-popup-menu}$B$r8F$S=P$9%3%^%s%I$NDj5A$rD4$Y$i$l$^$;$s!#(B
$B$7$?$,$C$F!"(B@code{x-popup-menu}$B$r;H$C$F%5%V%a%K%e!<$r<BAu$9$k$H!"(B
$B$=$l$i$O%a%K%e!<%P!<$KE,1~$7$?F0:n$r$G$-$^$;$s!#(B
$B$3$N$?$a$K!"%a%K%e!<%P!<$N$9$Y$F$N%5%V%a%K%e!<$O!"(B
$B?F%a%K%e!<Fb$N%a%K%e!<%-!<%^%C%W$H$7$F<BAu$7$F$"$j!"(B
@code{x-popup-menu}$B$O;H$C$F$$$^$;$s!#(B
@xref{Menu Bar}$B!#(B
@c If you want a menu bar submenu to have contents that vary, you should
@c still use a menu keymap to implement it. To make the contents vary, add
@c a hook function to @code{menu-bar-update-hook} to update the contents of
@c the menu keymap as necessary.
$B%a%K%e!<%P!<$KFbMF$,JQ2=$9$k%5%V%a%K%e!<$r;H$$$?$$$H$-$G$b!"(B
$B%a%K%e!<%-!<%^%C%W$r;H$C$F<BAu$9$k$Y$-$G$9!#(B
$BFbMF$rJQ$($k$K$O!"I,MW$K1~$8$F%a%K%e!<%-!<$NFbMF$r99?7$9$k$?$a$K(B
@code{menu-bar-update-hook}$B$K%U%C%/4X?t$rDI2C$7$^$9!#(B
@node Dialog Boxes
@c @section Dialog Boxes
@section $BBPOC%\%C%/%9(B
@c @cindex dialog boxes
@cindex $BBPOC%\%C%/%9(B
@c A dialog box is a variant of a pop-up menu---it looks a little
@c different, it always appears in the center of a frame, and it has just
@c one level and one pane. The main use of dialog boxes is for asking
@c questions that the user can answer with ``yes'', ``no'', and a few other
@c alternatives. The functions @code{y-or-n-p} and @code{yes-or-no-p} use
@c dialog boxes instead of the keyboard, when called from commands invoked
@c by mouse clicks.
$BBPOC%\%C%/%9$O%]%C%W%"%C%W%a%K%e!<$NJQ7A$G$9!#(B
$B>/!90[$J$C$F8+$($^$9$,!"%U%l!<%`$NCf1{$K$D$M$K8=$l!"(B
$B$?$C$?(B1$B$D$N%l%Y%k$G(B1$B$D$N%Z%$%s$G$9!#(B
$BBPOC%\%C%/%9$N<g$JMQES$O!"(B
$B%f!<%6!<$,!X(Byes$B!Y!"!X(Bno$B!Y!"$*$h$SB>$N>/?t$NA*Br;h$GEz$($k$h$&$J(B
$BLd$$9g$o$;$r9T$&$?$a$G$9!#(B
$B4X?t(B@code{y-or-n-p}$B$H(B@code{yes-or-no-p}$B$O!"(B
$B%^%&%9%/%j%C%/$G5/F0$5$l$?%3%^%s%I$+$i8F$P$l$k$H(B
$B%-!<%\!<%I$G$O$J$/BPOC%\%C%/%9$r;H$$$^$9!#(B
@defun x-popup-dialog position contents
@c This function displays a pop-up dialog box and returns an indication of
@c what selection the user makes. The argument @var{contents} specifies
@c the alternatives to offer; it has this format:
$B$3$N4X?t$O!"BPOC%\%C%/%9$rI=<($7!"(B
$B%f!<%6!<$,A*$s$@A*Br;h$rI=$9;X<(;R$rJV$9!#(B
$B0z?t(B@var{contents}$B$OI=<($9$kA*Br;h$r;XDj$7!"$D$.$N7A$G$"$k!#(B
@example
(@var{title} (@var{string} . @var{value})@dots{})
@end example
@noindent
@c which looks like the list that specifies a single pane for
@c @code{x-popup-menu}.
$B$3$l$O!"(B@code{x-popup-menu}$B$KBP$7$FC10l$N%Z%$%s$r;XDj$9$k%j%9%H$K;w$F$$$k!#(B
@c The return value is @var{value} from the chosen alternative.
$BLa$jCM$O!"A*$P$l$?A*Br;h$N(B@var{value}$B$G$"$k!#(B
@c An element of the list may be just a string instead of a cons cell
@c @code{(@var{string} . @var{value})}. That makes a box that cannot
@c be selected.
$B%j%9%H$NMWAG$O!"(B@code{(@var{string} . @var{value})}$B$N7A$N(B
$B%3%s%9%;%k$N$+$o$j$KC1$KJ8;zNs$G$b$h$$!#(B
$B$=$&$9$k$H!"BPOC%\%C%/%9$G$OA*Br$G$-$J$/$J$k!#(B
@c If @code{nil} appears in the list, it separates the left-hand items from
@c the right-hand items; items that precede the @code{nil} appear on the
@c left, and items that follow the @code{nil} appear on the right. If you
@c don't include a @code{nil} in the list, then approximately half the
@c items appear on each side.
$B%j%9%H$K(B@code{nil}$B$,8=$l$k$H!"$=$l$O:8B&$N9`L\$H1&B&$N9`L\$r6h@Z$k!#(B
@code{nil}$B$N$^$($N9`L\$O:8B&$K8=$l!"(B
@code{nil}$B$KB3$/9`L\$O1&B&$K8=$l$k!#(B
$B%j%9%H$K(B@code{nil}$B$r4^$a$J$1$l$P!"9`L\$N$[$\H>J,$,$=$l$>$l$NB&$K8=$l$k!#(B
@c Dialog boxes always appear in the center of a frame; the argument
@c @var{position} specifies which frame. The possible values are as in
@c @code{x-popup-menu}, but the precise coordinates don't matter; only the
@c frame matters.
$BBPOC%\%C%/%9$O%U%l!<%`$NCf1{$K$D$M$K8=$l!"(B
$B0z?t(B@var{position}$B$O$=$N%U%l!<%`$r;XDj$9$k!#(B
$B2DG=$JCM$O(B@code{x-popup-menu}$B$HF1MM$G$"$k$,!"(B
$B@53N$J:BI8$O4X78$J$/%U%l!<%`$@$1$,0UL#$r;}$D!#(B
@c In some configurations, Emacs cannot display a real dialog box; so
@c instead it displays the same items in a pop-up menu in the center of the
@c frame.
$B>l9g$K$h$C$F$O!"(BEmacs$B$OK\Ev$NBPOC%\%C%/%9$rI=<($G$-$J$$!#(B
$B$=$N$H$-$K$O%U%l!<%`$NCf1{$K%]%C%W%"%C%W%a%K%e!<$GF1$89`L\$rI=<($9$k!#(B
@end defun
@node Pointer Shapes
@c @section Pointer Shapes
@section $B%]%$%s%?$N7A>u(B
@c @cindex pointer shape
@c @cindex mouse pointer shape
@cindex $B%]%$%s%?$N7A>u(B
@cindex $B%^%&%9%]%$%s%?$N7A>u(B
@c These variables specify which shape to use for the mouse pointer in
@c various situations, when using the X Window System:
$B$3$l$i$NJQ?t$O!"(BX$B%&%#%s%I%&%7%9%F%`$r;H$C$F$$$k$H$-$K(B
$B$5$^$6$^$J>lLL$G;HMQ$9$k%^%&%9%]%$%s%?$N7A>u$r;XDj$7$^$9!#(B
@table @code
@item x-pointer-shape
@vindex x-pointer-shape
@c This variable specifies the pointer shape to use ordinarily in the Emacs
@c frame.
$B$3$NJQ?t$O!"(BEmacs$B$N%U%l!<%`Fb$GIaDL$K;H$&%]%$%s%?7A>u$r;XDj$9$k!#(B
@item x-sensitive-text-pointer-shape
@vindex x-sensitive-text-pointer-shape
@c This variable specifies the pointer shape to use when the mouse
@c is over mouse-sensitive text.
$B$3$NJQ?t$O!"%^%&%9$KH?1~$9$k%F%-%9%H>e$K%^%&%9$,$"$k$H$-$K(B
$B;HMQ$9$k%]%$%s%?7A>u$r;XDj$9$k!#(B
@end table
@c These variables affect newly created frames. They do not normally
@c affect existing frames; however, if you set the mouse color of a frame,
@c that also updates its pointer shapes based on the current values of
@c these variables. @xref{Window Frame Parameters}.
$B$3$l$i$NJQ?t$O!"?7$?$K:n@.$7$?%U%l!<%`$K1F6A$7$^$9!#(B
$B4{B8$N%U%l!<%`$K$ODL>o$O1F6A$7$^$;$s!#(B
$B$7$+$7!"%U%l!<%`$N%^%&%9$NI=<(?'$r@_Dj$9$k$H!"(B
$B$3$l$i$NJQ?t$N8=:_CM$K4p$E$$$F%]%$%s%?7A>u$b99?7$7$^$9!#(B
@xref{Window Frame Parameters}$B!#(B
@c The values you can use, to specify either of these pointer shapes, are
@c defined in the file @file{lisp/term/x-win.el}. Use @kbd{M-x apropos
@c @key{RET} x-pointer @key{RET}} to see a list of them.
$B$3$l$i$N%]%$%s%?7A>u$N;XDj$K;H$($kCM$O!"(B
$B%U%!%$%k(B@file{lisp/term/x-win.el}$B$GDj5A$7$F$"$j$^$9!#(B
$B$=$l$i$N0lMw$r8+$k$K$O(B
@kbd{M-x apropos @key{RET} x-pointer @key{RET}}$B$r;H$$$^$9!#(B
@node Window System Selections
@c @section Window System Selections
@section $B%&%#%s%I%&%7%9%F%`$N%;%l%/%7%g%s(B
@c @cindex selection (for X windows)
@cindex $B%;%l%/%7%g%s!J(BX$B%&%#%s%I%&%7%9%F%`!K(B
@c The X server records a set of @dfn{selections} which permit transfer of
@c data between application programs. The various selections are
@c distinguished by @dfn{selection types}, represented in Emacs by
@c symbols. X clients including Emacs can read or set the selection for
@c any given type.
X$B%5!<%P!<$O!"%"%W%j%1!<%7%g%s%W%m%0%i%`$N$"$$$@$G%G!<%?$r(B
$BE>Aw$9$k$?$a$N(B@dfn{$B%;%l%/%7%g%s(B}$B!J(Bselection$B!K$N=8$^$j$r5-O?$7$^$9!#(B
$B$5$^$6$^$J%;%l%/%7%g%s$O!"(BEmacs$B$G$O%7%s%\%k$GI=$7$?(B
@dfn{$B%;%l%/%7%g%s7?(B}$B!J(Bselection type$B!K$G6hJL$5$l$^$9!#(B
Emacs$B$r4^$`(BX$B%/%i%$%"%s%H$O!"G$0U$N7?$N%;%l%/%7%g%s$rFI$s$@$j@_Dj$G$-$^$9!#(B
@defun x-set-selection type data
@c This function sets a ``selection'' in the X server. It takes two
@c arguments: a selection type @var{type}, and the value to assign to it,
@c @var{data}. If @var{data} is @code{nil}, it means to clear out the
@c selection. Otherwise, @var{data} may be a string, a symbol, an integer
@c (or a cons of two integers or list of two integers), an overlay, or a
@c cons of two markers pointing to the same buffer. An overlay or a pair
@c of markers stands for text in the overlay or between the markers.
$B$3$N4X?t$O!"(BX$B%5!<%P!<$K!X%;%l%/%7%g%s!Y$r@_Dj$9$k!#(B
$B$3$l$O(B2$B$D$N0z?t!"%;%l%/%7%g%s7?(B@var{type}$B$H(B
$B$=$l$K3d$jEv$F$kCM(B@var{data}$B$r<h$k!#(B
@var{data}$B$,(B@code{nil}$B$G$"$k$H!"Ev3:%;%l%/%7%g%s$r:o=|$9$k$3$H$r0UL#$9$k!#(B
$B$5$b$J$1$l$P(B@var{data}$B$O!"J8;zNs!"(B
$B@0?t!J$"$k$$$O(B2$B$D$N?t$N%3%s%9%;%k$+%j%9%H!K!"(B
$B%*!<%P%l%$!"F1$8%P%C%U%!$r;X$9(B2$B$D$N%^!<%+$N%3%s%9%;%k$N$$$:$l$+$G$"$k!#(B
$B%*!<%P%l%$$d%^!<%+$NBP$O!"(B
$B%*!<%P%l%$$N%F%-%9%H$d%^!<%+$N$"$$$@$N%F%-%9%H$rI=$9!#(B
@c The argument @var{data} may also be a vector of valid non-vector
@c selection values.
$B0z?t(B@var{data}$B$O!"%Y%/%H%k$G$O$J$$@5$7$$%;%l%/%7%g%sCM$N%Y%/%H%k$G$b$h$$!#(B
@c Each possible @var{type} has its own selection value, which changes
@c independently. The usual values of @var{type} are @code{PRIMARY} and
@c @code{SECONDARY}; these are symbols with upper-case names, in accord
@c with X Window System conventions. The default is @code{PRIMARY}.
$B2DG=$J3F(B@var{type}$B$K$O7?$K0MB8$7$?FH<+$N%;%l%/%7%g%sCM$,$"$k!#(B
@var{type}$B$NIaDL$NCM$O(B@code{PRIMARY}$B$+(B@code{SECONDARY}$B$G$"$k!#(B
$B$3$l$i$N%7%s%\%k$O!"(BX$B%&%#%s%I%&%7%9%F%`$N47=,$K=>$C$F(B
$BBgJ8;z$NL>A0$G$"$k!#(B
$B%G%U%)%k%H$O(B@code{PRIMARY}$B$G$"$k!#(B
@end defun
@defun x-get-selection &optional type data-type
@c This function accesses selections set up by Emacs or by other X
@c clients. It takes two optional arguments, @var{type} and
@c @var{data-type}. The default for @var{type}, the selection type, is
@c @code{PRIMARY}.
$B$3$N4X?t$O!"(BEmacs$B$dB>$N(BX$B%/%i%$%"%s%H$,@_Dj$7$?%;%l%/%7%g%s$r;2>H$9$k!#(B
$B$3$l$O(B2$B$D$N0z?t!"(B@var{type}$B$H(B@var{data-type}$B$r<h$k!#(B
$B%;%l%/%7%g%s7?(B@var{type}$B$N%G%U%)%k%H$O(B@code{PRIMARY}$B$G$"$k!#(B
@c The @var{data-type} argument specifies the form of data conversion to
@c use, to convert the raw data obtained from another X client into Lisp
@c data. Meaningful values include @code{TEXT}, @code{STRING},
@c @code{TARGETS}, @code{LENGTH}, @code{DELETE}, @code{FILE_NAME},
@c @code{CHARACTER_POSITION}, @code{LINE_NUMBER}, @code{COLUMN_NUMBER},
@c @code{OWNER_OS}, @code{HOST_NAME}, @code{USER}, @code{CLASS},
@c @code{NAME}, @code{ATOM}, and @code{INTEGER}. (These are symbols with
@c upper-case names in accord with X conventions.) The default for
@c @var{data-type} is @code{STRING}.
$B0z?t(B@var{data-type}$B$O!"B>$N(BX$B%/%i%$%"%s%H$+$iF@$?@8%G!<%?$r(B
Lisp$B%G!<%?$KJQ49$9$k$?$a$K;HMQ$9$k%G!<%?JQ49$N=q<0$r;XDj$9$k!#(B
$B0UL#$N$"$kCM$O!"(B@code{TEXT}$B!"(B@code{STRING}$B!"(B
@code{CHARACTER_POSITION}$B!"(B@code{LINE_NUMBER}$B!"(B@code{COLUMN_NUMBER}$B!"(B
@code{OWNER_OS}$B!"(B@code{HOST_NAME}$B!"(B@code{USER}$B!"(B@code{CLASS}$B!"(B
@code{NAME}$B!"(B@code{ATOM}$B!"(B@code{INTEGER}$B$G$"$k!#(B
$B!J$3$l$i$N%7%s%\%k$O!"(BX$B%&%#%s%I%&%7%9%F%`$N47=,$K=>$C$F(B
$BBgJ8;z$NL>A0$G$"$k!#!K(B
@var{data-type}$B$N%G%U%)%k%H$O(B@code{STRING}$B$G$"$k!#(B
@end defun
@c @cindex cut buffer
@cindex $B%+%C%H%P%C%U%!(B
@c The X server also has a set of numbered @dfn{cut buffers} which can
@c store text or other data being moved between applications. Cut buffers
@c are considered obsolete, but Emacs supports them for the sake of X
@c clients that still use them.
X$B%5!<%P!<$K$O!"%"%W%j%1!<%7%g%s$N$"$$$@$G0\F0$9$k%F%-%9%H$dB>$N%G!<%?$r(B
$BJ]B8$G$-$kHV9fIU$-$N(B@dfn{$B%+%C%H%P%C%U%!(B}$B!J(Bcut buffer$B!K$N=8$^$j$b$"$j$^$9!#(B
$B%+%C%H%P%C%U%!$OGQ$l$F$$$k$H$_$J$5$l$^$9$,!"(B
$B$=$l$i$r;H$C$F$$$k(BX$B%/%i%$%"%s%H8~$1$K(BEmacs$B$O%+%C%H%P%C%U%!$r07$($^$9!#(B
@defun x-get-cut-buffer n
@c This function returns the contents of cut buffer number @var{n}.
$B$3$N4X?t$O!"HV9f(B@var{n}$B$N%+%C%H%P%C%U%!$NFbMF$rJV$9!#(B
@end defun
@defun x-set-cut-buffer string
@c This function stores @var{string} into the first cut buffer (cut buffer
@c 0), moving the other values down through the series of cut buffers, much
@c like the way successive kills in Emacs move down the kill ring.
Emacs$B$,O"B3$7$?%-%k$r%-%k%j%s%0$G=g$K2<8~$-$K0\F0$9$k$N$HF1MM$K!"(B
$B$3$N4X?t$O0lO"$N%+%C%H%P%C%U%!$NCM$r=g$K2<8~$-$K0\F0$7$F$+$i(B
$BJ8;zNs(B@var{string}$B$r:G=i$N%+%C%H%P%C%U%!!JHV9f(B0$B!K$KJ]B8$9$k!#(B
@end defun
@defvar selection-coding-system
@tindex selection-coding-system
@c This variable specifies the coding system to use when reading and
@c writing a selections, the clipboard, or a cut buffer. @xref{Coding
@c Systems}. The default is @code{compound-text}.
$B$3$NJQ?t$O!"%;%l%/%7%g%s!"%/%j%C%W%\!<%I!"%+%C%H%P%C%U%!$r(B
$BFI$_=q$-$9$k$H$-$K;H$&%3!<%G%#%s%0%7%9%F%`$r;XDj$9$k!#(B
@pxref{Coding Systems}$B!#(B
$B%G%U%)%k%H$O(B@code{compound-text}$B$G$"$k!#(B
@end defvar
@need 1500
@node Font Names
@c @section Looking up Font Names
@section $B%U%)%s%HL>$NC5:w(B
@defun x-list-font pattern &optional face frame maximum
@c This function returns a list of available font names that match
@c @var{pattern}. If the optional arguments @var{face} and @var{frame} are
@c specified, then the list is limited to fonts that are the same size as
@c @var{face} currently is on @var{frame}.
$B$3$N4X?t$O!"%Q%?!<%s(B@var{pattern}$B$K0lCW$9$k(B
$BMxMQ2DG=$J%U%)%s%HL>$N%j%9%H$rJV$9!#(B
$B>JN,2DG=$J0z?t(B@var{face}$B$H(B@var{frame}$B$r;XDj$9$k$H!"(B
@var{frame}$B$G8=:_%*%s$K$J$C$F$$$k(B@var{face}$B$HF1$8%5%$%:$N%U%)%s%H$K(B
$B%j%9%H$r@)8B$9$k!#(B
@c The argument @var{pattern} should be a string, perhaps with wildcard
@c characters: the @samp{*} character matches any substring, and the
@c @samp{?} character matches any single character. Pattern matching
@c of font names ignores case.
$B0z?t(B@var{pattern}$B$OJ8;zNs$G$"$k$3$H!#(B
$B$3$l$O%o%$%k%I%+!<%IJ8;z$r4^$s$G$$$F$b$h$$!#(B
@samp{*}$B$OG$0U$NItJ,J8;zNs$K0lCW$7!"(B@samp{?}$B$OG$0U$N(B1$BJ8;z$K0lCW$9$k!#(B
$B%U%)%s%HL>$H%Q%?!<%s$N0lCW$r<h$k:]$K$O!"BgJ8;z>.J8;z$r6hJL$7$J$$!#(B
@c If you specify @var{face} and @var{frame}, @var{face} should be a face name
@c (a symbol) and @var{frame} should be a frame.
@var{face}$B$H(B@var{frame}$B$r;XDj$9$k$H$-$K$O!"(B
@var{face}$B$O%U%'%$%9L>!J%7%s%\%k!K$G$"$j!"(B@var{frame}$B$O%U%l!<%`$G$"$k$3$H!#(B
@c The optional argument @var{maximum} sets a limit on how many fonts to
@c return. If this is non-@code{nil}, then the return value is truncated
@c after the first @var{maximum} matching fonts. Specifying a small value
@c for @var{maximum} can make this function much faster, in cases where
@c many fonts match the pattern.
$B>JN,2DG=$J0z?t(B@var{maximum}$B$O!"JV$9%U%)%s%H$N8D?t$r@)8B$9$k!#(B
$B$3$l$,(B@code{nil}$B0J30$G$"$k$H!"La$jCM$O:G=i$N(B@var{maximum}$B8D$N(B
$B0lCW$7$?%U%)%s%H$K@Z$j5M$a$k!#(B
@var{maximum}$B$K>.$5$JCM$r;XDj$9$k$H!"(B
$BB?$/$N%U%)%s%H$K0lCW$9$k>l9g$G$O$3$N4X?t$NF0:n$,$@$$$VB.$/$J$k!#(B
@end defun
@node Fontsets
@c @section Fontsets
@section $B%U%)%s%H%;%C%H(B
@c A @dfn{fontset} is a list of fonts, each assigned to a range of
@c character codes. An individual font cannot display the whole range of
@c characters that Emacs supports, but a fontset can. Fontsets have names,
@c just as fonts do, and you can use a fontset name in place of a font name
@c when you specify the ``font'' for a frame or a face. Here is
@c information about defining a fontset under Lisp program control.
@dfn{$B%U%)%s%H%;%C%H(B}$B!J(Bfontset$B!K$O!"%U%)%s%H$N%j%9%H$G$"$C$F!"(B
$B3F%U%)%s%H$,J8;z%3!<%I$N$"$kHO0O$K3d$jIU$1$i$l$F$$$^$9!#(B
$B8D!9$N%U%)%s%H$@$1$G$O!"(BEmacs$B$,07$&J8;z=89g$NHO0OA4BN$rI=<($G$-$^$;$s$,!"(B
$B%U%)%s%H%;%C%H$J$i$P2DG=$G$9!#(B
$B%U%)%s%H%;%C%H$K$O%U%)%s%H$HF1MM$KL>A0$,$"$j!"(B
$B%U%l!<%`$d%U%'%$%98~$1$K!X%U%)%s%H!Y$r;XDj$9$k$H$-$N(B
$B%U%)%s%HL>$N$+$o$j$K%U%)%s%H%;%C%HL>$r;H$($^$9!#(B
$B$3$3$G$O!"(BLisp$B%W%m%0%i%`$N@)8f$N$b$H$K%U%)%s%H%;%C%H$rDj5A$9$k$3$H$K(B
$B4X$9$k>pJs$r=R$Y$^$9!#(B
@defun create-fontset-from-fontset-spec fontset-spec &optional style-variant-p noerror
@c This function defines a new fontset according to the specification
@c string @var{fontset-spec}. The string should have this format:
$B$3$N4X?t$O!";XDjJ8;zNs(B@var{fontset-spec}$B$K=>$C$F(B
$B?7$?$J%U%)%s%H%;%C%H$rDj5A$9$k!#(B
$BJ8;zNs$O$D$.$N7A$G$"$k$3$H!#(B
@smallexample
@var{fontpattern}, @r{[}@var{charsetname}:@var{fontname}@r{]@dots{}}
@end smallexample
@noindent
@c Whitespace characters before and after the commas are ignored.
$B%3%s%^$NA08e$NGrJ8;z$OL5;k$9$k!#(B
@c The first part of the string, @var{fontpattern}, should have the form of
@c a standard X font name, except that the last two fields should be
@c @samp{fontset-@var{alias}}.
$BJ8;zNs$N;O$a$NItJ,(B@var{fontpattern}$B$O!"(B
$B:G8e$N(B2$B$D$N%U%#!<%k%I$,(B@samp{fontset-@var{alias}}$B$G$"$k$3$H$r=|$$$F!"(B
X$B$NI8=`%U%)%s%HL>$G$"$k$3$H!#(B
@c The new fontset has two names, one long and one short. The long name is
@c @var{fontpattern} in its entirety. The short name is
@c @samp{fontset-@var{alias}}. You can refer to the fontset by either
@c name. If a fontset with the same name already exists, an error is
@c signaled, unless @var{noerror} is non-@code{nil}, in which case this
@c function does nothing.
$B?7$?$J%U%)%s%H%;%C%H$K$O(B2$B$D$NL>A0!"$D$^$j!"D9$$L>A0$HC;$$L>A0$,$"$k!#(B
$BD9$$L>A0$O(B@var{fontpattern}$B$=$N$b$N$G$"$k!#(B
$BC;$$L>A0$O(B@samp{fontset-@var{alias}}$B$G$"$k!#(B
$B$I$A$i$NL>A0$G$b%U%)%s%H%;%C%H$r;2>H$G$-$k!#(B
$BF1$8L>A0$N%U%)%s%H%;%C%H$,$9$G$KB8:_$9$k>l9g!"(B
@var{noerror}$B$,(B@code{nil}$B$G$"$k$H%(%i!<$rDLCN$7!"(B
$B$3$N4X?t$O$J$K$b$7$J$$!#(B
@c If optional argument @var{style-variant-p} is non-@code{nil}, that says
@c to create bold, italic and bold-italic variants of the fontset as well.
@c These variant fontsets do not have a short name, only a long one, which
@c is made by altering @var{fontpattern} to indicate the bold or italic
@c status.
$B>JN,2DG=$J0z?t(B@var{style-variant-p}$B$,(B@code{nil}$B0J30$G$"$k$H!"(B
$B%U%)%s%H%;%C%H$N(Bbold$B!JB@;z!K!"(Bitalic$B!J<PBN!K!"(Bbold-italic$B!JB@;z<PBN!K$N(B
$B3FJQ<o$b:n@.$9$k$3$H$r;X<($9$k!#(B
$B$3$l$i$NJQ<o$N%U%)%s%H%;%C%H$K$OC;$$L>A0$O$J$/!"(B
var{fontpattern}$B$N(Bbold$B$d(Bitalic$B$rJQ99$7$F:n$C$?D9$$L>A0$@$1$G$"$k!#(B
@c The specification string also says which fonts to use in the fontset.
@c See below for the details.
$B;XDjJ8;zNs$G$O%U%)%s%H%;%C%H$G;H$&%U%)%s%H$b;XDj$9$k!#(B
$B>\$7$/$O2<5-;2>H!#(B
@end defun
@c The construct @samp{@var{charset}:@var{font}} specifies which font to
@c use (in this fontset) for one particular character set. Here,
@c @var{charset} is the name of a character set, and @var{font} is the font
@c to use for that character set. You can use this construct any number of
@c times in the specification string.
@samp{@var{charset}:@var{font}}$B$H$$$&9=@.$O!"(B
$BFCDj$N(B1$B$D$NJ8;z=89g8~$1$K!J$3$N%U%)%s%H%;%C%H$G!K;H$&%U%)%s%H$r;XDj$7$^$9!#(B
$B$3$3$G!"(B@var{charset}$B$OJ8;z=89g$NL>A0$G$"$j!"(B
@var{font}$B$O$=$NJ8;z=89g$K;H$&%U%)%s%H$G$9!#(B
$B$3$N9=@.$O!";XDjJ8;zNs$G2?2s$G$b;H$($^$9!#(B
@c For the remaining character sets, those that you don't specify
@c explicitly, Emacs chooses a font based on @var{fontpattern}: it replaces
@c @samp{fontset-@var{alias}} with a value that names one character set.
@c For the @sc{ASCII} character set, @samp{fontset-@var{alias}} is replaced
@c with @samp{ISO8859-1}.
$BL@<($7$F$J$$;D$j$NJ8;z=89g8~$1$K$O!"(B
@var{fontpattern}$B$K4p$E$$$F(BEmacs$B$,%U%)%s%H$rA*$S$^$9!#(B
$B$D$^$j!"(B@samp{fontset-@var{alias}}$B$r(B1$B$D$NJ8;z=89g$r;XL>$9$kCM$GCV$-49$($^$9!#(B
@sc{ASCII}$BJ8;z=89g8~$1$K$O!"(B
@samp{fontset-@var{alias}}$B$r(B@samp{ISO8859-1}$B$GCV$-49$($^$9!#(B
@c In addition, when several consecutive fields are wildcards, Emacs
@c collapses them into a single wildcard. This is to prevent use of
@c auto-scaled fonts. Fonts made by scaling larger fonts are not usable
@c for editing, and scaling a smaller font is not useful because it is
@c better to use the smaller font in its own size, which Emacs does.
$B$3$l$K2C$($F!"$$$/$D$+O"B3$7$?%U%#!<%k%I$,%o%$%k%I%+!<%I$G$"$k$J$i!"(B
Emacs$B$O$=$l$i$r(B1$B$D$N%o%$%k%I%+!<%I$K$^$H$a$^$9!#(B
$B$3$l$O!"<+F0E*$K3HBg=L>.$7$?%U%)%s%H$N;HMQ$rHr$1$k$?$a$G$9!#(B
$BBg$-$a$N%U%)%s%H$r=L>.$7$?%U%)%s%H$OJT=8$K$O;H$($^$;$s!#(B
$B$^$?!">.$5$a$N%U%)%s%H$r3HBg$7$?%U%)%s%H$bM-MQ$G$O$"$j$^$;$s!#(B
$B$H$$$&$N$O!"(BEmacs$B$,$=$&$9$k$h$&$K!"(B
$B$b$H$b$H>.$5$J%U%)%s%H$r;H$&$[$&$,$h$$$+$i$G$9!#(B
@c Thus if @var{fontpattern} is this,
$B$7$?$,$C$F!"(B@var{fontpattern}$B$,$D$.$N$h$&$G$"$k$H!"(B
@example
-*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24
@end example
@noindent
@c the font specification for ASCII characters would be this:
ASCII$BJ8;z$KBP$9$k%U%)%s%H;XDj$O$D$.$N$h$&$K$J$j$^$9!#(B
@example
-*-fixed-medium-r-normal-*-24-*-ISO8859-1
@end example
@noindent
@c and the font specification for Chinese GB2312 characters would be this:
$B$^$?!"(BChinese GB2312$BJ8;z$KBP$9$k%U%)%s%H;XDj$O$D$.$N$h$&$K$J$j$^$9!#(B
@example
-*-fixed-medium-r-normal-*-24-*-gb2312*-*
@end example
@c You may not have any Chinese font matching the above font
@c specification. Most X distributions include only Chinese fonts that
@c have @samp{song ti} or @samp{fangsong ti} in the @var{family} field. In
@c such a case, @samp{Fontset-@var{n}} can be specified as below:
$B>e$N%U%)%s%H;XDj$K0lCW$9$kCf9q8l%U%)%s%H$,$J$$$+$b$7$l$^$;$s!#(B
$BB?$/$N(BX$B$NG[I[$K$O!"(B@var{family}$B%U%#!<%k%I$,(B
@samp{song ti}$B$+(B@samp{fangsong ti}$B$NCf9q8l%U%)%s%H$@$1$,4^$^$l$F$$$^$9!#(B
$B$=$&$$$C$?>l9g!"(B@samp{Fontset-@var{n}}$B$r$D$.$N$h$&$K;XDj$7$^$9!#(B
@smallexample
Emacs.Fontset-0: -*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24,\
chinese-gb2312:-*-*-medium-r-normal-*-24-*-gb2312*-*
@end smallexample
@noindent
@c Then, the font specifications for all but Chinese GB2312 characters have
@c @samp{fixed} in the @var{family} field, and the font specification for
@c Chinese GB2312 characters has a wild card @samp{*} in the @var{family}
@c field.
$B$=$&$9$k$H!"(BChinese GB2312$B$NJ8;z$r=|$/%U%)%s%H;XDj$G$O(B
@var{family}$B%U%#!<%k%I$,(B@samp{fixed}$B$H$J$j!"(B
Chinese GB2312$B$NJ8;z$KBP$9$k%U%)%s%H;XDj$G$O(B
@var{family}$B%U%#!<%k%I$,(B@samp{*}$B$H$J$j$^$9!#(B
@node Color Names
@c @section Color Names
@section $BI=<(?'L>(B
@defun x-color-defined-p color &optional frame
@c This function reports whether a color name is meaningful. It returns
@c @code{t} if so; otherwise, @code{nil}. The argument @var{frame} says
@c which frame's display to ask about; if @var{frame} is omitted or
@c @code{nil}, the selected frame is used.
$B$3$N4X?t$O!"I=<(?'L>$,0UL#$N$"$k$b$N$+$I$&$+$rJs9p$9$k!#(B
$B0UL#$,$"$l$P(B@code{t}$B$rJV$7!"$5$b$J$1$l$P(B@code{nil}$B$rJV$9!#(B
$B0z?t(B@var{frame}$B$O!"$I$N%U%l!<%`$GD4$Y$k$+$r;XDj$9$k!#(B
@var{frame}$B$r>JN,$7$?$j(B@code{nil}$B$G$"$k$H!"A*Br$5$l$F$$$k%U%l!<%`$r;H$&!#(B
@c Note that this does not tell you whether the display you are using
@c really supports that color. You can ask for any defined color on any
@c kind of display, and you will get some result---that is how the X server
@c works. Here's an approximate way to test whether your display supports
@c the color @var{color}:
$B$3$N4X?t$G$O!"FI<T$,;HMQ$7$F$$$k%G%#%9%W%l%$$G(B
$BEv3:I=<(?'$r<B:]$KI=<($G$-$k$+$I$&$+$O$o$+$i$J$$!#(B
$B$I$s$J<oN`$N%G%#%9%W%l%$$G$bDj5A$5$l$F$$$l$P$I$s$JI=<(?'$G$b(B
$BLd$$9g$o$;$k$3$H$,$G$-!"$J$s$i$+$N7k2L$rF@$i$l$k!#(B
X$B%5!<%P!<$O$3$N$h$&$KF0:n$9$k$N$G$"$k!#(B
$BFI<T$N%G%#%9%W%l%$$GI=<(?'(B@var{color}$B$r;H$($k$+$I$&$+$r(B
$B8!::$9$k6a;wJ}K!$O$D$.$N$H$*$j$G$"$k!#(B
@example
(defun x-color-supported-p (color &optional frame)
(and (x-color-defined-p color frame)
(or (x-display-color-p frame)
(member color '("black" "white"))
(and (> (x-display-planes frame) 1)
(equal color "gray")))))
@end example
@end defun
@defun x-color-values color &optional frame
@c This function returns a value that describes what @var{color} should
@c ideally look like. If @var{color} is defined, the value is a list of
@c three integers, which give the amount of red, the amount of green, and
@c the amount of blue. Each integer ranges in principle from 0 to 65535,
@c but in practice no value seems to be above 65280. If @var{color} is not
@c defined, the value is @code{nil}.
$B$3$N4X?t$O!"I=<(?'(B@var{color}$B$,M}A[E*$K$O$I$N$h$&$K8+$($k$+$r5-=R$7$?CM$rJV$9!#(B
@var{color}$B$,Dj5A$5$l$F$$$l$P!"$=$NCM$O!"@V$NJ,NL!"NP$NJ,NL!"@D$NJ,NL$rI=$9(B
3$B$D$N@0?t$N%j%9%H$G$"$k!#(B
$B3F@0?t$NHO0O$O86M}E*$K$O(B0$B$+$i(B65535$B$G$"$k$,!"(B
$B<B:]$K$O(B65280$B$rD6$($k$3$H$O$J$$$h$&$G$"$k!#(B
@var{color}$B$,Dj5A$5$l$F$$$J$1$l$P!"CM$O(B@code{nil}$B$G$"$k!#(B
@example
(x-color-values "black")
@result{} (0 0 0)
(x-color-values "white")
@result{} (65280 65280 65280)
(x-color-values "red")
@result{} (65280 0 0)
(x-color-values "pink")
@result{} (65280 49152 51968)
(x-color-values "hungry")
@result{} nil
@end example
@c The color values are returned for @var{frame}'s display. If @var{frame}
@c is omitted or @code{nil}, the information is returned for the selected
@c frame's display.
$B%U%l!<%`(B@var{frame}$B$N%G%#%9%W%l%$$KBP$9$kI=<(?'$NCM$rJV$9!#(B
@var{frame}$B$r>JN,$7$?$j(B@code{nil}$B$G$"$k$H!"(B
$BA*Br$5$l$F$$$k%U%l!<%`$N%G%#%9%W%l%$$KBP$9$kCM$rJV$9!#(B
@end defun
@node Resources
@c @section X Resources
@section X$B%j%=!<%9(B
@defun x-get-resource attribute class &optional component subclass
@c The function @code{x-get-resource} retrieves a resource value from the X
@c Windows defaults database.
$B4X?t(B@code{x-get-resource}$B$O!"(B
X$B%&%#%s%I%&$N%G%U%)%k%H$N%G!<%?%Y!<%9$+$i%j%=!<%9$NCM$r<h$j=P$9!#(B
@c Resources are indexed by a combination of a @dfn{key} and a @dfn{class}.
@c This function searches using a key of the form
@c @samp{@var{instance}.@var{attribute}} (where @var{instance} is the name
@c under which Emacs was invoked), and using @samp{Emacs.@var{class}} as
@c the class.
$B%j%=!<%9$O!"(B@dfn{key}$B$H(B@dfn{class}$B$NAH$_9g$o$;$GE:;zIU$1$5$l$k!#(B
$B$3$N4X?t$O(B@samp{@var{instance}.@var{attribute}}$B$N7A(B
$B!J(B@var{instance}$B$O(BEmacs$B$r5/F0$7$?L>A0!K$N%-!<$H(B
$B%/%i%9$H$7$F(B@samp{Emacs.@var{class}}$B$r;H$C$FC5:w$9$k!#(B
@c The optional arguments @var{component} and @var{subclass} add to the key
@c and the class, respectively. You must specify both of them or neither.
@c If you specify them, the key is
@c @samp{@var{instance}.@var{component}.@var{attribute}}, and the class is
@c @samp{Emacs.@var{class}.@var{subclass}}.
$B>JN,2DG=$J0z?t(B@var{component}$B$H(B@var{subclass}$B$O!"$=$l$>$l!"(B
$B%-!<$H%/%i%9$KDI2C$5$l$k!#(B
2$B$D$r;XDj$9$k$+$^$C$?$/;XDj$7$J$$$3$H!#(B
$B$3$l$i$r;XDj$9$k$H!"(B
$B%-!<$O(B@samp{@var{instance}.@var{component}.@var{attribute}}$B$G$"$j!"(B
$B%/%i%9$O(B@samp{Emacs.@var{class}.@var{subclass}}$B$G$"$k!#(B
@end defun
@defvar x-resource-class
@c This variable specifies the application name that @code{x-get-resource}
@c should look up. The default value is @code{"Emacs"}. You can examine X
@c resources for application names other than ``Emacs'' by binding this
@c variable to some other string, around a call to @code{x-get-resource}.
$B$3$NJQ?t$O!"(B@code{x-get-resource}$B$,C5$9%"%W%j%1!<%7%g%sL>$r;XDj$9$k!#(B
$B%G%U%)%k%HCM$O(B@code{"Emacs"}$B$G$"$k!#(B
@code{x-get-resource}$B$r8F$S=P$9<~$j$G$3$NJQ?t$KJL$NJ8;zNs$rB+G{$9$l$P!"(B
$B!X(BEmacs$B!Y0J30$N%"%W%j%1!<%7%g%sL>$G(BX$B%j%=!<%9$rC5$;$k!#(B
@end defvar
@c @xref{Resources X,, X Resources, emacs, The GNU Emacs Manual}.
@xref{Resources X,, X$B%j%=!<%9(B, emacs, GNU Emacs $B%^%K%e%"%k(B}$B!#(B
@node Server Data
@c @section Data about the X Server
@section X$B%5!<%P!<$K4X$9$k%G!<%?(B
@c This section describes functions you can use to get information about
@c the capabilities and origin of an X display that Emacs is using. Each
@c of these functions lets you specify the display you are interested in:
@c the @var{display} argument can be either a display name, or a frame
@c (meaning use the display that frame is on). If you omit the
@c @var{display} argument, or specify @code{nil}, that means to use the
@c selected frame's display.
$BK\@a$G$O!"(BEmacs$B$,;H$C$F$$$k(BX$B%G%#%9%W%l%$$NG=NO$d@=B$85$K4X$9$k>pJs$r(B
$BF@$k$?$a$K;H$&4X?t$K$D$$$F=R$Y$^$9!#(B
$B$3$l$i$N4X?t$N$=$l$>$l$K$O!"$I$N%G%#%9%W%l%$$rBP>]$K$9$k$+(B
$B0z?t(B@var{display}$B$G;XDj$G$-$^$9!#(B
$B0z?t(B@var{display}$B$O!"%G%#%9%W%l%$L>$+(B
$B%U%l!<%`!J$,I=<($5$l$$$k%G%#%9%W%l%$$r0UL#$9$k!K$N$$$:$l$+$G$9!#(B
$B0z?t(B@var{display}$B$r>JN,$7$?$j(B@code{nil}$B$G$"$k$H!"(B
$BA*Br$5$l$F$$$k%U%l!<%`$N%G%#%9%W%l%$$r;H$&$3$H$r0UL#$7$^$9!#(B
@defun x-display-screens &optional display
@c This function returns the number of screens associated with the display.
$B$3$N4X?t$O!"%G%#%9%W%l%$$KBP1~IU$1$i$l$F$$$k%9%/%j!<%s$N8D?t$rJV$9!#(B
@end defun
@defun x-server-version &optional display
@c This function returns the list of version numbers of the X server
@c running the display.
$B$3$N4X?t$O!"%G%#%9%W%l%$$GF0:nCf$N(BX$B%5!<%P!<$NHGHV9f$N%j%9%H$rJV$9!#(B
@end defun
@defun x-server-vendor &optional display
@c This function returns the vendor that provided the X server software.
$B$3$N4X?t$O!"(BX$B%5!<%P!<%=%U%H%&%'%"$NDs6!6H<T$rJV$9!#(B
@end defun
@defun x-display-pixel-height &optional display
@c This function returns the height of the screen in pixels.
$B$3$N4X?t$O%9%/%j!<%s$N%T%/%;%kC10L$N9b$5$rJV$9!#(B
@end defun
@defun x-display-mm-height &optional display
@c This function returns the height of the screen in millimeters.
$B$3$N4X?t$O%9%/%j!<%s$N%_%j%a!<%H%kC10L$N9b$5$rJV$9!#(B
@end defun
@defun x-display-pixel-width &optional display
@c This function returns the width of the screen in pixels.
$B$3$N4X?t$O%9%/%j!<%s$N%T%/%;%kC10L$NI}$rJV$9!#(B
@end defun
@defun x-display-mm-width &optional display
@c This function returns the width of the screen in millimeters.
$B$3$N4X?t$O%9%/%j!<%s$N%_%j%a!<%H%kC10L$NI}$rJV$9!#(B
@end defun
@defun x-display-backing-store &optional display
@c This function returns the backing store capability of the screen.
@c Values can be the symbols @code{always}, @code{when-mapped}, or
@c @code{not-useful}.
$B$3$N4X?t$O!"%9%/%j!<%s$N%P%C%-%s%0%9%H%"5!G=$rJV$9!#(B
$B$=$NCM$O!"(B@code{always}$B!"(B@code{when-mapped}$B!"(B@code{not-useful}$B$N%7%s%\%k$N(B
$B$$$:$l$+$G$"$k!#(B
@end defun
@defun x-display-save-under &optional display
@c This function returns non-@code{nil} if the display supports the
@c SaveUnder feature.
$B$3$N4X?t$O!"%G%#%9%W%l%$$K%;!<%V%"%s%@!<5!G=$,$"$l$P(B@code{nil}$B0J30$rJV$9!#(B
@end defun
@defun x-display-planes &optional display
@c This function returns the number of planes the display supports.
$B$3$N4X?t$O!"%G%#%9%W%l%$$N%W%l%$%s?t$rJV$9!#(B
@end defun
@defun x-display-visual-class &optional display
@c This function returns the visual class for the screen. The value is one
@c of the symbols @code{static-gray}, @code{gray-scale},
@c @code{static-color}, @code{pseudo-color}, @code{true-color}, and
@c @code{direct-color}.
$B$3$N4X?t$O!"%9%/%j!<%s$N%S%8%e%"%k%/%i%9$rJV$9!#(B
$B$=$NCM$O!"(B@code{static-gray}$B!"(B@code{gray-scale}$B!"(B
@code{static-color}$B!"(B@code{pseudo-color}$B!"(B@code{true-color}$B!"(B
@code{direct-color}$B$N%7%s%\%k$N$$$:$l$+$G$"$k!#(B
@end defun
@defun x-display-grayscale-p &optional display
@c This function returns @code{t} if the screen can display shades of gray.
$B$3$N4X?t$O!"%9%/%j!<%s$GGr9u$NG;C8$rI=<($G$-$k$H(B@code{t}$B$rJV$9!#(B
@end defun
@defun x-display-color-p &optional display
@c This function returns @code{t} if the screen is a color screen.
$B$3$N4X?t$O!"%9%/%j!<%s$,%+%i!<%9%/%j!<%s$J$i$P(B@code{t}$B$rJV$9!#(B
@end defun
@defun x-display-color-cells &optional display
@c This function returns the number of color cells the screen supports.
$B$3$N4X?t$O%9%/%j!<%s$G;H$($k%+%i!<%;%k$N8D?t$rJV$9!#(B
@end defun
@ignore
@defvar x-no-window-manager
This variable's value is @code{t} if no X window manager is in use.
@end defvar
@end ignore
@ignore
@item
The functions @code{x-pixel-width} and @code{x-pixel-height} return the
width and height of an X Window frame, measured in pixels.
@end ignore
|