Source

edit-utils / edit-utils.texi

Full commit
   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
@c -*-texinfo-*-
@c This is part of the XEmacs Lisp Reference Manual.
@c Copyright (C) 2002 Free Software Foundation, Inc.
@c @setfilename edit-utils.info
@ifinfo
@dircategory XEmacs Editor
@direntry
* Edit Utilities: (edit-utils).	Editing utilities for XEmacs.
@end direntry
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission notice
identical to this one except for the removal of this paragraph (this
paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation
approved by the Foundation.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled ``GNU General Public License'' is included exactly as
in the original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that the section entitled ``GNU General Public License'' may be
included in a translation approved by the Free Software Foundation
instead of in the original English.
@end ifinfo

@node Top, Comparing Windows, (dir), (dir)
@chapter The Editing Utilities Package

@ifinfo
This Info file contains the manual for the Editing Utilities package.
@end ifinfo

Nodes whose menu description consists only of a file name are completely
undocumented.  Even a 40 character description for the menu and a brief
50--100 word summary of the functionality for the actual node would be
greatly appreciated.  Some of the node names may be inaccurate;
corrections are also appreciated.

@menu
Buffer and Window Management
* Comparing Windows::		Compare text between windows
* Detached Minibuffers::	Support a detached minibuffer
* Convenient Buffer Switching::	Switch between buffers using substrings
* Permanent Buffers::		Permanent buffers management
* Self-Resizing Minibuffer::	Dynamically resize minibuffer
* Searching Many Buffers::	Searching REGEXP in all buffers
* Meaningful Unique Names::	Unique buffer names dependent on file name
* Navigating the Window Ring::	Window configuration rings
* Reverting Buffers::           Revert buffers when files on disk change

File Management
* Backup Directory::	        backup-dir.el

Session Management
* Bookmark::			bookmark.el
* Desktop::			desktop.el
* Recent File Navigation::	recent-files.el
* Resume::			resume.el
* Save Configuration::		saveconf.el
* Save History::		savehist.el
* Save Places::			saveplace.el
* Where Was I::			where-was-i-db.el

Abbreviations
* Abbreviation List::		abbrevlist.el
* Big Menubar::			big-menubar.el
* Completion::			completion.el
* Dynamic Abbreviations::	dabbrev.el
* Hippie Expand::		hippie-exp.el
* Interactive Completion::	icomplete.el
* Template Insertion::		tempo.el

Miscellaneous and Unknown:
* file-part::			file-part.el
* Flow Control::		flow-ctrl.el
* Foldout::			foldout.el
* Function Menu::		func-menu.el
* id-select::			id-select.el
* info-look::			info-look.el
* Live Icon::			live-icon.el
* makesum::			makesum.el
* man::				man.el
* mode-motion+::		mode-motion+.el
* outl-mouse::			outl-mouse.el
* page-ext::			page-ext.el
* popper::			popper.el
* Power Macros::		Keyboard macros made easy
* Redo::			redo.el
* reportmail::			reportmail.el
* Scrolling In Place::		scroll-in-place.el
* Line Numbering::		setnu.el
* Vertical Mode::		vertical-mode.el
* Align::                       Align text to a specific column, by regexp
* Allout::                      Extensive outline mode

Display, Faces, and Highlighting:
* Balloon Help and Tooltips::	balloon-help.el
* Getting the Mouse Out of the Way::	avoid.el
* Blinking Cursor::		blink-cursor.el
* Blinking Parentheses::	blink-paren.el
* Face Editor::			edit-faces.el
* Speeding Up Fontlock::	fast-lock.el
* Lazy Fontlocking::		lazy-lock.el
* Another Lazy Fontlocker::	lazy-shot.el
* lispm-fonts::			lispm-fonts.el
* mic-paren::			mic-paren.el
* paren::			paren.el
* shell-font::			shell-font.el

Low-Level Editing Hacks:
* Hooks Invoked After Saving::	after-save-commands.el
* Indivisible Blocks of Text::	atomic-extents.el
* Table and Array Editor::	array.el

Menu and Toolbar Support:
* Floating Toolbar::		floating-toolbar.el
* tree-menu::			tree-menu.el
* The Toolbar Utilities::	Creating and managing toolbars and buttons.

Appendices:
* Copying::			The GNU General Public License
@end menu

@node Comparing Windows, Detached Minibuffers, Top, Top
@chapter Comparing Windows

This package provides one entry point, compare-windows.  It compares text
starting from point in two adjacent windows, advancing point until it finds a
difference.  Option variables permit you to ignore whitespace differences, or
case differences, or both.

@node Detached Minibuffers, Convenient Buffer Switching, Comparing Windows, Top
@chapter Detached Minibuffers

This package creates a standalone minibuffer in its own frame.

To configure this package, type:

@example
M-x customize-group RET detached-minibuf RET
@end example

@node Convenient Buffer Switching, Permanent Buffers, Detached Minibuffers, Top
@chapter Convenient Buffer Switching

To install this package on the default keys used for buffer switching, type:

@example
M-x iswitchb-default-keybindings RET
@end example

With this package installed, as you type in a substring, the list of buffers
currently matching the substring are displayed as you type.  The list is
ordered so that the most recent buffers visited come at the start of the
list.  The buffer at the start of the list will be the one visited when you
press return.  By typing more of the substring, the list is narrowed down so
that gradually the buffer you want will be at the top of the list.
Alternatively, you can use @kbd{C-s} and @kbd{C-r} to rotate buffer names in
the list until the one you want is at the top of the list.  Completion is
also available so that you can see what is common to all of the matching
buffers as you type.

For example, let's say we have two buffers called "123456" and "123", with
"123456" the most recent. When I use @samp{iswitchb}, I first of all get
presented with the list of all the buffers

@samp{iswitch @{123456,123@}}

If I then press @kbd{2}:

@samp{iswitch 2[3]@{123456,123@}}

The list in @{@} are the matching buffers, most recent first (buffers visible
in the current frame are put at the end of the list by default).  At any time
I can select the item at the head of the list by pressing @kbd{RET}.  I can
also bring the put the first element at the end of the list by pressing
@kbd{C-s}, or put the last element at the head of the list by pressing
@kbd{C-r}.  The item in [] indicates what can be added to my input by
pressing @kbd{TAB}.  In this case, I will get @samp{3} added to my input.
So, press @kbd{TAB}:

@samp{iswitch 23@{123456,123@}}

At this point, I still have two matching buffers.  If I want the first buffer
in the list, I simply press @kbd{RET}.  If I wanted the second in the list, I
could press @kbd{C-s} to move it to the top of the list and then @kbd{RET} to
select it.

However, If I type @kbd{4}, I only have one match left:

@samp{iswitch 234[123456] [Matched]}

Since there is only one matching buffer left, it is given in @samp{[]} and we
see the text @samp{[Matched]} afterwards.  I can now press @kbd{TAB} or
@kbd{RET} to go to that buffer.

If however, I now type @kbd{a}:

@samp{iswitch 234a [No match]}

There are no matching buffers.  If I press @kbd{RET} or @kbd{TAB}, I can be
prompted to create a new buffer called "234a".

Of course, where this function comes in really useful is when you can specify
the buffer using only a few keystrokes.  In the above example, the quickest
way to get to the "123456" buffer would be just to type @kbd{4} and then
@kbd{RET} (assuming there isn't any newer buffer with "4" in its name).

To see a full list of all matching buffers in a separate buffer, hit @kbd{?}
or press @kbd{TAB} when there are no further completions to the substring.
Repeated @kbd{TAB} presses will scroll you through this separate buffer.

The buffer at the head of the list can be killed by pressing @kbd{C-k}.  If
the buffer needs saving, you will be queried before the buffer is killed.

If you find that the file you are after is not in a buffer, you can press
@kbd{C-x C-f} to immediately drop into find-file.

To see the doc string of iswitchb for full keybindings and features, type:

@example
M-x describe-function RET iswitchb
@end example

@menu
* Customization::
* Changing the Display::
* Regexp Matching::
* Replacement for read-buffer::
@end menu

@node Customization, Changing the Display, Convenient Buffer Switching, Convenient Buffer Switching
@section Customization

To configure the package, type:

@example
M-x customize-group RET iswitchb RET
@end example

To modify the default keybindings, use the hook provided.  For example, the
following code can be added to your .emacs file:

@example
(add-hook 'iswitchb-define-mode-map-hook 'iswitchb-my-keys)

(defun iswitchb-my-keys ()
  "Add my keybindings for iswitchb."
  (define-key iswitchb-mode-map " " 'iswitchb-next-match)
  )
@end example

@node Changing the Display, Regexp Matching, Customization, Convenient Buffer Switching
@section Changing the Display

If you have many matching buffers, they may not all fit onto one line of the
minibuffer.  In this case, you should use rsz-mini (resize-minibuffer-mode).
You can also limit iswitchb so that it only shows a certain number of lines.
To do this, see the documentation for @code{iswitchb-minibuffer-setup-hook}.

By default, the list of current buffers is most recent first, oldest last,
with the exception that the buffers visible in the current frame are put at
the end of the list.  A hook exists to allow other functions to order the
list.  For example, if you add:

@example
(add-hook 'iswitchb-make-buflist-hook 'iswitchb-summaries-to-end)
@end example

then all buffers matching "Summary" are moved to the end of the list.  (I
find this handy for keeping the INBOX Summary and so on out of the way.)  It
also moves buffers matching "output\*$" to the end of the list (these are
created by AUC TeX when compiling.)  Other functions could be made available
which alter the list of matching buffers (either deleting or rearranging
elements.)

If you have font-lock loaded, the first matching buffer is highlighted.  To
switch this off, set @code{(setq iswitchb-use-fonts nil)}. I don't use
font-lock that much, so I've hardcoded the faces.  If this is too harsh, let
me know.  Colouring of the matching buffer name was suggested by Carsten
Dominik (dominik@@strw.leidenuniv.nl)

@node Regexp Matching, Replacement for read-buffer, Changing the Display, Convenient Buffer Switching
@section Regexp Matching

There is limited provision for regexp matching within iswitchb, enabled
through @code{iswitchb-regexp}.  This allows you to type @kbd{c$} for example
and see all buffer names ending in `c'.  This facility is quite limited
though in two respects.  First, you can't currently type in expressions like
`[0-9]' directly -- you have to type them in when @code{iswitchb-regexp} is
@code{nil} and then toggle on the regexp functionality.  Likewise, don't
enter an expression containing `\' in regexp mode.  If you try, iswitchb gets
confused, so just hit @kbd{C-g} and try again.  Secondly, no completion
mechanism is currently offered when regexp searching.

@node Replacement for read-buffer,  , Regexp Matching, Convenient Buffer Switching
@section Replacement for read-buffer

iswitchb-read-buffer has been written to be a drop in replacement for the
normal buffer selection routine @code{read-buffer}.  To use iswitch for all
buffer selections in Emacs, add: @code{(setq read-buffer-function
'iswitchb-read-buffer)} (This variable should be present in Emacs 20.3+)
XEmacs users can get the same behaviour by doing: @code{(defalias
'read-buffer 'iswitchb-read-buffer)} since @code{read-buffer} is defined in
lisp.

@node Permanent Buffers, Self-Resizing Minibuffer, Convenient Buffer Switching, Top
@chapter Permanent Buffers

A permanent buffer is a buffer that you don't want to kill, mainly used for
testing or temporary stuff. The *scratch* buffer is the most famous example
of what could be a permanent buffer. This package allows you to define
several permanent buffers (the scratch buffer can be one of them) that will
never disappear. If you kill them or save their contents, they will be
regenerated. You can also specify a set of lisp forms to eval in the buffer
when it is (re)generated.

This package is implemented in a minor-mode fashion. You can customize the
default value of @code{permanent-buffers-mode} or use
@code{turn-on-permanent-buffers} at startup. Within an XEmacs session, use
@code{permanent-buffers-mode} or @code{turn-o[n|ff]-permanent-buffers}. You
might also want to customize @code{permanent-buffers-alist}.

To configure this package, type:

@example
M-x customize-group RET permanent-buffers RET
@end example

@node Self-Resizing Minibuffer, Searching Many Buffers, Permanent Buffers, Top
@chapter Self-Resizing Minibuffer

This package allows the entire contents (or as much as possible) of the
minibuffer to be visible at once when typing.  As the end of a line is
reached, the minibuffer will resize itself.  When the user is done typing,
the minibuffer will return to its original size.

In window systems where it is possible to have a frame in which the
minibuffer is the only window, the frame itself can be resized.

Note that the minibuffer and echo area are not the same!  They simply happen
to occupy roughly the same place on the frame.  Messages put in the echo area
will not cause any resizing by this package.

This package is considered a minor mode but it doesn't put anything in
minor-mode-alist because this mode is specific to the minibuffer, which has
no modeline.

To invoke this mode, type 

@example
M-x resize-minibuffer-mode RET
@end example

To configure this package, type:

@example
M-x customize-group RET resize-minibuffer RET
@end example

@node Searching Many Buffers, Meaningful Unique Names, Self-Resizing Minibuffer, Top
@chapter Searching Many Buffers

This package searchs all live buffers for REGEXP and presents matching lines
in a separate buffer with hyperlinks to their occurences.

After creating countless buffers in an XEmacs session, the user can execute
the following:

@example
M-x list-matches-in-buffers RET \<problem\> RET .* RET
@end example

to find all matches of the single word "problem" in any of them.  The result
is presented in a buffer named "*Matches for "\<problem\>" in buffers*" with
hyperlinks to any occurence.  User may navigate to the next (@kbd{n}) or
previous (@kbd{p}) match.

@node Meaningful Unique Names, Navigating the Window Ring, Searching Many Buffers, Top
@chapter Meaningful Unique Names

Emacs' standard method for making buffer names unique adds <2>, <3>, etc. to
the end of (all but one of) the buffers.  This file replaces that behavior,
for buffers visiting files and dired buffers, with a uniquification that adds
parts of the file name until the buffer names are unique.  For instance,
buffers visiting @file{/u/mernst/tmp/Makefile} and
@file{/usr/projects/zaphod/Makefile} would be named @samp{Makefile|tmp} and
@samp{Makefile|zaphod}, respectively (instead of @samp{Makefile} and
@samp{Makefile<2>}).  Other buffer name styles are also available.

To configure this package, type:

@example
M-x customize-group RET uniquify RET
@end example

@node Navigating the Window Ring, Reverting Buffers, Meaningful Unique Names, Top
@chapter Navigating the Window Ring

This package provides lightweight support for circular rings of window
configurations.  A window configuration is the layout of windows and
associated buffers within a frame.  There is always at least one
configuration on the ring, the current configuration.  You can create new
configurations and cycle through the layouts in either direction.  You can
also delete configurations from the ring (except the last one of course!).
Window configurations are named, and you can jump to and delete named
configurations.

Window configuration rings are frame specific.  That is, each frame has its
own ring which can be cycled through independently of other frames.

You are always looking at the current window configuration for each frame,
which consists of the windows in the frame, the buffers in those windows, and
point in the current buffer.  As you run commands such as @kbd{C-x 4 b},
@kbd{C-x 2}, and @kbd{C-x 0} you are modifying the current window
configuration.  When you jump to a new configuration, the layout that existed
before the jump is captured, and the ring is rotated to the selected
configuration.  Window configurations are captured with
@code{current-window-configuration}, however winring also saves point for the
current buffer.

To use, add the following to your .emacs file:

@example
(winring-initialize)
@end example

Note that by default, this binds the winring keymap to the @kbd{C-x 7}
prefix, but you can change this by setting the value of
@code{winring-keymap-prefix}, before you call @code{winring-initialize}.

The following commands are defined:

@table @kbd

@item C-x 7 n 

Create a new window configuration.  The new configuration will contain a
single buffer, the one named in the variable
@code{winring-new-config-buffer-name}.

With @kbd{C-u}, winring prompts for the name of the new configuration.  If
you don't use @kbd{C-u} the function in @code{winring-name-generator} will be
called to get the new configuration's name.

@item C-x 7 2 

Create a duplicate of the current window configuration.  C-u
has the same semantics as with @kbd{C-x 7 c}.

@item C-x 7 j 

Jump to a named configuration (prompts for the name).

@item C-x 7 0

Kill the current window configuration and rotate to the previous layout on
the ring.  You cannot delete the last configuration in the ring.  With
@kbd{C-u}, prompts for the name of the configuration to kill.

@item C-x 7 o

Go to the next configuration on the ring.

@item C-x 7 p

Go to the previous configuration on the ring.

Note that the sequence `C-x 7 o C-x 7 p' is a no-op; it leaves you in the
same configuration you were in before the sequence.

@item C-x 7 r

Rename the current window configuration.

@item C-x 7 b

Submit a bug report on winring.

@item C-x 7 v

Echo the winring version.

@end table

As mentioned, window configuration names can be displayed in the modeline.
The default value of @code{winring-show-names} is currently @code{nil} by
default. Set it to @code{t} to activate.  If you don't like the position in
the modeline where winring names are shown, you can change this by passing in
your own modeline hacker function to @code{winring-initialize}.

@menu
* History::
* Related Packages::
@end menu

@node History, Related Packages, Navigating the Window Ring, Navigating the Window Ring
@section History

A long long time ago there was a package called `wicos' written by Heikki
Suopanki, which was based on yet another earlier package called `screens'
also written by Suopanki.  This in turn was based on the Unix tty session
manager `screen' (unrelated to Emacs) by Oliver Laumann, Juergen Weigert, and
Michael Schroeder.

Wicos essentially provided fancy handling for window configurations.  I liked
the basic ideas, but wicos broke with later versions of Emacs and XEmacs.  I
re-implemented just the functionality I wanted, simplifying things in the
process, and porting the code to run with XEmacs 19 and 20, and Emacs 20 (I
don't know if winring works in Emacs 19.34).

Wicos used the M-o prefix which I've recently changed to C-x 7 as the
default, by suggestion of RMS.  Wicos also had some support for multiple
frames, and saving configurations on all visible frames, but it didn't work
too well, and I like frame independent rings better.

@node Related Packages,  , History, Navigating the Window Ring
@section Related Packages

I know of a few other related packages:

@itemize @bullet

@item

`escreen' by Noah Friedman.  A much more ambitious package that does Emacs
window session management.  Very cool, but I wanted something more
lightweight.

@item 

`wconfig' by Bob Weiner as part of Hyperbole.  I think wconfig is similar in
spirit to winring; it seems to have also have named window configurations,
but not frame-specific window rings.

@item

`winner' by Ivar Rummelhoff.  This package comes with Emacs 20, and appears
to differ from winring by providing undo/redo semantics to window
configuration changes.  winner is a minor mode and does seem to support
frame-specific window rings.

@item

window-xemacs' by the XEmacs Development Team.  It appears that this package,
which is specific to XEmacs (and perhaps just XEmacs 20) implements stacks of
window configurations which are frame independent.

@end itemize

Please feel free to email me if my rendition of history, or my
explanation of the related packages, is inaccurate.

@node Reverting Buffers, Backup Directory, Navigating the Window Ring, Top
@chapter Reverting Buffers

Whenever a file that Emacs is editing has been changed by another program the
user normally has to execute the command `revert-buffer' to load the new
content of the file into Emacs.

This package is defined in autorevert.el and contains two minor modes: Global
Auto-Revert Mode and Auto-Revert Mode.  Both modes automatically revert
buffers whenever the corresponding files have been changed on disk.

Auto-Revert Mode can be activated for individual buffers.  Global Auto-Revert
Mode applies to all file buffers.

Both modes operate by checking the time stamp of all files at intervals of
`auto-revert-interval'.  The default is every five seconds.  The check is
aborted whenever the user actually uses Emacs.  You should never even notice
that this package is active (except that your buffers will be reverted, of
course).

@menu
* Auto-Revert Usage::		How to use the package.
@end menu

@node Auto-Revert Usage,  , Reverting Buffers, Reverting Buffers
@section Auto-Revert Usage

To configure the package, type:

@example
M-x customize-group RET auto-revert RET
@end example

To activate Auto-Revert for a specific buffer, go to the buffer and type:

@example
  M-x auto-revert-mode RET
@end example

To activate Global Auto-Revert Mode, type:

@example
  M-x global-auto-revert-mode RET
@end example

To activate Global Auto-Revert Mode every time Emacs is started customize the
option `global-auto-revert-mode' or the following line could be added to your
~/.emacs:

@example
  (global-auto-revert-mode 1)
@end example

The function `turn-on-auto-revert-mode' could be added to any major mode hook
to activate Auto-Revert Mode for all buffers in that mode.  For example, the
following line will activate Auto-Revert Mode in all C mode buffers:

@example
  (add-hook 'c-mode-hook 'turn-on-auto-revert-mode)
@end example

@node Backup Directory, Bookmark, Reverting Buffers, Top
@chapter Backup Directory

This library not documented.  Please contribute!

@node Bookmark, Desktop, Backup Directory, Top
@chapter Bookmark

This library not documented.  Please contribute!

@node Desktop, Recent File Navigation, Bookmark, Top
@chapter Desktop

This library not documented.  Please contribute!

@node Recent File Navigation, Resume, Desktop, Top
@chapter Recent File Navigation

This library not documented.  Please contribute!

@node Resume, Save Configuration, Recent File Navigation, Top
@chapter Resume

This library not documented.  Please contribute!

@node Save Configuration, Save History, Resume, Top
@chapter Save Configuration

This library not documented.  Please contribute!

@node Save History, Save Places, Save Configuration, Top
@chapter Save History

This library not documented.  Please contribute!

@node Save Places, Where Was I, Save History, Top
@chapter Save Places

This library not documented.  Please contribute!

@node Where Was I, Abbreviation List, Save Places, Top
@chapter Where Was I

This library not documented.  Please contribute!

@node Abbreviation List, Big Menubar, Where Was I, Top
@chapter Abbreviation List

This library not documented.  Please contribute!

@node Big Menubar, Completion, Abbreviation List, Top
@chapter Big Menubar

This library not documented.  Please contribute!

@node Completion, Dynamic Abbreviations, Big Menubar, Top
@chapter Completion

This library not documented.  Please contribute!

@node Dynamic Abbreviations, Hippie Expand, Completion, Top
@chapter Dynamic Abbreviations

This library not documented.  Please contribute!

@node Hippie Expand, Interactive Completion, Dynamic Abbreviations, Top
@chapter Hippie Expand

This library not documented.  Please contribute!

@node Interactive Completion, Template Insertion, Hippie Expand, Top
@chapter Interactive Completion

This library not documented.  Please contribute!

@node Template Insertion, file-part, Interactive Completion, Top
@chapter Template Insertion

This library not documented.  Please contribute!

@node file-part, Flow Control, Template Insertion, Top
@chapter file-part

This library not documented.  Please contribute!

@node Flow Control, Foldout, file-part, Top
@chapter Flow Control

This library not documented.  Please contribute!

@node Foldout, Function Menu, Flow Control, Top
@chapter Foldout

This library not documented.  Please contribute!

@node Function Menu, id-select, Foldout, Top
@chapter Function Menu

This library not documented.  Please contribute!

@node id-select, info-look, Function Menu, Top
@chapter id-select

This library not documented.  Please contribute!

@node info-look, Live Icon, id-select, Top
@chapter info-look

This library not documented.  Please contribute!

@node Live Icon, makesum, info-look, Top
@chapter Live Icon

This library not documented.  Please contribute!

@node makesum, man, Live Icon, Top
@chapter makesum

This library not documented.  Please contribute!

@node man, mode-motion+, makesum, Top
@chapter man

This library not documented.  Please contribute!

@node mode-motion+, outl-mouse, man, Top
@chapter mode-motion+

This library not documented.  Please contribute!

@node outl-mouse, page-ext, mode-motion+, Top
@chapter outl-mouse

This library not documented.  Please contribute!

@node page-ext, popper, outl-mouse, Top
@chapter page-ext

This library not documented.  Please contribute!

@node popper, Power Macros, page-ext, Top
@chapter popper

This library not documented.  Please contribute!

@node Power Macros, Redo, popper, Top
@chapter Power Macros

Keyboard Macros are a very powerful tool, if you know how to use them the
right way!  Without this extension it is, however, a bit difficult in Emacs
to define and maintain several macros at a time. This problem is solved with
this package.

When you have loaded this package Emacs will, upon completion of macro
definition, ask you which key you want to assign this macro to and ask for a
description of the macro. If something is already bound to this key, Emacs
will ask you whether you want to override this binding. Furthermore, this
package also takes care of saving the macro to your .emacs file for later
Emacs sessions.

The description for all the defined macros may be obtained with the function
`pm-manage-macros'. Using this function you can also manage your
power-macros.

To execute this function, type:

@example
M-x pm-manage-macros RET
@end example

To configure the package, type:

@example
M-x customize-group RET power-macros RET
@end example

@node Redo, reportmail, Power Macros, Top
@chapter Redo

This library not documented.  Please contribute!

@node reportmail, Scrolling In Place, Redo, Top
@chapter reportmail

This library not documented.  Please contribute!

@node Scrolling In Place, Line Numbering, reportmail, Top
@chapter Scrolling In Place

This library not documented.  Please contribute!

@node Line Numbering, Vertical Mode, Scrolling In Place, Top
@chapter Line Numbering

This library not documented.  Please contribute!

@node Vertical Mode, Align, Line Numbering, Top
@chapter Vertical Mode

This library not documented.  Please contribute!

@node Align, Allout, Vertical Mode, Top
@chapter Align

This mode allows you to align regions in a context-sensitive fashion.  The
classic use is to align assignments:

@example
   int a = 1;
   short foo = 2;
   double blah = 4;
@end example

becomes

@example
   int    a    = 1;
   short  foo  = 2;
   double blah = 4;
@end example

@menu
* Align Usage::		How to use the package.
@end menu

@node Align Usage,  , Align, Align
@section Align Usage

To configure the package, type:

@example
M-x customize-group RET align RET
@end example

There are several variables which define how certain "categories" of syntax
are to be treated.  These variables go by the name `align-CATEGORY-modes'.
For example, "c++" is such a category.  There are several rules which apply
to c++, but since several other languages have a syntax similar to c++ (e.g.,
c, java, etc), these modes are treated as belonging to the same category.

If you want to add a new mode under a certain category, just customize that
list, or add the new mode manually.  For example, to make jde-mode a c++
category mode, use this code in your .emacs file:

@example
   (setq align-c++-modes (cons 'jde-mode align-c++-modes))
@end example

In some programming modes, it's useful to have the aligner run only after
indentation is performed.  To achieve this, customize or set the variable
`align-indent-before-aligning' to t.

@node Allout, Balloon Help and Tooltips, Align, Top
@chapter Allout

Allout outline mode provides extensive outline formatting and manipulation
beyond standard emacs outline mode, @ref{Outline Mode,,,xemacs}.  It provides
for structured editing of outlines, as well as navigation and exposure.  It
also provides for syntax-sensitive text like programming languages.  (For an
example, see the allout code itself, which is organized in ;; an outline
framework.)
 
In addition to outline navigation and exposure, allout includes:

@itemize @bullet

@item topic-oriented repositioning, cut, and paste

@item integral outline exposure-layout

@item incremental search with dynamic exposure and reconcealment of hidden
text

@item automatic topic-number maintenance

@item "Hot-spot" operation, for single-keystroke maneuvering and exposure
control. (See the outline-mode docstring.)

@end itemize 
 
and many other features.
 
To configure the package, type:

@example
M-x customize-group RET allout RET
@end example

To use the allout package in place of the standard outline package, add the
following bit of code

@lisp 
(require 'outline "allout") 
@end lisp 

to your .emacs file.  This will ensure that all the functions provided by the
outline package will be loaded from the new allout package instead.

The outline menubar additions provide quick reference to many of the
features, and see the docstring of the variable `outline-init' for
instructions on priming your emacs session for automatic activation of
outline-mode.
 
See the docstring of the variables `outline-layout' and
`outline-auto-activation' for details on automatic activation of allout
outline-mode as a minor mode.



@node Balloon Help and Tooltips, Getting the Mouse Out of the Way, Allout, Top
@chapter Balloon Help and Tooltips

This library not documented.  Please contribute!

@node Getting the Mouse Out of the Way, Blinking Cursor, Balloon Help and Tooltips, Top
@chapter Getting the Mouse Out of the Way

This library not documented.  Please contribute!

@node Blinking Cursor, Blinking Parentheses, Getting the Mouse Out of the Way, Top
@chapter Blinking Cursor

This library not documented.  Please contribute!

@node Blinking Parentheses, Face Editor, Blinking Cursor, Top
@chapter Blinking Parentheses

This library not documented.  Please contribute!

@node Face Editor, Speeding Up Fontlock, Blinking Parentheses, Top
@chapter Face Editor

This library not documented.  Please contribute!

@node Speeding Up Fontlock, Lazy Fontlocking, Face Editor, Top
@chapter Speeding Up Fontlock

This library not documented.  Please contribute!

@node Lazy Fontlocking, Another Lazy Fontlocker, Speeding Up Fontlock, Top
@chapter Lazy Fontlocking

This library not documented.  Please contribute!

@node Another Lazy Fontlocker, lispm-fonts, Lazy Fontlocking, Top
@chapter Another Lazy Fontlocker

This library not documented.  Please contribute!

@node lispm-fonts, mic-paren, Another Lazy Fontlocker, Top
@chapter lispm-fonts

This library not documented.  Please contribute!

@node mic-paren, paren, lispm-fonts, Top
@chapter mic-paren

This library not documented.  Please contribute!

@node paren, shell-font, mic-paren, Top
@chapter paren

This library not documented.  Please contribute!

@node shell-font, Hooks Invoked After Saving, paren, Top
@chapter shell-font

This library not documented.  Please contribute!

@node Hooks Invoked After Saving, Indivisible Blocks of Text, shell-font, Top
@chapter Hooks Invoked After Saving

This library not documented.  Please contribute!

@node Indivisible Blocks of Text, Table and Array Editor, Hooks Invoked After Saving, Top
@chapter Indivisible Blocks of Text

This library not documented.  Please contribute!

@node Table and Array Editor, Floating Toolbar, Indivisible Blocks of Text, Top
@chapter Table and Array Editor

This library not documented.  Please contribute!

@node Floating Toolbar, tree-menu, Table and Array Editor, Top
@chapter Floating Toolbar

This library not documented.  Please contribute!

@node tree-menu, The Toolbar Utilities, Floating Toolbar, Top
@chapter tree-menu

This library not documented.  Please contribute!

@node The Toolbar Utilities, Copying, tree-menu, top
@chapter The Toolbar Utilities
@cindex toolbar

The toolbar utilities are a set of Emacs commands and Lisp functions for
convenient creation and management of toolbars.  Common usages such as
creating and adding toolbar buttons to invoke commands and keyboard
macros are implemented as user commands.  Convenience APIs are provided
to create buttons, add them to toolbars, kill them from toolbars, and
finding a particular button, or a button with certain content, in a
toolbar.

The toolbar utilities are implemented in three files:

@table @file
@item toolbar-utils.el

The toolbar utility APIs and user commands.

@item edit-toolbar.el

The near-WYSIWYG toolbar editor by Peter D. Pezaris.

@item xemacs-toolbar.el

The XEmacs compatibility API for programs that should also run under GNU
Emacs.
@end table

The author would like to thank Jeff Miller and Peter D. Pezaris for the
original API and the toolbar editor, respectively, and David Kastrup and
Jamie Zawinski for the pedal-gluteal impetus that resulted in the recent
revision of these libraries described in this manual.

@menu
* Adding Buttons on the Fly::		Quick and convenient.
* The Toolbar Editor::			Power tools for customization.
* APIs for Adding and Killing::		For Lisp programmers.
* APIs for Search::                     Button, button, who's got the button?
* Toolbar Portability::			The @file{xemacs-toolbar.el} library.
@end menu

@node Adding Buttons on the Fly, The Toolbar Editor, The Toolbar Utilities, The Toolbar Utilities
@section Adding Buttons on the Fly

@defvr Group edit-toolbar

Customize group of tools for interactive editing and non-interactive 
management of toolbars.
@end defvr

@defvar toolbar-button-default-position
Default position for adding toolbar
buttons on the fly.  The value may be a non-negative integer (0 is
leftmost), or one of the symbols @code{left}, @code{right}, or
@code{extreme-right}.  @code{left} is synonymous with 0, and
@code{extreme-right} is synonymous with @code{(length toolbar)}.
@code{right} specifies placing a new item at the right end of the
flush-left group of buttons.

Default value: @code{right}.  Customize type: sexp.

See also @samp{toolbar-add-button}, @ref{APIs for Adding and Killing}.
@end defvar

@deffn Command toolbar-add-button-on-the-fly description command label &optional position locale

Add an button at @var{position} to the default toolbar of the selected
window.  Returns @code{t}.

The return value may change.  Tell stephen@@xemacs.org what value you
think would be (most) useful.

@table @var
@item description
A string describing the action, and displayed as help.

@item command
An interactive command (ie, a symbol with an interactive function
definition) implementing the action.

@item label
A string used to label the button.

@item position
Optional.  A position (a non-negative integer, or one of the
symbols @code{left}, @code{right}, or @code{extreme-right}.

Default: @code{right}.

@item locale
Optional.  A specifier locale, defaulting to the current buffer.  If
current-buffer-only is not what you want, and you don't understand
specifier locales, use @code{global}.  It's safe and probably does what
you want.
@end table
@end deffn

@deffn Command toolbar-add-kbd-macro mac icon is-file
Add a button invoking a keyboard macro to the toolbar.
The button is added at the end of the left group.

@table @var
@item mac
A keyboard macro name, or the empty string or nil to use a copy of
the last keyboard macro defined.

@item icon
A string specifying the icon to be used.  If @var{is-file} is
non-@code{nil}, it is interpreted as the name of an image file, and
searched for using @code{locate-data-file}.  Otherwise it is used
verbatim as a label.

@item is-file
Determines the treatment of @var{icon} (q.v.).
@end table

Used interactively, prompts for the macro name @var{mac} and an
@var{icon}.  @var{is-file} is non-@code{nil} if a prefix argument was
used.
@end deffn

@defun toolbar-add-execute-macro-button

Add a button to the global toolbar to execute the last keyboard macro.

Unlike @code{toolbar-add-kbd-macro}, this does not copy the macro.  The
macro executed will change with redefinitions.

Due to a simple implementation, this button will not appear in buffers with
local toolbars if invoked after the toolbar is installed.  If you like this
button, it's probably best to invoke this function in your init file.
@end defun

@defun toolbar-execute-last-kbd-macro
Toolbar thunk which executes the most recently defined keyboard macro.
@end defun

@deffn Command restore-initial-toolbar
Restores the default toolbar defined by @code{initial-toolbar-spec}.

There is also a cache of killed buttons in @code{button-palette}.
@end deffn

@node The Toolbar Editor, APIs for Adding and Killing, Adding Buttons on the Fly, The Toolbar Utilities
@section The Toolbar Editor

To use @file{edit-toolbar.el}, simply type @kbd{M-x edit-toolbar RET}.

For help on the various commands you can type @key{?} in a
@samp{edit-toolbar} buffer.  To save a modified toolbar type @kbd{C-x
C-s} in an @samp{edit-toolbar} buffer.  If you want to use a saved
toolbar in your future XEmacs sessions, add the following line of code
to your init file:

@example
     (load "~/.xemacs/.toolbar")
@end example

Here is a table of commands and bindings available in
@samp{edit-toolbar-mode}.  These commands are also available from the
@samp{Edit Toolbar} menu.

@table @kbd
@item q

@samp{edit-toolbar-quit}:  Bury the @samp{edit-toolbar} buffer.

@item p
@itemx DEL

@samp{edit-toolbar-previous}:  Select the previous item (line).

@item n
@itemx SPC
@itemx RET

@samp{edit-toolbar-next}:    Select the next item (line).

@item ?

@samp{describe-mode}:  Help.

@item f

@samp{edit-toolbar-set-function}:  Set the command for the current button.

@item h

@samp{edit-toolbar-set-help}:  Set the help string for the current button.

@item a

@samp{edit-toolbar-add-button}:  Add a new empty button.

@item 2

@samp{edit-toolbar-add-separator-2D-narrow}:  Add a new narrow 2D
fixed-width spacer.

@item @@

@samp{edit-toolbar-add-separator-2D-wide}:  Add a new wide 2D fixed-width
spacer.

@item 3

@samp{edit-toolbar-add-separator-3D-narrow}:  Add a new narrow 3D
fixed-width spacer.

@item #

@samp{edit-toolbar-add-separator-3D-wide}:  Add a new wide 3D fixed-width
spacer.

@item R

@samp{edit-toolbar-add-separator-right-left}:  Place the filler
separator, which expands to create a flush-left group of buttons and
spacers and a flush-right group.

@item c

@samp{edit-toolbar-copy}:  Copy the selected button.

@item d

@samp{edit-toolbar-down}:  Reorder the buttons by moving the selected
button down (to the right on a horizontal toolbar).

@item u

@samp{edit-toolbar-up}:  Reorder the buttons by moving the selected
button up (to the left on a horizontal toolbar).

@item k

@samp{edit-toolbar-kill}:  Kill the selected button.

@item s
@itemx C-x C-s

@samp{edit-toolbar-save}:  Save the current buffer to
@file{~/.xemacs/.toolbar} in a format that allows it to be reloaded.

@item r

@samp{edit-toolbar-restore}:  Restore the original toolbar (ie, before
this editing session started).

@end table

@node APIs for Adding and Killing, APIs for Search, The Toolbar Editor, The Toolbar Utilities
@section APIs for Adding and Killing

@defvar button-palette
List of buttons cut from toolbars.

Note this is actually a toolbar descriptor.
@end defvar

@defun toolbar-add-item toolbar-spec item &optional position
Add @var{item} to @var{toolbar-spec} at @var{position}, and return
@var{toolbar-spec}.  Uses functions that alter list structure.

@table @var
@item item
A toolbar button or spacer specification (eg, from
@code{toolbar-new-button} or @code{toolbar-new-spacer}).
@item toolbar-spec
A toolbar descriptor (eg, from @code{toolbar-new-toolbar}).
@item position
Optional.  A non-negative integer, with 0 being the extreme left and
\(length @var{toolbar-spec}) the extreme right.  The symbols
@code{left}, @code{right}, and @code{extreme-right} are also accepted.
@code{left} is synonymous with 0.  @code{right} places @var{item} at the
right end of the left group of buttons.  @code{extreme-right} places
@var{item} at the extreme right of the toolbar, creating a right group
if one does not exist.
@end table

#### This function does not yet support inserting the group delimiter nil
as an explicit item.

@var{position} may be greater than (length @var{toolbar-spec}), in which
case it is truncated to (length @var{toolbar-spec}).  Note that
@code{(length @var{toolbar-spec})} is not synonymous with @code{right}
or @code{extreme-right} (@code{extreme-right} will create a right group
if it doesn't already exist).
@end defun

@defun toolbar-new-button icon-spec command help-string &optional initially-disabled
Return a checked toolbar button specification.

@table @var
@item icon-spec
A list of glyphs (from @code{make-glyph}), a glyph, or a
string to use as the button's icon.  If a string or single glyph, it will
be used for the button-up glyph.  If a list, it may contain 1 to 6 glyphs,
which XEmacs will use for button up, button down, button disabled, button
up with caption, button down with caption, and button disabled with caption,
in that order.  Missing or nil glyphs will be defaulted.  (#### Strings as
list elements are not supported but could be.)

@item command
The (interactive) command to invoke when the button is pressed.

@item help-string
A string briefly describing the command, displayed in the echo area or
as balloon help when the pointer enters the button.

@item initially-disabled
Optional.  If non-@code{nil}, specifies that the button should initially
be disabled.

See @code{default-toolbar} or the Lispref (@pxref{Toolbars, , ,
lispref}) for more information.
@end table
@end defun

@defun toolbar-new-spacer style &optional size
Returns a checked toolbar spacer ``button''.

@table @var
@item style
One of the symbols @code{2d} or @code{3d}, indicating whether the area is
displayed without shadows (giving it a flat appearance), or with shadows
(giving it a raised, 3-D appearance).  There is no default.
#### We may set a default style.  Tell stephen@@xemacs.org which you use.

@item size
Specifies the length, in pixels, of the blank area.  If omitted,
it defaults to a device-specific value (8 pixels for X devices).
@end table
@end defun

@defun make-toolbar-instantiator &optional toolbar-spec domain
Return a checked toolbar instantiator, a list of vectors.

@table @var
@item toolbar-spec
May be a list of buttons (ie, a toolbar descriptor, see
@code{default-toolbar}), a toolbar specifier object, a symbol whose
value is a toolbar specifier object, or @code{nil}.  If @code{nil},
returns a null list.  If a toolbar specifier object or variable
containing one, the specification for DOMAIN is used.  If non-nil, DOMAIN
must be a window, a frame, or a device, otherwise it defaults to the selected
window (see @code{specifier-instance}).  The list thus generated is checked and
returned.

If @var{toolbar-spec} is a list, it is copied; it is safe to pass other
packages' toolbar initializers to this function.  However, you probably
do not want to change any of the objects in the returned specification.
They are returned as is, not copied.

See @code{default-toolbar} or the Lispref (@pxref{Toolbars, , ,
lispref}) for more information.
@end table
@end defun

@defun toolbar-kill-item-pos pos &optional toolbar locale
Kill the item at position @var{pos} of @var{toolbar} in @var{locale}.
Killed buttons are prepended to @code{button-palette}.

@var{locale} defaults to @code{global}.  If there are multiple specs for
@var{locale}, take the first one.

This function currently does not accept symbolic positions a la
@code{toolbar-add-item}.  Use @code{toolbar-find-item} to locate whole
buttons and spacers, and @code{toolbar-find-button} to locate buttons by
characteristics.  See also @code{toolbar-find-button-by-icon},
@code{toolbar-find-button-by-command}, and
@code{toolbar-find-button-by-help-string}.
@end defun

@node APIs for Search, Toolbar Portability, APIs for Adding and Killing, The Toolbar Utilities
@section APIs for Search

@defun toolbar-find-button item &optional toolbar locale
Return the position of a button containing @var{item} in its
specification. 

@table @var
@item item
May specify a button, spacer, icon, command, help string, or nil.  If
@var{item} is nil, find the separator between the group of buttons to be
left justified, and the group to be right justified.  (Distinctions
among the various ``search key types'' are somewhat heuristic but are
probably reliable enough to use in library code.)

@item toolbar
If non-@code{nil}, search it; otherwise search the default toolbar.

@item locale
If non-@code{nil}, get @var{toolbar}'s descriptor in that locale,
otherwise use the @code{global} locale.
@end table
@end defun

@defun toolbar-find-item item &optional toolbar locale
Return the position of @var{item}, a button, spacer, or nil.
@var{toolbar} and @var{locale} determine the descriptor to be searched.

If @var{item} is nil, find the separator between the group of buttons to
be left justified, and the group to be right justified.  If there are
several matching items, the first is returned.  If none is found, return
nil.
@end defun

@defun toolbar-find-button-by-icon icon &optional toolbar locale
Return the position of a button with icon @var{icon}.
@var{icon} must be a list of glyphs or a symbols whose value is a list
of glyphs.
@var{toolbar} and @var{locale} determine the descriptor to be searched.

If there are several matching buttons, the first is returned.
@end defun

@defun toolbar-find-button-by-command cmd &optional toolbar locale
Return the position of a button invoking command CMD.  @var{toolbar} and
@var{locale} determine the descriptor to be searched.

If there are several matching buttons, the first is returned.
@end defun

@defun toolbar-find-button-by-help-string str &optional toolbar locale

Return the position of a button with help-string @var{str}.
@var{toolbar} and @var{locale} determine the descriptor to be searched.

If there are several matching buttons, the first is returned.
This function will not find spacers.
@end defun

@defun toolbar-find-button-by-element object index toolbar locale &optional thunk
Return the position of a button containing @var{object} in element
@var{index}.  @var{toolbar} and @var{locale} determine the descriptor to
be searched.

Optional argument @var{thunk} is a function of one argument which is
used to normalize @var{object} for comparison.

If there are several matching buttons, the first is returned.
This function will not find spacers.
@end defun

@node Toolbar Portability, , APIs for Search, The Toolbar Utilities
@section Toolbar API Portability to GNU Emacs
@cindex GNU Emacs compatibility
@cindex compatibility libraries, GNU Emacs

The @file{xemacs-toolbar.el} library provides XEmacs toolbar
compatibility functions for GNU Emacs.

Third-party maintainers may use the same APIs in GNU Emacs as in XEmacs.
Simply provide this library with your own code, and load it
conditionally:

@example
(if (featurep 'xemacs)
    (require 'toolbar-utils)
  (require 'toolbar-utils "xemacs-toolbar"))
@end example

XEmacs features that are not present in GNU Emacs will be ignored, and
various arguments with different semantics will be defaulted appropriately.

User commands such as @code{toolbar-add-kbd-macro} and advanced features
such as the toolbar editor and the button cache are not presently
provided.

@node Copying, , The Toolbar Utilities, Top
@chapter Copying
@unnumbered GNU GENERAL PUBLIC LICENSE
@center Version 2, June 1991

@display
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display

@unnumberedsec Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software---to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

@iftex
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end iftex
@ifinfo
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end ifinfo

@enumerate 0
@item
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The ``Program'', below,
refers to any such program or work, and a ``work based on the Program''
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term ``modification''.)  Each licensee is addressed as ``you''.

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

@item
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

@item
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

@enumerate a
@item
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

@item
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

@item
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License.  (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
@end enumerate

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

@item
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

@enumerate a
@item
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

@item
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

@item
Accompany it with the information you received as to the offer
to distribute corresponding source code.  (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
@end enumerate

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

@item
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

@item
You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

@item
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

@item
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

@item
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

@item
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and ``any
later version'', you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

@item
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

@iftex
@heading NO WARRANTY
@end iftex
@ifinfo
@center NO WARRANTY
@end ifinfo

@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW@.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE@.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU@.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

@item
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
@end enumerate

@iftex
@heading END OF TERMS AND CONDITIONS
@end iftex
@ifinfo
@center END OF TERMS AND CONDITIONS
@end ifinfo

@page
@unnumberedsec How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.

@smallexample
@var{one line to give the program's name and an idea of what it does.}
Copyright (C) 19@var{yy}  @var{name of author}

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@end smallexample

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

@smallexample
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'.  This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
@end smallexample

The hypothetical commands @samp{show w} and @samp{show c} should show
the appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than @samp{show w} and
@samp{show c}; they could even be mouse-clicks or menu items---whatever
suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary.  Here is a sample; alter the names:

@smallexample
@group
Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written
by James Hacker.

@var{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
@end group
@end smallexample

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.