This file is indexed.

/usr/share/emacs/site-lisp/mew/mew-vars.el is in mew-beta 7.0.50~6.5+0.20140128-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
;;; mew-vars.el --- Variables and Constants for Mew

;; Author:  Kazu Yamamoto <Kazu@Mew.org>
;; Created: Nov 22, 1997

;;; Code:

(require 'mew-env)

;;;
;;; User option variables which are easy to set.
;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Defining groups
;;;

(defgroup mew nil
  "Messaging in the Emacs World."
  :group 'mail)

(defgroup mew-basic nil
  "Basic configuration."
  :group 'mew)

(defgroup mew-env nil
  "Basic environment."
  :group 'mew)

(defgroup mew-folder nil
  "Basic folder."
  :group 'mew)

(defgroup mew-summary nil
  "Summary mode."
  :group 'mew)

(defgroup mew-message nil
  "Message mode."
  :group 'mew)

(defgroup mew-cache nil
  "Message Caching."
  :group 'mew)

(defgroup mew-draft nil
  "Draft mode."
  :group 'mew)

(defgroup mew-cite nil
  "Citation."
  :group 'mew)

(defgroup mew-reply nil
  "Reply to message."
  :group 'mew)

(defgroup mew-refile nil
  "Refiling."
  :group 'mew)

(defgroup mew-complete nil
  "Completion."
  :group 'mew)

(defgroup mew-highlight nil
  "Highlight."
  :group 'faces
  :group 'mew)

(defgroup mew-privacy nil
  "Privacy setting."
  :group 'mew)

(defgroup mew-addrbook nil
  "Address book."
  :group 'mew)

(defgroup mew-net nil
  "Network."
  :group 'mew)

(defgroup mew-pop nil
  "POP."
  :group 'mew)

(defgroup mew-smtp nil
  "SMTP."
  :group 'mew)

(defgroup mew-imap nil
  "IMAP."
  :group 'mew)

(defgroup mew-nntp nil
  "NNTP."
  :group 'mew)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Environment variables
;;;

(defcustom mew-rc-file "~/.mew"
  "*A file to be loaded after Mew's variables are initialized."
  :group 'mew-env
  :type 'file)

(defcustom mew-mail-path "~/Mail"
  "*A directory where folders locate."
  :group 'mew-env
  :type 'directory)

(defcustom mew-conf-path mew-mail-path
  "*A directory where Mew's configuration files locate."
  :group 'mew-env
  :type 'directory)

(defcustom mew-pop-inbox-folder "$inbox"
  "*The default folder for POP."
  :group 'mew-folder
  :type 'string)

(defcustom mew-imap-inbox-folder "%inbox"
  "*The default folder for IMAP."
  :group 'mew-folder
  :type 'string)

(defcustom mew-imap-queue-folder "%queue"
  "*The queue folder for IMAP jobs."
  :group 'mew-folder
  :type 'string)

(defcustom mew-imap-trash-folder "%trash"
  "*The trash folder for IMAP. If non-nil, deleted messages are
moved to this folder. Deleting messages in this folder makes them
really deleted."
  :group 'mew-folder
  :type '(choice string (const nil)))

(defcustom mew-imap-trash-folder-list nil
  "*A list of IMAP folders whose messages marked with 'D' are really deleted."
  :group 'mew-summary
  :type '(choice (const nil) (repeat string)))

(defcustom mew-inbox-folder "+inbox"
  "*The folder where new messages are incorporated."
  :group 'mew-folder
  :type 'string)

(defcustom mew-draft-folder "+draft"
  "*The folder where draft are contained."
  :group 'mew-folder
  :type 'string)

(defcustom mew-trash-folder "+trash"
  "*The trash folder."
  :group 'mew-folder
  :type '(choice string (const nil)))

(defcustom mew-trash-folder-list nil
  "*A list of folders whose messages marked with 'D' are really deleted."
  :group 'mew-summary
  :type '(choice (const nil) (repeat string)))

(defcustom mew-queue-folder "+queue"
  "*The queue folder to send messages."
  :group 'mew-folder
  :type 'string)

(defcustom mew-postq-folder "+postq"
  "*The queue folder to post messages."
  :group 'mew-folder
  :type 'string)

(defcustom mew-attach-folder "+attach"
  "*The folder where attachments are contained."
  :group 'mew-folder
  :type 'string)

(defcustom mew-friend-folder "+from"
  "*The folder where personal messages are refiled."
  :group 'mew-folder
  :type 'string)

(defcustom mew-imap-friend-folder "%from"
  "*The folder where personal messages are refiled for IMAP."
  :group 'mew-folder
  :type 'string)

(defcustom mew-imap-spam-field nil
  "*The field name of anti spam information to be used for IMAP spam filter.
If both 'mew-imap-spam-field' and 'mew-imap-spam-word' are defined,
messages whose the field contains the word are automatically
removed or refiled to 'mew-imap-spam-folder' or 'mew-imap-trash-folder'
\(if defined) while scanning %inbox."
  :group 'mew-imap
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Spam field")))

(defcustom mew-imap-spam-word nil
  "*The word of anti spam information to be used for IMAP spam filter.
See 'mew-imap-spam-field'."
  :group 'mew-imap
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Spam word")))

(defcustom mew-imap-spam-pattern nil
  "*IMAP SEARCH pattern to filter spams.
If non-nil, 'mew-imap-spam-field' and 'mew-imap-spam-field'
treated as 'nil'."
  :group 'mew-imap
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Spam word")))

(defcustom mew-imap-spam-folder nil
  "*A folder to be used for IMAP spam filter.
See 'mew-imap-spam-field'."
  :group 'mew-imap
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Spam folder")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Hooks
;;;

(defcustom mew-env-hook nil
  "*Hook called at initialize time before setting environment."
  :group 'mew-env
  :type 'hook)

(defcustom mew-init-hook nil
  "*Hook called at initialize time."
  :group 'mew-env
  :type 'hook)

(defcustom mew-summary-mode-hook nil
  "*Hook called in Summary mode."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-virtual-mode-hook nil
  "*Hook called in Virtual mode."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-thread-display-hook nil
  "*Hook called after new threads are displayed."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-header-mode-hook nil
  "*Hook called in Header mode."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-hook nil
  "*Hook called in Draft mode."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-newdraft-hook nil
  "*Hook called in Draft mode only when new draft is prepared."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-reedit-hook nil
  "*Hook called in Draft mode when a message not in +draft or +queue
is re-edited."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-reedit-draft-hook nil
  "*Hook called in Draft mode when a message in +draft is re-edited."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-reedit-queue-hook nil
  "*Hook called in Draft mode when a message in +queue is re-edited."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-edit-hook nil
  "*Hook called in Edit mode"
  :group 'mew-draft
  :type 'hook)

(defcustom mew-draft-mode-edit-again-hook nil
  "*Hook called in Draft mode when a message returned with the old style
is edited again."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-message-mode-hook nil
  "*Hook called in Message mode."
  :group 'mew-message
  :type 'hook)

(defcustom mew-message-hook nil
  "*Hook called whenever message displayed."
  :group 'mew-message
  :type 'hook)

(defcustom mew-make-message-hook nil
  "*Hook called before making a message in Draft mode. A good example
is as follows:
  (add-hook 'mew-make-message-hook 'ispell-message)"
  :group 'mew-draft
  :type 'hook)

(defcustom mew-send-hook nil
  "*Hook called before sending/queuing an e-mail message in Draft mode.
Note that this hook is called before composition of the message."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-post-hook nil
  "*Hook called before posting/queuing a NetNews message in Draft mode.
Note that this hook is called before composition of the message."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-real-send-hook nil
  "*Hook called before sending/queuing an e-mail message in Draft mode.
Note that this hook is called after composition of the message."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-real-post-hook nil
  "*Hook called before sending/queuing a NetNews message in Draft mode.
Note that this hook is called after composition of the message."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-smtp-flush-hook nil
  "*Hook called before SMTP runs if messages exist in +queue."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-nntp2-flush-hook nil
  "*Hook called before NNTP runs if messages exist in +postq"
  :group 'mew-draft
  :type 'hook)

(defcustom mew-smtp-sentinel-hook nil
  "*Hook called when a SMTP process finished."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-nntp-sentinel-hook nil
  "*Hook called when a NNTP process to receive messages finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-nntp2-sentinel-hook nil
  "*Hook called when a NNTP process to post messages finished."
  :group 'mew-draft
  :type 'hook)

(defcustom mew-pop-sentinel-hook nil
  "*Hook called when a POP process finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-pop-sentinel-non-biff-hook nil
  "*Hook called when a non-Biff POP process finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-imap-sentinel-hook nil
  "*Hook called when an IMAP process finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-imap-sentinel-non-biff-hook nil
  "*Hook called when a non-Biff IMAP process finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-scan-sentinel-hook nil
  "*Hook called when scan finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-summary-ls-no-scan-hook nil
  "*Hook called when mew-summary-ls does not scan a folder."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-summary-exec-hook nil
  "*Hook called when mew-summary-exec finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-sort-hook nil
  "*Hook called when sort finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-summary-toggle-disp-msg-hook nil
  "*Hook called when mew-summary-toggle-disp-msg finished."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-summary-delete-folder-hook nil
  "*Hook called when a folder deleted.
Eash function is called with a deleted folder as the argument."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-summary-rename-folder-hook nil
  "*Hook called when a folder renamed.
Each function is called with a source folder and a destination folder as the argument."
  :group 'mew-summary
  :type 'hook)

(defcustom mew-syntax-format-hook nil
  "*Hook called when mew-syntax-format is called."
  :group 'mew-message
  :type 'hook)

(defcustom mew-addrbook-mode-hook nil
  "*Hook called in Addrbook mode."
  :group 'mew-addrbook
  :type 'hook)

(defcustom mew-suspend-hook nil
  "*Hook called on suspend."
  :group 'mew-env
  :type 'hook)

(defcustom mew-quit-hook nil
  "*Hook called on quit."
  :group 'mew-env
  :type 'hook)

(defcustom mew-status-update-hook nil
  "*Hook called to update status."
  :group 'mew-env
  :type 'hook)

(defcustom mew-refile-guess-by-from-learn-hook nil
  "*Hook called in mew-refile-guess-by-from-learn."
  :group 'mew-env
  :type 'hook)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Mail Addresses for Draft
;;;

(defcustom mew-mail-address-list nil
  "*The addresses included in this list never appear on the Cc: field
on a draft buffer. If nil, this value is automatically generated from
'mew-config-alist'."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

(defcustom mew-mail-domain-list nil
  "*Your e-mail address domain list like
\(\"example.org\" \"example.jp\").
They are used for mail-domain completion in Draft mode(C-cTAB). If
nil, this value is automatically generated from 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

(defcustom mew-from-list nil
  "*A list of From: for circular completion in Draft mode. If nil,
this value is automatically generated from 'mew-config-alist'. See
also 'mew-from'."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

(defcustom mew-warn-addresses nil
  "A list of addresses to be warned."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

(defcustom mew-safe-addresses nil
  "A list of addresses not to be warned."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

(defcustom mew-warn-domains nil
  "A list of domains to be warned."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

(defcustom mew-safe-domains nil
  "A list of domains not to be warned."
  :group 'mew-draft
  :type '(choice (const nil) (repeat string)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Mail Addresses
;;;

(defcustom mew-name (user-full-name)
  "*Friendly name of e-mail address.
i.e. \"Friendly name <user@mail-domain>\"."
  :group 'mew-basic
  :type '(choice string (const nil)))

(defcustom mew-user (user-login-name)
  "*User part of e-mail address."
  :group 'mew-basic
  :type 'string)

(defcustom mew-mail-domain (or (car mew-mail-domain-list)
			       mail-host-address
			       (system-name))
  "*Your e-mail address domain."
  :group 'mew-basic
  :type 'string)


(defvar mew-reply-all-alist
  '((("Followup-To:" "poster")
     ("To:" "From:"))
    ("Followup-To:"
     ("Newsgroups:" "Followup-To:" "Newsgroups:"))
    ("Newsgroups:"
     ("Newsgroups:" "Newsgroups:"))
    ("Reply-To:"
     ("To:" "Reply-To:" "From:")
     ("Cc:" "To:" "Cc:" "Apparently-To:"))
    (t
     ("To:" "From:")
     ("Cc:" "To:" "Cc:" "Apparently-To:")))
  "*Alist to be used to prepare To:/Cc:/Newsgroups: in a reply draft.
For most cases, this alist is used.
For more infomation, see the document of '\\<mew-summary-mode-map>\\[mew-summary-reply]'")

(defvar mew-reply-sender-alist
  '(("Reply-To:"
     ("To:" "Reply-To:" "From:"))
    (t
     ("To:" "From:")))
  "*Alist to be used to prepare To:/Cc:/Newsgroups: in a reply draft.
When '\\[universal-argument]' is specified for '\\<mew-summary-mode-map>\\[mew-summary-reply]' and '\\[mew-summary-reply-with-citation]', this alist is used.
For more infomation, see the document of '\\[mew-summary-reply]'")

(defvar mew-reply-fromme-alist
  '((t
     ("To:" "To:")
     ("Cc:" "Cc:")
     ("Newsgroups:" "Newsgroups:")))
  "*Alist to be used to prepare To:/Cc:/Newsgroups: in a reply draft.
When the message to be replied is sent/posted by ME, this alist is used.
For more infomation, see the document of '\\<mew-summary-mode-map>\\[mew-summary-reply]'")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; SSH/SSL/TLS
;;;

(defcustom mew-ssh-keep-connection t
  "*If non-nil, an SSH process for each service (POP, IMAP, NNTP, SMTP)
is kept for further connections. This must be 't' for IMAP and NNTP."
  :group 'mew-net
  :type 'boolean)

(defcustom mew-ssl-keep-connection t
  "*If non-nil, an SSL/TLS process for each service (POP, IMAP, NNTP, SMTP)
is kept for further connections. This must be 't' for IMAP and NNTP."
  :group 'mew-net
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; SMTP
;;;

(defcustom mew-smtp-server "localhost"
  "*The name of your SMTP server. If you want to use a remote SMTP
server, set an appropriate value."
  :group 'mew-smtp
  :type 'string)

(defcustom mew-smtp-port "smtp"
  "*The SMTP port. (e.g. \"smtp\" or 25)"
  :group 'mew-smtp
  :type 'string)

(defcustom mew-smtp-ssh-server nil
  "*The name of SSH server which forwards the SMTP port."
  :group 'mew-smtp
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Ssh server")))

(defcustom mew-smtp-ssl nil
  "*If non-nil, SMTP connections are made over SSL/TLS."
  :group 'mew-smtp
  :type 'boolean)

(defcustom mew-smtp-ssl-port 465 ;; no universal consensus
  "*The port for SMTP over SSL/TLS. Set this to \"smtp\" if you
want to use TLS."
  :group 'mew-smtp
  :type 'string)

(defcustom mew-smtp-user nil
  "*The user name on your SMTP server. If not configured,
your e-mail address is automatically set"
  :group 'mew-smtp
  :type '(choice string (const nil)))

(defcustom mew-smtp-auth-list '("CRAM-MD5" "PLAIN" "LOGIN")
  "*A list of SMTP AUTH methods in the preferred order.
Currently, \"CRAM-MD5\", \"PLAIN\", and \"LOGIN\" can be used."
  :group 'mew-smtp
  :type '(repeat (choice (const "CRAM-MD5") (const "PLAIN") (const "LOGIN"))))

(defcustom mew-smtp-helo-domain "localhost"
  "*An e-mail domain to tell a SMTP server with HELO/EHLO."
  :group 'mew-smtp
  :type 'string)

(defcustom mew-smtp-mail-from nil
  "*An e-mail address to tell a SMTP server with MAIL FROM:.
If nil, an address specified by the From: field is used."
  :group 'mew-smtp
  :type '(choice string (const nil)))

(defcustom mew-smtp-msgid-user nil
  "*A user part for creation of Message-Id: for SMTP. If nil, the
value of 'mew-user' is used."
  :group 'mew-smtp
  :type '(choice string (const nil)))

(defcustom mew-smtp-msgid-domain nil
  "*A domain name for creation of Message-Id: for SMTP. If nil, the
value of 'mew-mail-domain' is used."
  :group 'mew-smtp
  :type '(choice string (const nil)))

(defvar mew-smtp-timeout-time 4)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Retrieving messages
;;;

(defcustom mew-mailbox-type 'pop
  "'pop, 'imap or 'mbox"
  :group 'mew-net
  :type '(choice (const pop) (const imap) (const mbox)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; mbox
;;;

(defcustom mew-mbox-command "incm"
  "*A command to be execute if 'mew-mailbox-type' is 'mbox."
  :group 'mew-pop
  :type '(choice string (const nil)))

(defcustom mew-mbox-command-arg "-u"
  "*Arguments for 'mew-mbox-command'.
For maildir, set this to '-u -d /path/to/mbox'."
  :group 'mew-pop
  :type '(choice string (const nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Biff
;;;

(defcustom mew-biff-interval 5
  "*Minutes of biff interval. This should be smaller than
'mew-passwd-timer-unit' * 'mew-passwd-lifetime'."
  :group 'mew-net
  :type 'integer)

(defcustom mew-biff-function 'mew-biff-bark
  "*A function to be called when messages arrive."
  :group 'mew-net
  :type '(choice function (const nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; POP
;;;

(defcustom mew-pop-server "localhost"
  "*The name of your POP server. If you want to use a remote POP
server, set an appropriate value."
  :group 'mew-pop
  :type 'string)

(defcustom mew-pop-port "pop3"
  "*The POP3 port. (e.g. \"pop3\" or 110)"
  :group 'mew-pop
  :type 'string)

(defcustom mew-pop-ssh-server nil
  "*The name of SSH server which forwards the POP3 port."
  :group 'mew-pop
  :type '(choice string (const nil)))

(defcustom mew-pop-ssl nil
  "*If non-nil, POP connections are made over SSL/TLS."
  :group 'mew-pop
  :type 'boolean)

(defcustom mew-pop-ssl-port "pop3s"
  "*The port for POP over SSL/TLS."
  :group 'mew-pop
  :type 'string)

(defcustom mew-pop-user (user-login-name)
  "*The user name on your POP server."
  :group 'mew-pop
  :type 'string)

(defcustom mew-pop-auth 'apop
  "*The authentication method for POP3.
'pass means the authentication with USER/PASS (i.e. plain password).
'apop means the authentication with APOP.
t means SASL according to 'mew-pop-auth-list'."
  :group 'mew-pop
  :type '(choice (const apop) (const pass) (const t)))

(defcustom mew-pop-auth-list '("CRAM-MD5" "PLAIN")
  "*A list of SASL methods in the preferred order.
Currently, \"CRAM-MD5\" can be used."
  :group 'mew-pop
  :type '(repeat (choice (const "CRAM-MD5") (const "PLAIN"))))

(defcustom mew-pop-delete t
  "*Whether or not delete messages on a POP server after retrieval by
POP. If t, delete the messages. If nil, retain the messages. If
number N, delete the messages N days after the first access.
Otherwise they are not deleted."
  :group 'mew-pop
  :type '(choice
	  (const :tag "Delete immediately" t)
	  (const :tag "Retain the messages" nil)
	  (integer :tag "Delete N days after")))

(defcustom mew-pop-size (* 54 1024) ;; 4K hdr + 50K bdy
  "*The limit size of messages to be retrieved by POP. The default is
55296 byte. 0 means unlimited, so you can get all messages from the
POP server."
  :group 'mew-pop
  :type 'integer)

(defcustom mew-pop-body-lines 40
  "*The limit of body lines to get when the size of message
exceeds 'mew-pop-size'."
  :group 'mew-pop
  :type 'integer)

(defcustom mew-pop-header-only nil
  "*Whether or not the body of a message is retrieved by POP.
If non-nil, only header is retrieved."
  :group 'mew-pop
  :type 'boolean)

(defcustom mew-pop-proxy-server nil
  "*The name of POP proxy server."
  :group 'mew-pop
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Pop proxy server")))

(defcustom mew-pop-proxy-port nil
  "*The port for POP proxy."
  :group 'mew-pop
  :type '(choice string (const nil)))

(defvar mew-pop-timeout-time 4)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; IMAP
;;;

(defcustom mew-imap-server "localhost"
  "*The name of your IMAP server. If you want to use a remote IMAP
server, set an appropriate value."
  :group 'mew-imap
  :type 'string)

(defcustom mew-imap-port "imap"
  "*The IMAP4 port. (e.g. \"imap\" or 143)"
  :group 'mew-imap
  :type 'string)

(defcustom mew-imap-ssh-server nil
  "*The name of SSH server which forwards the IMAP4 port."
  :group 'mew-imap
  :type '(choice string (const nil)))

(defcustom mew-imap-ssl nil
  "*If non-nil, IMAP connections are made over SSL/TLS."
  :group 'mew-imap
  :type 'boolean)

(defcustom mew-imap-ssl-port "imaps"
  "*The port for IMAP over SSL/TLS."
  :group 'mew-imap
  :type 'string)

(defcustom mew-imap-user (user-login-name)
  "*The user name on the IMAP server."
  :group 'mew-imap
  :type 'string)

(defcustom mew-imap-auth t
  "*The authentication method for IMAP4.
nil means the authentication with LOGIN (i.e. plain password).
t means SASL according to 'mew-imap-auth-list'."
  :group 'mew-imap
  :type 'boolean)

(defcustom mew-imap-auth-list '("CRAM-MD5"  "LOGIN")
  "*A list of SASL methods in the preferred order.
Currently, \"CRAM-MD5\" and \"LOGIN\" can be used."
  :group 'mew-imap
  :type '(repeat (choice (const "CRAM-MD5") (const "LOGIN"))))

(defcustom mew-imap-delete t
  "*Whether or not delete messages on an IMAP server after retrieval by
IMAP. If t, delete the messages. If nil, retain the messages. If
number N, delete the messages N days after the first access.
Otherwise they are not deleted."
  :group 'mew-imap
  :type 'boolean)

(defcustom mew-imap-size (* 54 1024) ;; 4K hdr + 50K bdy
  "*The limit size of messages to be retrieved by IMAP. The default is
55296 byte. 0 means unlimited, so you can get all messages from the
IMAP server."
  :group 'mew-imap
  :type 'integer)

(defcustom mew-imap-header-only nil
  "*Whether or not the body of a message is retrieved by IMAP.
If non-nil, only header is retrieved."
  :group 'mew-imap
  :type 'boolean)

(defcustom mew-imap-prefix-list nil
  "A list to define which prefixes of user mailboxes should be used.

For example, the WU IMAP server returns the following value
for the NAMESPACE command.

	((\"\" \"/\")(\"#mhinbox\" NIL)(\"#mh/\" \"/\")) ((\"/\" \"/\")) ((\"#shared/\" \"/\")(\"#ftp/\" \"/\")(\"#news.\" \".\")(\"#public/\" \"/\"))

The first list is prefixes of user mailboxes. Each element consists
of a prefix and a separator.

If this valuable is nil, the prefix in the first element of the
list is used as a prefix of user mailboxes.

If this value is a list of strings, matched elements are used.
If the separator is non-nil, the prefix is used. If the separator
is nil, the prefix is added to mailbox alist as a mailbox.

If you want to used your home directory with WU, configure as
follows:

	(setq mew-imap-prefix-list '(\"\"))

If you want to used the MH directory with WU, configure as
follows:

	(setq mew-imap-prefix-list '(\"#mh/\" \"#mhinbox\"))

Note that %inbox means /var/mail/<user> while %#mhinbox refers to
Mail/inbox.
"
  :group 'mew-imap
  :type '(choice (const nil) (repeat string)))

(defcustom mew-imap-proxy-server nil
  "*The name of IMAP proxy server."
  :group 'mew-imap
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Imap proxy server")))

(defcustom mew-imap-proxy-port nil
  "*The port for IMAP proxy."
  :group 'mew-imap
  :type '(choice string (const nil)))

(defvar mew-imap-timeout-time 4)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; NNTP
;;;

(defcustom mew-nntp-server "localhost"
  "*The name of your NNTP server. If you want to use a remote NNTP
server, set an appropriate value."
  :group 'mew-nntp
  :type 'string)

(defcustom mew-nntp-port "nntp"
  "*The NNTP port. (e.g. \"nntp\" or 119)"
  :group 'mew-nntp
  :type 'string)

(defcustom mew-nntp-ssh-server nil
  "*The name of SSH server which forwards the NNTP port."
  :group 'mew-nntp
  :type '(choice string (const nil)))

(defcustom mew-nntp-ssl nil
  "*If non-nil, NNTP connections are made over SSL/TLS."
  :group 'mew-nntp
  :type 'boolean)

(defcustom mew-nntp-ssl-port "nntps"
  "*The port for NNTP over SSL/TLS."
  :group 'mew-nntp
  :type 'string)

(defcustom mew-nntp-user nil
  "*The user name on the NNTP server. If non-nil, authentication is
used."
  :group 'mew-nntp
  :type '(choice (const :tag "Not use" nil)
		 (string :tag "Nntp user")))

(defcustom mew-nntp-newsgroup "-fj.mail.reader.mew"
  "*The name of default Newsgroup."
  :group 'mew-nntp
  :type 'string)

(defcustom mew-nntp-size (* 54 1024) ;; 4K hdr + 50K bdy
  "*The limit size of messages to be retrieved by NNTP. The default is
55296 byte. 0 means unlimited, so you can get all messages from the
NNTP server."
  :group 'mew-nntp
  :type 'integer)

(defcustom mew-nntp-header-only nil
  "*Whether or not the body of a message is retrieved by NNTP.
If non-nil, only header is retrieved."
  :group 'mew-nntp
  :type 'boolean)

(defcustom mew-nntp-msgid-user nil
  "*A user part for creation of Message-Id: for NNTP. If nil, the
value of 'mew-user' is used."
  :group 'mew-nntp
  :type '(choice string (const nil)))

(defcustom mew-nntp-msgid-domain nil
  "*A domain name for creation of Message-Id: for NNTP. If nil, the
value of 'mew-mail-domain' is used."
  :group 'mew-nntp
  :type '(choice string (const nil)))

(defvar mew-nntp-timeout-time 4)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; range
;;;

(defcustom mew-range-list nil
  "*A list of (KEY VALUE) to define RANGE for each folder.

If KEY is t, all folders matches it. The corresponding RANGE is
returned always.

If KEY is a string, match-function is applied according to
'mew-range-list-string-type'. If matched, the corresponding RANGE is
returned.

If KEY is a list of strings, match-function is applied according to
'mew-range-list-list-type'. If a match found out of the strings,
the corresponding RANGE is returned.

Candidate values for 'mew-rage-list-string-type' and
'mew-range-list-list-type' are as follows:

	'regex		Regular expression.
	'recursive	Initial substring match. That is,
			not only a folder specified but all so
			all sub-folders are matched.
	'string		String comparison.

An example is as follows:
	'(((\"+queue\" \"+postq\" \"+draft\") \"all\")
	  ((\"$inbox\") \"sync\")
	  (t \"update\"))

If this value is nil, an appropriate value is set when Mew is booting.
"
  :group 'mew-summary
  :type '(choice
	  (const nil)
	  (repeat
	   (list (choice (string :tag "Folder")
			 (repeat :tag "Folders" (string :tag "Folder"))
			 (const :tag "Other" t))
		 string))))

(defcustom mew-range-list-string-type 'regex
  "*A value to specify an action if the key is a string in
'mew-range-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

(defcustom mew-range-list-list-type 'recursive
  "*A value to specify an action if the key is a list of strings in
'mew-range-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; unread-mark
;;;

(defcustom mew-unread-mark-list
  '((("+inbox" "$inbox" "%inbox" "-") t)
    (t nil))
  "*A list of (KEY VALUE) to define the read/unread marks for
each folder when scanning. If VALUE is non-nil, messages are
marked as unread. Otherwise, message are not marked, that is,
marked as read.

If KEY is t, all folders matches it. The corresponding VALUE is
returned always.

If KEY is a string, match-function is applied according to
'mew-unread-mark-list-string-type'. If matched, the corresponding
VALUE is returned.

If KEY is a list of strings, match-function is applied according to
'mew-unread-mark-list-list-type'. If a match found out of the strings,
the corresponding VALUE is returned.

Candidate values for 'mew-rage-list-string-type' and
'mew-unread-mark-list-list-type' are as follows:

	'regex		Regular expression.
	'recursive	Initial substring match. That is,
			not only a folder specified but all so
			all sub-folders are matched.
	'string		String comparison.

The default value is:
	'(((\"+inbox\" \"$inbox\" \"%inbox\" \"-\") t)
	  (t nil))

An example for the case where messages are marked as unread in any
folders:
	'((t t))

Note that this variable is effective only when 'mew-use-unread-mark'
is non-nil.
"
  :group 'mew-summary
  :type '(choice
	  (const nil)
	  (repeat
	   (list (choice (string :tag "Folder")
			 (repeat :tag "Folders" (string :tag "Folder"))
			 (const :tag "Other" t))
		 string))))

(defcustom mew-unread-mark-list-string-type 'regex
  "*A value to specify an action if the key is a string in
'mew-unread-mark-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

(defcustom mew-unread-mark-list-list-type 'recursive
  "*A value to specify an action if the key is a list of strings in
'mew-unread-mark-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Scan
;;;

(defconst mew-summary-form-header '(mark)
  "*A list to be appended to summary-form if the first element of
summary-form is not an integer. Since Mew assumes that
each line of Summary mode begins with one mark, this variable
MUST be '(mark).")

(defconst mew-custom-type-of-summary-form
  '(choice
    (cons :tag "Setup message number column"
	  (integer :tag "Message number column" )
	  (repeat (choice (string :tag "Insert string")
			  (const :tag "Thread indent" t)
			  (list :tag "Width and symbol"
				:value (0 type)
				(integer :tag "Display width")
				(choice :tag "Symbol"
					:value type
					(const type) (const time)
					(const date) (const year)
					(const size) (const from)
					(const subj) (symbol :tag "Other")))
			  (choice :tag "Symbol"
				  :value type
				  (const type) (const time)
				  (const date) (const year)
				  (const size) (const from)
				  (const subj) (symbol :tag "Other")))))
    (repeat :tag "Use default number column"
	    (choice (integer :tag "Message number column")
		    (string :tag "Insert string")
		    (const :tag "Thread indent" t)
		    (list :tag "Width and symbol"
			  :value (0 type)
			  (integer :tag "Display width")
			  (choice :tag "Symbol"
				  :value type
				  (const type) (const time)
				  (const date) (const year)
				  (const size) (const from)
				  (const subj) (symbol :tag "Other")))
		    (choice :tag "Symbol"
			    :value type
			    (const type) (const time)
			    (const date) (const year)
			    (const size) (const from)
			    (const subj) (symbol :tag "Other"))))))

(defvar mew-summary-form-body-starter "|")

(defcustom mew-summary-form
  `(type (5 date) " " (14 from) " " t (30 subj)
	 ,mew-summary-form-body-starter (0 body))
  "*The format in Summary mode, called summary-form. summary-form is a list
of list, symbol, and string.

\(a) A string is printed as it is.

\(b) A list consists of an integer and a symbol. The symbol specifies a
function to be called. The name of the function is produced by
concatenating 'mew-summary-form-func-prefix' and the symbol name.
\(e.g. 'mew-summary-form-date' for the symbol 'date').

Pre-defined symbols are 'type, 'time, 'date, 'year, 'size, 'from,
'subj and 'body. For more details, see the explanation of the
functions called 'mew-summary-form-<symbol>'.

The integer specifies the width of field which will be filled with a
return string of the function.

A positive value means padding SPCs on the right if necessary.

A negative value means padding SPCs on the left if necessary. If a
negative value is specified, the corresponding function must return an
ASCII string.

0 means the remaining width and is treated as a positive value.

\(c) A symbol except 't' is equivalent to (1 symbol).

\(d) The value of mew-summary-form-header (mark) is appended to
summary-form when used. See also 'mew-summary-form-header'.

\(e) 't' means the position where thread indentation is inserted.

An example is as follows:
	'(type (5 date) \" \" (-4 size) \" \" (14 from) \" \" t (30 subj) \"|\" (0 body))

You can also set this value in 'mew-summary-form-list'."
  :group 'mew-summary
  :type mew-custom-type-of-summary-form)

(defcustom mew-summary-form-list nil
  "*A list of (KEY VALUE) to define 'mew-summary-form' for each
folder. Each component is (key summary-form).

If KEY is t, all folders matches it. The corresponding SUMMARY-FORM is
returned always.

If KEY is a string, match-function is applied according to
'mew-summary-form-list-string-type'. If matched, the corresponding
SUMMARY-FORM is returned.

If KEY is a list of strings, match-function is applied according to
'mew-summary-form-list-list-type'. If a match found out of the strings,
the corresponding SUMMARY-FORM is returned.

Candidate values for 'mew-summary-form-list-string-type' and
'mew-summary-form-list-list-type' are as follows:

	'regex		Regular expression.
	'recursive	Initial substring match. That is,
			not only a folder specified but all so
			all sub-folders are matched.
	'string		String comparison.

SUMMARY-FORM is a list. See 'mew-summary-form' for more information.

An example is as follows:
      '(((\"+inbox\")
	 (type (5 date) \" \" (-4 size) \" \" (14 from) \" \" t (30 subj) \"|\" (0 body)))
	(t
	 (type (5 date) \" \" (14 from) \" \" t (30 subj) \"|\" (0 body))))
"
  :group 'mew-summary
  :type `(choice
	  (const nil)
	  (repeat
	   (list (choice (string :tag "Folder")
			 (repeat :tag "Folders" (string :tag "Folder"))
			 (const :tag "Other" t))
		 ,mew-custom-type-of-summary-form
		 (choice (integer :tag "Thread indent column")
			 (const nil))))))

(defcustom mew-summary-form-list-string-type 'regex
  "*A value to specify an action if the key is a string in
'mew-summary-form-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

(defcustom mew-summary-form-list-list-type 'recursive
  "*A value to specify an action if the key is a list of strings in
'mew-summary-form-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

(defcustom mew-summary-form-from-me-prefix "To:"
  "*The prefix to be prepend to an destination address
if the message is originated by me."
  :group 'mew-summary
  :type 'string)

(defcustom mew-summary-form-extract-rule '(nickname)
  "*A list to specify what part to extract from the From: field. Each
element must be 'name, 'comment, 'address, 'nickname, or appropriate
\"regex\".

Consider the following examples:

	A: Kazu Yamamoto <kazu@example.org>
	B: kazu@example.org (Kazu Yamamoto)
	C: Kazuhiko Yamamoto (Kazu) <kazu@example.org>

Each element returns the following value:

	'name		Name part, if any
				A: Kazu Yamamoto
				B: (No match)
				C: Kazuhiko Yamamoto (Kazu)
	'comment	Comment part, if any
				A: (No match)
				B: Kazu Yamamoto
				C: (Kazu)
	'address	Address part
				A: kazu@example.org
				B: kazu@example.org
				C: kazu@example.org

	'nickname       One element of personal information in
                        Addrbook according to 'mew-addrbook-for-summary'.
                        The default value of 'mew-addrbook-for-summary'
                        is 'nickname. So, From: is converted a nickname
                        by default. For more information, see
                        'mew-addrbook-switch'.

	(regex)		The substring first matched

If a element does not match, the next element is applied. If no
element matches to the From: field, or this value is nil, the whole
of the From: field is used."
  :group 'mew-summary
  :type '(repeat (choice regexp (const name) (const comment)
                         (const address) (const nickname))))

(defcustom mew-summary-form-mark-delete nil
  "*If non-nil, the 'D' mark automatically is put onto
duplicated messages. If a character, use it as a mark
instead of the 'D' mark."
  :group 'mew-summary
  :type '(choice (const :tag "Use mew-mark-delete" t)
		 (const :tag "Not use" nil)
		 (character :tag "Use another character")))

(defcustom mew-summary-form-mark-spam nil
  "*If non-nil, the 'D' mark automatically is put onto
SPAM messages. A message is considered a SPAM message
if the MD5 checksum of its body is duplicated in a scan.
If a character, use it as a mark instead of the 'D' mark."
  :group 'mew-summary
  :type '(choice (const :tag "Use mew-mark-delete" t)
		 (const :tag "Not use" nil)
		 (character :tag "Use another character")))

(defcustom mew-summary-form-mark-review nil
  "*If non-nil, the '*' mark automatically is put onto
messages destined to me. If a character, use it as a mark
instead of the '*' mark."
  :group 'mew-summary
  :type '(choice (const :tag "Use mew-mark-review" t)
		 (const :tag "Not use" nil)
		 (character :tag "Use another character")))

(defcustom mew-summary-form-size-0k nil
  "*If non-nil, the size of message is displayed as '0k'
if the size is less than 1k byte."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-summary-form-size-huge t
  "*If non-nil, the size of message is displayed as 'HUGE'
when the size is greater than or equal to 1000 after maximum
quantization by 'mew-summary-form-size-unit'."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-spam: "X-Bogosity:"
  "*The field name which your spam filter inserts.
E.g.
	\"X-Spam-Flag:\" for 'spamassassin'
	\"X-Bogosity:\" for 'bogofilter'"
  :group 'mew-summary
  :type 'string)

(defcustom mew-scan-fields nil
  "*A list which specifies mewl's output.
The first element MUST be \"Folder:\".
The second element MUST be \"Filename:\".
Both \"In-Reply-To:\" and \"References:\" MUST be included for thread.
The last MUST be \"Body\"."
  :group 'mew-summary
  :type '(cons (const "Folder:")
               (cons (const "Filename:")
                     (repeat string))))

(defvar mew-scan-fields-alias nil
  "*A list of aliases for 'mew-scan-fields'.
Functions called MEW-FOO will be defined according to this variable.")

(defvar mew-summary-form-func-prefix "mew-summary-form-"
  "The prefix for symbol used in 'mew-summary-form'.")

(defvar mew-scan-decode-fields (list mew-subj: mew-from: mew-to:))

(defvar mew-scan-decode-bq-body t)

(defvar mew-draft-address-warning-fields
  (list mew-to: mew-cc: mew-dcc: mew-bcc:
	mew-resent-to: mew-resent-cc: mew-resent-dcc: mew-resent-bcc:))

(defcustom mew-thread-column 28
  "A position where thread indentation is inserted
for indentation of thread. This valuable is for backward compatibility
only. Use 't' in 'mew-summary-form instead."
  :group 'mew-summary
  :type 'integer)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Demo
;;;

(defcustom mew-demo t
  "*Mew demo is displayed at boot time if *non-nil*."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-demo-picture t
  "*A picture of cats is displayed if *non-nil*."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-demo-sit-for 0
  "*Time of demo picture staying."
  :group 'mew-env
  :type '(choice integer (const nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Limits
;;;

(defcustom mew-file-max-size 100000
  "*The max size of messages. If the size of a message is greater
than mew-file-max-size, Mew skips MIME analysis."
  :group 'mew-message
  :type 'integer)

(defcustom mew-header-reasonable-size 5000
  "*The max size of header to be inserted to a temporary buffer to
obtain any fields."
  :group 'mew-message
  :type 'integer)

(defcustom mew-header-max-length 200
  "*If the length of a header exceeds this value,
it is not arranged nor MIME decoded.
See also 'mew-header-max-depth'."
  :group 'mew-message
  :type 'integer)

(defcustom mew-header-max-depth 50
  "*A value to decide loop depth for header field syntax analysis.
It was known as mew-loop-depth.
See also 'mew-header-max-length'."
  :group 'mew-message
  :type 'integer)

(defcustom mew-references-max-count 3
  "*A value for the max number of message IDs in References: when reply.
Non-integer means no limit."
  :group 'mew-reply
  :type '(choice (integer :tag "Max count")
		 (const :tag "No limit" nil)))

(defcustom mew-lisp-max-length 2000
  "*Mew saves an internal lisp structure to a file truncating
to this file."
  :group 'mew-env
  :type 'integer)

(defcustom mew-expand-max-depth 5
  "*A value to limit Addrbook expansion loop."
  :group 'mew-draft
  :type 'integer)

(defcustom mew-log-max-size 512000 ;; 500KB
  "*A value for the max size of log files."
  :group 'mew-draft
  :type 'integer)

(defcustom mew-highlight-body-max-size 10000
  "A limit for highlighting a body. '0' means No-Limitation"
  :group 'mew-highlight
  :type 'integer)

(defcustom mew-scan-max-field-length 5
  "*Max field length which 'mewl' treats."
  :group 'mew-env
  :type 'integer)

(defcustom mew-scan-max-body-length 20
  "*Max body length which 'mewl' treats."
  :group 'mew-env
  :type 'integer)

(defcustom mew-scan-body-length 10
  "*Body length which Mew treats.
Increase this value if 'mew-summary-form-mark-spam' put
the 'D' mark onto different messages."
  :group 'mew-env
  :type 'integer)

(defcustom mew-flowed-fold-threshold 78
  "*A threshold length of lines in a draft body.
if `mew-use-format-flowed' is `t' and any lines are over this
threshold, the format=flowed encoding is used."
  :group 'mew-draft
  :type 'integer)

(defcustom mew-flowed-fold-length 70
  "*A length to which each line is folded when format=flowed is used."
  :group 'mew-draft
  :type 'integer)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Ask?
;;;

(defcustom mew-ask-subject nil
  "*If *non-nil* and Subject: is empty, ask a user its value."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-to nil
  "*If *non-nil*, ask a user to whom he/she sends."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-cc nil
  "*If *non-nil*, ask a user to whom he/she sends Cc."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-fcc nil
  "*If *non-nil* and a folder on Fcc: does not exist, ask a user to
create it. If nil, folders which are not present are created without
any query."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-newsgroups nil
  "*If *non-nil* and Newsgroups: exists, ask a user to send this really."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-range nil
  "*If *non-nil*, Mew asks range if the cache in Summary mode seems
invalid. Otherwise, 'update is used for range in the case."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-ask-cite-prefix nil
  "*If *non-nil*, ask citation prefix when cite a message."
  :group 'mew-cite
  :type 'boolean)

(defcustom mew-ask-pack t
  "*If *non-nil*, ask whether or not you really want to pack."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-ask-send t
  "*If *non-nil*, ask whether or not you really want to send the message."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-post t
  "*If *non-nil*, ask whether or not you really want to post the message."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-flush-queue nil
  "*If *non-nil*, ask whether or not you really want to flush queue."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-ask-flush-case nil
  "*If *non-nil*, ask case when flushing queue."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-ask-charset nil
  "*Mew asks a user whether or not the charset chosen on composing
is appropriate.
	nil:               not ask
	A list of charset: ask if the charset is not a member of the list
	t:                 ask if 'mew-charset-m17n' is used."
  :group 'mew-draft
  :type '(choice (const nil) (const t) (repeat string)))

(defcustom mew-ask-folder-after-join nil
  "*If *non-nil*, Mew asks to move to the folder where the join
message is stored."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-ask-folder-after-burst nil
  "*If *non-nil*, Mew asks to move to the folder where the burst
messages are stored."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-ask-pipe nil
  "*If *non-nil*, Mew confirms when '\\<mew-summary-mode-map>\\[mew-summary-pipe-message]' is used."
  :group 'mew-summary
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Use
;;;

(defcustom mew-use-full-window nil
  "*If non-nil, the entire frame is used for Mew.
Otherwise, windows are configured dynamically."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-use-other-frame-for-draft nil
  "*If non-nil, a new frame is created when a draft is prepared."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-use-other-frame-for-summary nil
  "*If non-nil, a new frame is created when you visit a new folder."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-use-text/enriched t
  "*If non-nil, Mew parses enriched format text messages."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-text/html nil
  "*If non-nil, Mew parses text/html messages.
If you want to use 'mew-use-text/html-list', this value should be 'nil'."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-text/html-list nil
  "*A list of (KEY VALUE) to define whether or not HTML should be parsed
for each folder.

If KEY is t, all folders matches it. The corresponding boolean is
returned always.

If KEY is a string, match-function is applied according to
'mew-use-text/html-string-type'. If matched, the corresponding
boolean is returned.

If KEY is a list of strings, match-function is applied according
to 'mew-use-text/html-list-type'. If a match found out of the
strings, the corresponding boolean is returned.

Candidate values for 'mew-use-text/html-string-type' and
'mew-use-text/html-list-type' are as follows:

	'regex		Regular expression.
	'recursive	Initial substring match. That is,
			not only a folder specified but all so
			all sub-folders are matched.
	'string		String comparison.
"
  :group 'mew-summary
  :type '(choice
	  (const nil)
	  (repeat
	   (list (choice (string :tag "Folder")
			 (repeat :tag "Folders" (string :tag "Folder"))
			 (const :tag "Other" t))
		 boolean))))

(defcustom mew-use-text/html-string-type 'regex
  "*A value to specify an action if the key is a string in
'mew-use-text/html-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))

(defcustom mew-use-text/html-list-type 'recursive
  "*A value to specify an action if the key is a list of strings in
'mew-use-text/html-list'. Candidates are 'regex, 'recursive, and 'string."
  :group 'mew-summary
  :type '(choice (const regex) (const recursive) (const string)))


(defcustom mew-use-text/xml nil
  "*If non-nil, Mew parses text/xml messages."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-symbolic-link-for-forwarding nil
  "*If nil, messages to be forwarded is copied to +draft when
'\\<mew-summary-mode-map>\\[mew-summary-forward]' and '\\[mew-summary-multi-forward]' are used. Otherwise, symbolic links are
created (if the feature is provided)."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-use-cached-passwd nil
  "*if non-nil, passwords are cached."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-use-master-passwd nil
  "*if non-nil, a master password is used."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-use-8bit nil
  "*If non-nil, the 8bit-clean charset mechanism is used for 8bit
charsets, such as ISO-8859-1, in Draft mode. If nil, an appropriate
MIME encoding such as quoted-printable is applied. This also enables
to attach 8bit messages as it is. If nil, 8bit messages are converted
into the 7bit form."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-use-charset-sanity-check t
  "*If non-nil, the sanity check of character set is used when
composing."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-use-autoconv-when-unknown t
  "*If non-nil, Mew uses 'mew-cs-autoconv' for an unknown coding system."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-burst-folder-history nil
  "*If non-nil, the folder specified at the previous burst job
is used as a folder candidate instead of inbox."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-biff nil
  "*If non-nil, Mew displays \"Mail(n)\" in the mode line if your
message server receives messages. This is confirmed by POP or IMAP
every 'mew-biff-interval' minutes.

To use this feature, 'mew-use-cached-passwd' should be 't'.

If you want to use the biff functionality against a local mailbox, use
'display-time-mode' instead."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-use-biff-bell nil
  "*If non-nil, Mew beeps when the number of messages in
your POP server becomes non-zero. To use this feature,
'mew-use-biff' should be 't'."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-use-sender nil
  "*If From: contains multiple addresses, Mew adds Sender: anyway.
If From: contains one address and SMTP MAIL FROM
\('mew-smtp-mail-from') is different from it, this variable effects.
If non-nil, Mew adds Sender: and specifies SMTP MAIL FROM to its value.
Otherwise, Mew does not add Sender:."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-use-x-mailer t
  "*If non-nil, X-Mailer: is prepared in Draft mode"
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-use-alternative t
  "*If non-nil, Multipart/Alternative is treated as a singlepart
according to 'mew-mime-multipart-alternative-list'."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-disable-alternative-regex-list nil
  "*A list of regular expression to match the value of X-Mailer:.
If one of them matches, Multiprat/Alternative is treated as
Multipart/Mixed.

An example:
  (setq mew-disable-alternative-regex-list '(\"Apple Mail\"))"
  :group 'mew-summary
  :type '(list regexp))

(defcustom mew-use-text-body t
  "*If non-nil, a single Text/* body or the first Text/* part in a top level
multipart is displayed with its header."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-nfs-hack nil
  "*If non-nil, Mew takes some workarounds for NFS."
  :group 'mew-env
  :type 'boolean)

(defcustom mew-use-old-wvhtml nil
  "*If non-nil, Mew calls wvHtml in the old argument style."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-net-status t
  "*If non-nil, Mew displays network status to the mode line."
  :group 'mew-net
  :type 'boolean)

(defcustom mew-use-fast-refile nil
  "*If non-nil, 'rassoc' is used to look up the alist of
folders. Since it is a built-in function, it makes marking for refile
much faster especially when the alist is long. But the fast method
is not case-sensitive. So, you should set this variable to 't' only when
you does not use capital letters for your folders. If nil, the old
slow method, which is case-sensitive, is used."
  :group 'mew-refile
  :type 'boolean)

(defcustom mew-use-node-folder t
  "*If non-nil, candidate folders chosen by 'mew-refile-guess-by-folder'
includes node folders as well as leaf folders. Otherwise, candidates
are selected out of leaf folders only."
  :group 'mew-refile
  :type 'boolean)

(defcustom mew-use-case-completion t
  "*If non-nil, 'mew-case' is automatically completed when you
input a folder.  For example, consider that you input a folder in a
local folder after typing '\\<mew-summary-mode-map>\\[mew-summary-goto-folder]'.
Typing '%' automatically inserts 'mew-case' before '%'."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-spc-padding t
  "*If non-nil, SPCs are padded from the end of lines of Summary mode
to the right side."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-push-mark nil
  "*If non-nil, '\\<mew-summary-mode-map>\\[mew-summary-jump-top]' and '\\<mew-summary-mode-map>\\[mew-summary-jump-bottom]' push the mark."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-old-pgp nil
  "*If non-nil, the old fashioned PGP message are used when signing/encrypting.
Otherwise PGP/MIME is used."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-use-full-alias nil
  "*If non-nil, the entire addresses of learned address are used
as a key of address completion. Otherwise, the user parts of the
learned address are used."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-unread-mark nil
  "*If non-nil, the unread mark is used in Summary mode."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-delete-unread-mark-by-mark t
  "*If nil, the unread mark remains when the cursor is moved
to the current message from the previous message by
putting any mark on the previous one. If non-nil,
the unread mark is deleted."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-smtp-auth t
  "*If nil, SMTP AUTH is ignored even an SMTP server
returns the AUTH capability."
  :group 'mew-smtp
  :type 'boolean)

(defcustom mew-smtp-auth-plain-authorize-id nil
  "*If nil, SMTP AUTH PLAIN is created as follow:
	NUL authenticate-id NUL password
If non-nil, it is created as follow:
	authorize-id NUL authenticate-id NUL password
For more information, see RFC 2595."
  :group 'mew-smtp
  :type 'boolean)

(defcustom mew-use-punycode t
  "*If non-nil, punycode strings are decoded into IDN strings"
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-async-write nil
  "*If non-nil, message retrieval of POP/IMAP/NNTP on Unix uses
asynchronous write for each message and fsync in their sentinel."
  :group 'mew-net
  :type 'boolean)

(defcustom mew-use-format-flowed nil
  "*If non-nil, Text/Plain; format=flowed is used when composing.
If you cite a message, the citation style of format=flowed is used. "
  :group 'mew-draft
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Appearance
;;;

(defcustom mew-window-configuration
  '((summary (1  0))
    (message (8 31))
    (draft   (1  0)))
  "*Ratio of windows"
  :group 'mew-env
  :type '(list
           (list (const summary) (list integer integer))
           (list (const message) (list integer integer))
           (list (const draft) (list integer integer))))

(defcustom mew-mode-line-id "Mew: %12b"
  "*A default value of mode-line-buffer-identification for each Mew mode."
  :group 'mew-summary
  :type 'sexp)

;; Indirect call of propertized-buffer-identification due to XEmacs
(defun mew-mode-line-id ()
  (propertized-buffer-identification mew-mode-line-id))

(defcustom mew-multipart-icon-position 'right
  "*Position where multipart icons are displayed.
If 'left, displayed at the left size of the default toolbar.
If 'right, displayed at the right size of the default toolbar.
Otherwise, not displayed."
  :group 'mew-summary
  :type 'symbol)

(defcustom mew-window-home-buffer "*scratch*"
  "*Buffer name to return if window stack is empty."
  :group 'mew-summary
  :type 'string)

(defcustom mew-window-magic 80
  "*Minimum window width to scan messages in Summary mode."
  :group 'mew-summary
  :type 'integer)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Summary mode
;;;

(defcustom mew-print-function 'lpr-buffer
  "*A function for printing"
  :group 'mew-summary
  :type 'symbol)

(defcustom mew-summary-show-direction 'next
  "*Direction for SPC at end of message.
'up 'down 'next(current direction) 'stop.
Other values are considered as 'stop.
See also 'mew-summary-mark-direction'."
  :group 'mew-summary
  :type '(choice (const next) (const up) (const down) (const stop)))

(defcustom mew-summary-mark-direction 'next
  "*Direction after marking a message
'up 'down 'next(current direction) 'stop.
Other values are considered as 'stop.
See also 'mew-summary-show-direction'."
  :group 'mew-summary
  :type '(choice (const next) (const up) (const down) (const stop)))

(defcustom mew-summary-show-pause nil
  "*Pause on going to next message if *non-nil*.
See also 'mew-summary-show-direction' and 'mew-summary-mark-direction'."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-summary-mark-duplicated-skip 'first
  "*This value decides which duplicated message should not be
marked with 'mew-mark-duplicated' when 'mew-summary-mark-duplicated'
is executed.

Possible value is 'first, 'last, or nil.
nil means to mark all duplicated messages.
Other values are considered as 'first."
  :group 'mew-summary
  :type '(choice (const first) (const last) (const nil)))

(defcustom mew-summary-recenter-p t
  "*If *non-nil*, the current message is recentered in Summary mode when
displayed."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-summary-scan-width nil
  "*If *non-nil*, used as the width of Summary mode."
  :group 'mew-summary
  :type '(choice integer (const nil)))

(defcustom mew-summary-goto-line-then-display t
  "*If non-nil 'mew-summary-goto-line' displays the message
where the cursor jumped."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-summary-jump-top-then-display t
  "*If non-nil 'mew-summary-jump-top' displays the top message
where the cursor jumped to the top."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-summary-jump-bottom-then-display t
  "*If non-nil 'mew-summary-jump-bottom' displays the bottom message
where the cursor jumped to the bottom."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-summary-region-include-cursor-line nil
  "*This value decides whether or not the cursor line is included
to a region."
  :group 'mew-summary
  :type '(choice (const :tag "Include if the cursor is not on the beginning of the line" nil)
		 (const :tag "Include if the cursor is on the end of the line" end)
		 (const :tag "Include always" t)))

(defvar mew-highlight-timer-interval 3)

(defcustom mew-syntax-treat-filename-function
  'mew-syntax-treat-filename-default-function
  "*A function to modify file names specified by Content-Disposition:"
  :group 'mew-summary
  :type 'symbol)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Message mode
;;;

(defcustom mew-end-of-message-string "[End of message]"
  "*A value inserted on the end of message buffer if *non-nil*."
  :group 'mew-message
  :type '(choice string (const nil)))

(defcustom mew-end-of-part-string "[Message is continued]"
  "*A value inserted on the end of message buffer if *non-nil*."
  :group 'mew-message
  :type '(choice string (const nil)))

(defcustom mew-break-pages t
  "*If *non-nil*, a message is broken by mew-page-delimiter."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-insert-final-newline t
  "*If *non-nil*, and if text/plain does not have final newline,
insert a newline at the end of buffer. "
  :group 'mew-message
  :type 'boolean)

(defcustom mew-field-other-visible t
  "*If *non-nil*, fields which are not found in 'mew-field-spec'
are displayed after visible fields. Otherwise they are
hidden before visible fields (and after invisible fields)."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-header-veil t
  "*If *non-nil*, field lines of To: and Cc:
over 'mew-header-veil-count' are covered with invisible veils."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-header-veil-string "..."
  "*A string to indicate some lines are covered with a veil."
  :group 'mew-message
  :type 'string)

(defcustom mew-header-veil-count 4
  "*The limit number for veil."
  :group 'mew-message
  :type 'integer)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Draft mode
;;;

(defcustom mew-draft-mode-auto-save t
  "*If t, a draft is repeatedly saved to 'buffer-auto-save-file-name'
by 'do-auto-save'. If automatic saving is enabled and Emacs is crashed,
the '.save-' file remains. If this value is nil, automatic saving does
not work resulting that no garbage file remains."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-header-alist nil
  "*List of (key value) for header field to be inserted on draft.
'((\"X-fingerprint:\" \"6B 63 38 88 67 5E 96 8E  CE A4 62 73 3F 11 64 94\")
  (\"X-URL:\" \"http://www.example.org/\"))"
  :group 'mew-draft
  :type '(list (list string string)))

(defcustom mew-require-final-newline t
  "*If non-nil, Mew adds a new line to the draft if ended without a new
line."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-comment-start ">"
  "*The value to be set to comment-start in Draft mode."
  :group 'mew-draft
  :type 'string)

(defcustom mew-comment-start-skip "^> *"
  "*The value to be set to comment-start-skip in Draft mode."
  :group 'mew-draft
  :type 'string)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Draft mode
;;;

(defcustom mew-reply-to nil
  "*A value inserted into Reply-To: field in Draft mode if *non-nil*.
See also 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice string (const nil)))

(defcustom mew-fcc "+backup"
  "*A value inserted into Fcc: field in Draft mode if *non-nil*.
See also 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice string (const nil)))

(defcustom mew-cc nil
  "*A value inserted into Cc: field in Draft mode if *non-nil*.
See also 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice string (const nil)))

(defcustom mew-bcc nil
  "*A value inserted into Bcc: field in Draft mode if *non-nil*.
See also 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice string (const nil)))

(defcustom mew-dcc nil
  "*A value inserted into Dcc: field in Draft mode if *non-nil*.
If the value is 'me, your address is automatically inserted
according to the case.
See also 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice string (const nil)))

(defcustom mew-from nil
  "*A value inserted into From: field in Draft mode if *non-nil*.
For backward-compatibility. See also 'mew-name', 'mew-user', and
'mew-mail-domain'."
  :group 'mew-draft
  :type '(choice string (const nil)))

(defcustom mew-organization nil
  "*A value inserted into Organization: field in Draft mode if *non-nil*.
See also 'mew-config-alist'."
  :group 'mew-draft
  :type '(choice string (const nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Citation
;;;

(defcustom mew-cite-prefix nil
  "*Prefix of citation."
  :group 'mew-cite
  :type '(choice string (const nil)))

(defcustom mew-cite-hook nil
  "*Hook for an external cite mechanism. If you want to use
super-cite, (setq mew-cite-hook 'sc-cite-original)."
  :group 'mew-cite
  :type 'hook)

(defcustom mew-cite-strings-function 'mew-cite-strings
  "*Function called from mew-cite-original which to create cite labels
according to 'mew-cite-format' and 'mew-cite-fields'."
  :group 'mew-cite
  :type '(choice function (const nil)))

(defcustom mew-before-cite-hook nil
  "Called in mew-summary-reply-with-citation before citation."
  :group 'mew-cite
  :type 'hook)

(defcustom mew-cite-prefix-function nil
  "*Function called on citations. A good candidate is
'mew-cite-prefix-username"
  :group 'mew-cite
  :type '(choice function (const nil)))

(defcustom mew-cite-prefix-confirmp nil
  "*If *non-nil*, citation prefix (such as 'kazu> ') is
confirmed to be used."
  :group 'mew-cite
  :type 'boolean)

(defcustom mew-cite-fields (list mew-from: mew-subj: mew-date:)
  "*The fields that you want to extract as citation label.
If you change this valuable, you must change mew-cite-format.
The value of the first field becomes the first argument for mew-cite-format.
\(e.g. The default first argument is a value of From: field.)
The value of the second field becomes the second argument for mew-cite-format.
....
If this is nil, label is not generated."
  :group 'mew-cite
  :type '(repeat string))

(defcustom mew-cite-format "From: %s\nSubject: %s\nDate: %s\n\n"
  "*Format for the citation label."
  :group 'mew-cite
  :type 'string)

(defcustom mew-draft-cite-fill-mode nil
  "*A method to format a citation header.
If 'wrap, format with fill-region.
If 'truncate, cut over fill-column and insert 'mew-draft-cite-ellipses'."
  :group 'mew-draft
  :type '(choice (symbol :tag "Wrap" wrap)
                 (symbol :tag "Truncate" truncate)
                 (symbol :tag "Asis" nil)))

(defcustom mew-draft-cite-ellipses " .."
  "String that is inserted a truncated line when
'mew-draft-cite-fill-mode' is 'truncate."
  :group 'mew-cite
  :type 'string)

(defcustom mew-draft-cite-label-fill-column nil
  "If *non-nil*, this value is used for 'mew-draft-cite-fill-mode'
instead of 'fill-column'."
  :group 'mew-cite
  :type '(choice integer (const nil)))

(defcustom mew-summary-reply-position 'body
  "If 'body, the cursor locates in the beginning of the body.
Otherwise, the cursor is after To:."
  :group 'mew-cite
  :type 'symbol)

(defcustom mew-summary-reply-with-citation-position 'end
  "If 'body, the cursor locates in the beginning of the body.
If 'end, the cursor locates after the citation.
Otherwise, the cursor is after To:."
  :group 'mew-cite
  :type 'symbol)

(defcustom mew-cite-ignore-region nil
  "*If *non-nil*, the region of a draft is ignored when citing."
  :group 'mew-cite
  :type 'boolean)

(defcustom mew-cite-ignore-mouse-region t
  "*If *non-nil*, a region specified by mouse is ignored when citing."
  :group 'mew-cite
  :type 'boolean)

(defcustom mew-visit-queue-after-sending nil
  "*If *non-nil*, visit to +queue after '\\<mew-draft-mode-map>\\[mew-draft-make-message]' in Draft mode."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-visit-inbox-after-setting-case nil
  "*If *non-nil*, visit to an appropriate inbox after setting a case with '\\<mew-summary-mode-map>\\[mew-summary-set-case]'."
  :group 'mew-summary
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Charset
;;;

(defcustom mew-charset-input-method-alist nil
  "*Alist of charset and input-method. When a message is cited
into Draft mode the charset of the message is found in this
variable, the corresponding input-method is automatically
selected. An example configuration is as follows:

\(setq mew-charset-input-method-alist
      '((\"iso-8859-1\" \"latin-1-postfix\")
	(\"iso-8859-2\" \"latin-2-postfix\")))
"
  :group 'mew-draft
  :type '(list (list string string)))

(defun mew-charset-to-input-method (charset)
  (if (stringp charset)
      (mew-alist-get-value
       (mew-assoc-case-equal
	charset mew-charset-input-method-alist 0))))

(defcustom mew-charset-m17n "utf-8"
  "*A charset to be used if multiple character set are found and
an appropriate charset cannot be chosen. Possible candidates are
\"utf-8\" and \"iso-2022-jp-2\"."
  :group 'mew-draft
  :type '(choice (const "utf-8") (const "iso-2022-jp-2")))

(defcustom mew-charset-latin "iso-8859-15"
  "*This variable is used for selection of charset when composing.
If characters of both Latin 1 and Lain 9 exist in a draft, Mew takes
the following step to decide a charset.

1. If 'unify-8859-on-decoding-mode' is used:
	1.1. Use \"iso-8859-1\" if no loss.
	1.2. Otherwise, use \"utf-8\".
2. If 'unify-8859-on-decoding-mode' is not used:

	2.1. If both ISO-8859-1 and ISO-8859-15 can be used with no
             loss, 'mew-charset-latin' is used.
	2.2. Use \"iso-8859-1\" if no loss.
	2.3. Use \"iso-8859-15\" if no loss.
	2.3. Otherwise, use \"utf-8\".
"
  :group 'mew-draft
  :type '(choice (const "iso-8859-1") (const "iso-8859-15")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Signature
;;;

(defcustom mew-signature-file "~/.signature"
  "*A signature file to be inserted in Draft mode. To support multiple
signature files, use 'c-sig.el'."
  :group 'mew-draft
  :type 'file)

(defcustom mew-signature-insert-last nil
  "*If *non-nil*, the signature file is inserted in the last of body.
Otherwise, it is inserted at the current point. If you created multipart
and mew-signature-as-lastpart is *non-nil*, this variable is ignored."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-signature-as-lastpart nil
  "*If *non-nil*, the signature file is appended as the final part
when you create multipart."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-signature-description "My signature"
  "*This variable is used as a description if the signature is appended
as the final part."
  :group 'mew-draft
  :type 'string)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Samba
;;;

(defcustom mew-use-samba-encoding nil
  "*Use SAMBA encoding for non-ASCII file name when saving."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-use-samba-encoding-type 'cap
  "*A type of SAMBA encoding. Either 'cap or 'hex."
  :group 'mew-summary
  :type '(choice (const cap) (const hex)))

(defcustom mew-cs-samba 'shift_jis
  "*A character set before SAMBA encoding."
  :group 'mew-summary
  :type 'coding-system)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Attachments
;;;

(defcustom mew-attach-move-by-line nil
  "*If non-nil, 'mew-attach-{next,previous}' move the cursor line by line."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-attach-move-next-after-copy nil
  "If non-nil, the cursor moves the next position after copying/linking
in Attachments."
  :group 'mew-draft
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Completion
;;;

(defcustom mew-fields
  (list mew-from: mew-to: mew-cc: mew-dcc: mew-fcc: mew-bcc: mew-subj:
	mew-reply-to: mew-followup-to: mew-newsgroups: mew-distribution:
	mew-resent-from: mew-resent-to: mew-resent-cc:
	mew-resent-dcc: mew-resent-fcc: mew-resent-bcc:)
  "*Completion field list in Draft mode."
  :group 'mew-complete
  :type '(repeat string))

(defcustom mew-complete-case-ignore-case nil
  "*Non-nil means Mew does not consider case is significant in case
completion."
  :group 'mew-complete
  :type 'boolean)

(defcustom mew-complete-folder-ignore-case nil
  "*Non-nil means Mew does not consider case is significant in folder
completion."
  :group 'mew-complete
  :type 'boolean)

(defcustom mew-complete-address-ignore-case t
  "*Non-nil means Mew does not consider case is significant in address
completion."
  :group 'mew-complete
  :type 'boolean)

(defcustom mew-circular-complete-domain-ignore-case t
  "*Non-nil means Mew does not consider case is significant in
circular domain completion."
  :group 'mew-complete
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Field order
;;;

(defcustom mew-field-order-for-editing
  (list mew-to: mew-newsgroups: mew-cc: mew-subj: mew-from:)
  "*A field order list for editing."
  :group 'mew-draft
  :type '(repeat string))

(defcustom mew-field-order-for-reediting
  (list mew-to: mew-newsgroups: mew-cc: mew-subj: mew-from:)
  "*A field order list for reediting."
  :group 'mew-draft
  :type '(repeat string))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Fields to be deleted
;;;

(defcustom mew-field-delete-common
  '("From " ">From" "X-Mew")
  "*A field list to be deleted for reediting/resending/forwarding/saving."
  :group 'mew-draft
  :type '(choice (const nil)
		 (repeat :tag "Field list" (string :tag "Field"))))

(defvar mew-field-delete nil) ;; backward compatibility

(defcustom mew-field-delete-for-editing
  (list mew-received: "Return-Path:" "Delivery-Date:" "Delivered-To:"
	mew-message-id: mew-mv: "Content-"
	"Precedence:" mew-organization: "X-"
	"Lines:" "Status:" "Posted:" "Forwarded:" "Replied:" "X-UIDL:"
	"DomainKey-Signature:" "DKIM-Signature:"
	"Authentication-Results:" "List-.*:" "Errors-To:")
  "*A field list to be deleted in Edit mode."
  :group 'mew-draft
  :type '(choice (const nil)
                 (repeat :tag "Field list" (string :tag "Field"))))

(defcustom mew-field-delete-for-reediting
  (or mew-field-delete
      (list mew-received: "Return-Path:" "Delivery-Date:" "Delivered-To:"
	    mew-date: mew-message-id: mew-mv: "Content-"
	    "Precedence:" mew-organization: "X-"
	    "Lines:" "Status:" "Posted:" "Forwarded:" "Replied:" "X-UIDL:"
	    "DomainKey-Signature:" "DKIM-Signature:"
	    "Authentication-Results:" "List-.*:" "Errors-To:" "Sender:"))
  "*A field list to be deleted when edit again."
  :group 'mew-draft
  :type '(choice (const nil)
		 (repeat :tag "Field list" (string :tag "Field"))))

(defcustom mew-field-delete-for-others
  (list mew-received: "Return-Path:" "Delivery-Date:" "Delivered-To:"
	mew-to: mew-cc: mew-from: mew-organization:
	"Lines:" "Status:" "Posted:" "Forwarded:" "Replied:" "X-UIDL:"
	"DomainKey-Signature:" "DKIM-Signature:")
  "*A field list to be deleted when send with different To: and Cc:."
  :group 'mew-draft
  :type '(choice (const nil)
		 (repeat :tag "Field list" (string :tag "Field"))))

(defcustom mew-field-delete-for-resending
  (list mew-received: "Return-Path:" "Delivery-Date:" "Delivered-To:"
	"Resent-" "X-Resent-"
	"Lines:" "Status:" "Posted:" "Forwarded:" "Replied:" "X-UIDL:")
  "*A field list to be deleted when resending."
  :group 'mew-draft
  :type '(choice (const nil)
		 (repeat :tag "Field list" (string :tag "Field"))))

(defcustom mew-field-delete-for-forwarding
  '("Lines:" "Status:" "Posted:" "Forwarded:" "Replied:" "X-UIDL:")
  "*A field list to be deleted when forwarding."
  :group 'mew-draft
  :type '(choice (const nil)
		 (repeat :tag "Field list" (string :tag "Field"))))

(defcustom mew-field-delete-for-saving ()
  "*A field list to be deleted when saving a message to a file."
  :group 'mew-summary
  :type '(choice (const nil)
		 (repeat :tag "Field list" (string :tag "Field"))))

(defcustom mew-field-delete-for-joining
  (list mew-mv: mew-subj: mew-message-id: "Encrypted" "Content-")
  "*A field list to be deleted when joining."
  :group 'mew-summary
  :type '(repeat :tag "Field list" (string :tag "Field")))

(defcustom mew-field-for-printing
  '("Subject:" "From:" "To:" "Cc:" "Date:")
  "*A field list to print"
  :group 'mew-summary
  :type '(repeat :tag "Field list" (string :tag "Field")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Directory stuff
;;;

(defcustom mew-summary-trace-directory t
  "*If non-nil, change to the folder directory when
mew-summary-goto-folder."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-save-dir mew-home
  "*The default directory to save messages or parts in Summary mode.
See also 'mew-copy-dir'."
  :group 'mew-summary
  :type 'directory)

(defcustom mew-summary-preserve-dir nil
  "*If non-nil, the previous directory is used as the default
directory for save, etc. See also 'mew-draft-preserve-dir'."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-copy-dir mew-home
  "*The default directory from which attachments are copied in Draft mode.
See also 'mew-save-dir'."
  :group 'mew-draft
  :type 'directory)

(defcustom mew-draft-preserve-dir nil
  "*If non-nil, the previous directory is used as the default
directory for copy, etc. See also 'mew-summary-preserve-dir'."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-file-append-p nil
  "*If *non-nil*, a message or a part is appended to the existing file
on '\\<mew-summary-mode-map>\\[mew-summary-save]'. Otherwise overwrote."
  :group 'mew-summary
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Folders
;;;

(defcustom mew-regex-folder-candidate "^[^.#0-9]\\|^[0-9].*[^0-9]"
  "*Regular expression used in 'mew-dir-list-with-link-count'
and 'mew-dir-list-without-link-count' to list up folder
candidates. The default value \"^[^.#0-9]\\\\|^[0-9].*[^0-9]\" lists up
folders whose name is alphabet only."
  :group 'mew-env
  :type 'regexp)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Refile
;;;

(defconst mew-custom-type-of-guess-alist
  '(list (list string (list string string))))

(defcustom mew-refile-guess-alist nil
  "*If non-nil, mew guesses destination folder by using this hint.
The format is like this:

    (setq mew-refile-guess-alist
          '((\"To:\"
              (\"wide@wide\" \"+wide/wide\")
              (\"adam\"      \"+labo/adam\"))
            (\"Newsgroups:\"
              (\"^nifty\\\\.\\\\([^ ]+\\\\)\" \"+Nifty/\\\\1\"))
            (\"From:\"
              (\"uucp\" \"+adm/uucp\")
              (\".*\"   \"+misc\"))
            ))
"
  :group 'mew-refile
  :type mew-custom-type-of-guess-alist)


(defcustom mew-refile-ctrl-multi t
  "*If *non-nil*, guess functions guess multi folders."
  :group 'mew-refile
  :type 'boolean)

(defcustom mew-refile-guess-key-list
  (append mew-resent-dest:-list mew-destination:-list)
  "*A list of field key used by mew-refile-guess-by-folder."
  :group 'mew-refile
  :type '(repeat string))

(defvar mew-refile-guess-control
  '(mew-refile-guess-by-alist
    mew-refile-ctrl-throw
    mew-refile-guess-by-newsgroups
    mew-refile-guess-by-folder
    mew-refile-ctrl-throw
    mew-refile-ctrl-auto-boundary
    mew-refile-guess-by-thread
    mew-refile-ctrl-throw
    mew-refile-guess-by-from-folder
    mew-refile-ctrl-throw
    mew-refile-guess-by-from
    mew-refile-ctrl-throw
    mew-refile-guess-by-default))

(defcustom mew-refile-auto-refile-skip-any-mark nil
  "*If *non-nil*, 'mew-summary-auto-refile' does not touch
any already marked message."
  :group 'mew-refile
  :type 'boolean)

(defcustom mew-refile-auto-refile-confirm nil
  "*If *non-nil*, 'mew-summary-auto-refile' prompts the user for
confirmation before refiling."
  :group 'mew-refile
  :type 'boolean)

(defcustom mew-refile-guess-strip-domainpart t
  "*If *non-nil*, 'mew-refile-guess-by-default' strips domainpart of from"
  :group 'mew-refile
  :type 'boolean)

(defcustom mew-refile-guess-from-me-is-special nil
  "*If *non-nil*, 'mew-refile-guess-by-from-*' think the messages from
yourself as special. They use To: or Cc: instead of From:"
  :group 'mew-refile
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Case guess
;;;

(defcustom mew-case-guess-alist nil
  "*If *non-nil*, this value is used to guess cases when
prepared or composed.
The syntax is exactly the same as 'mew-refile-guess-alist'."
  :group 'mew-draft
  :type mew-custom-type-of-guess-alist)

(defcustom mew-case-guess-when-replied-alist nil
  "*If *non-nil*, this value is used to guess cases when replied.
The syntax is exactly the same as 'mew-refile-guess-alist'."
  :group 'mew-draft
  :type mew-custom-type-of-guess-alist)

(defcustom mew-case-guess-when-prepared t
  "*If *non-nil*, case is guessed when a draft is prepared."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-case-guess-when-composed nil
  "*If *non-nil*, case is guessed when a message is composed."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-case-guess-when-replied t
  "*If *non-nil*, case is guessed when replying to a message."
  :group 'mew-draft
  :type 'boolean)

(defcustom mew-case-guess-addition nil
  "*If *non-nil*, new guessed cases are added to old cases.
Otherwise, the old cases are overridden."
  :group 'mew-draft
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Temporary files
;;;

(defcustom mew-temp-file-initial
  (expand-file-name (user-login-name) (if (fboundp 'temp-directory)
					  (temp-directory)
					(if (boundp 'temporary-file-directory)
					    temporary-file-directory
					  "/tmp")))
  "*Hint to make a secure directory on the local file system. On
setup phase Mew make a secure directory from this variable and set
mew-temp-file a file name prefix contained the directory name. The
directory must be unreadable from others, otherwise it might become a
big security hole. And this directory must not be gained access
through network to prevent tire-tapping. Mew never uses
'call-process-region' rather does use 'call-process' creating a
temporary file with mew-temp-file by itself. If 'call-process-region'
is used, Emacs creates a temporary file (probably in /tmp). So bad
guys can wiretap the temporary file."
  :group 'mew-privacy
  :type 'directory)

(defcustom mew-delete-temp-file t
  "*If *non-nil*, delete temporary files when external commands terminate."
  :group 'mew-summary
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Auto
;;;

(defcustom mew-auto-get t
  "If *non-nil*, Mew gets messages from your mailbox automatically.
'\\[universal-argument] \\[mew]' equals to '\\[mew]' with 'mew-auto-get'
reversed."
  :group 'mew-summary
  :type 'boolean)

(defcustom mew-auto-flush-queue t
  "If *non-nil* and if there are queued messages in +queue,
they are flushed after getting message (i.e. '\\<mew-summary-mode-map>\\[mew-summary-retrieve]'). This idea saves money in dial up environment."
  :group 'mew-draft
  :type 'boolean)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Pick and Sort
;;;

(defcustom mew-pick-pattern-list nil
  "*A list of pick pattern which can be circular completed with '\\<mew-input-map>\\[mew-circular-complete-switch]'
The first member is displayed as a default value."
  :group 'mew-summary
  :type '(choice (const nil) (repeat string)))

(defcustom mew-pick-field-list
  '("head=" "to=" "cc=" "subject=" "dcc=" "fcc=" "bcc=" "date="
    "reply-to=" "followup-to=" "from=" "newsgroups=")
  "*A list of key for pick pattern."
  :group 'mew-summary
  :type '(choice (const nil) (repeat string)))

(defcustom mew-sort-default-key "date"
  "*Default sort key when inputting a sort key.
Its format is key:mode where more is found in 'mew-sort-mode'."
  :group 'mew-summary
  :type 'string)

(defcustom mew-sort-default-key-alist nil
  "*List of (folder sort-key) to decide a default sort-key
of a specific folder. An example is follows:
\(setq mew-sort-default-key-alist
      '((\"+tmp/beginners\" \"x-sequence\")
        (\"+tmp/elips\" \"x-mail-count\")))"
  :group 'mew-summary
  :type '(list (list string string)))

(defcustom mew-sort-key-alist
  '(("date" "date") ("subject") ("from") ("to") ("newsgroups")
    ("posted" "date") ("x-sequence" "postnum")
    ("x-mail-count" "num") ("x-ml-count" "num"))
  "*List of fields for 'mew-summary-sort'.
Each element is (FIELD-NAME) or (FIELD-NAME . MODE).
MODE is one of \"date\" (by chronological order) or
               \"num\"  (by numerical order) or
               \"postnum\" (by numerical order of postfix numeric) or
               \"text\" (by alphabetical order) or
               \"ml\"   (by alphabetical order with ml prefix removed) or
               \"mlnum\" (by numerical order of ml number).
\(nil means \"text\")."
  :group 'mew-summary
  :type 'sexp)

(defvar mew-sort-modes '("date" "num" "postnum" "text" "ml" "mlnum"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Range
;;;

(defvar mew-range-all "0")

(defvar mew-range-str-all    "all")
(defvar mew-range-str-update "update")
(defvar mew-range-str-last   "last:")
(defvar mew-range-str-sync   "sync")

(defcustom mew-input-range-list
  (list mew-range-str-update mew-range-str-all mew-range-str-last)
  "*A list used by range completion."
  :group 'mew-complete
  :type '(repeat string))

(defcustom mew-input-range-remote-list
  (list mew-range-str-update mew-range-str-all mew-range-str-last mew-range-str-sync)
  "*A list used by range completion."
  :group 'mew-complete
  :type '(repeat string))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Highlight
;;;

(defvar mew-summary-cook-function 'mew-summary-cook-region)

(defcustom mew-use-highlight-mark t
  "*If non-nil, highlight marked lines in Summary/Virtual mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-header t
  "*If non-nil, highlight a header in Message/Draft mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-body t
  "*If non-nil, highlight a body in Message/Draft mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-url t
  "*If non-nil, highlight URLs in Message/Draft mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-cursor-mark nil
  "*If *non-nil*, show 'mew-cursor-mark' in the beginning of the
cursor line. This is convenient if 'mew-use-highlight-cursor-line' is
not available."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-cursor-line t
  "*Put the 'mew-highlight-cursor-line-face' face on the current line
in Summary/Virtual mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-mouse-line nil
  "*Put the 'mew-highlight-mouse-line-face' face on the mouse location
in Summary/Virtual mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-x-face mew-icon-p
  "*Iconify X-Face: in Message mode."
  :group 'mew-highlight
  :type 'boolean)

(defcustom mew-use-highlight-x-face-inversion nil
  "*Invert an X-Face: image in Message mode."
  :group 'mew-highlight
  :type 'boolean)

;;;
;;; Styles and colors
;;;

(defcustom mew-cursor-mark ">"
  "*The mark in the beginning of the cursor line if
'mew-use-cursor-mark' is *non-nil*."
  :group 'mew-highlight
  :type '(choice string (const nil)))

(defcustom mew-highlight-cursor-line-face 'underline
  "*Face to highlight the cursor line in Summary/Virtual mode"
  :group 'mew-highlight
  :type 'face)

(defcustom mew-highlight-mouse-line-face 'highlight
  "*Mouse face to highlight URL in Message/Draft mode"
  :group 'mew-highlight
  :type 'face)

(defcustom mew-regex-url
  (concat
   "\\b\\("
   "\\(\\(file\\|news\\|mailto\\):\\)"
   "\\|"
   "\\(\\(s?https?\\|ftp\\|gopher\\|telnet\\|wais\\)://\\)"
   "\\)"
   "[^ \t\n>)\"]*"
   "[^] \t\n>.,:)\"]")
  "*Regular expression to find URL."
  :group 'mew-highlight
  :type 'regexp)

(defcustom mew-highlight-url-mouse-face 'highlight
  "*Mouse face to highlight URL in Message/Draft mode"
  :group 'mew-highlight
  :type 'face)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Addrbook
;;;

(defcustom mew-use-auto-alias t
  "*If non-nil, addresses on the To: and Cc: field in Draft mode
will be automatically leaned as alias."
  :group 'mew-addrbook
  :type 'boolean)

(defcustom mew-addrbook-comment-regex "^;.*$\\|#.*$"
  "*Regular expression for Addrbook."
  :group 'mew-addrbook
  :type 'regexp)

(defcustom mew-addrbook-append-domain-p t
  "If non-nil, addresses, which do not have domain part in a header,
will be appended (mew-mail-domain) when composing."
  :group 'mew-addrbook
  :type 'boolean)

(defcustom mew-addrbook-override-by-newone t
  "If non-nil, the 'user' entry in 'mew-alias-auto-alist'
is override by a new entry of (user different-address).
This means that addresses in To: and Cc: in Draft mode are
always learned with an exception 'user' is defined in Addrbook.
If nil,  the old 'user' entry remains."
  :group 'mew-addrbook
  :type 'boolean)

(defcustom mew-addrbook-for-cite-label nil
  "*How to replace the From: value in cite label
with Addrbook. See 'mew-addrbook-switch'."
  :group 'mew-addrbook
  :type 'symbol)

(defcustom mew-addrbook-for-cite-prefix 'username
  "*How to replace the From: value in cite prefix
with Addrbook. See 'mew-addrbook-switch'."
  :group 'mew-addrbook
  :type 'symbol)

(defcustom mew-addrbook-for-address-expansion 'name
  "*How to replace an address in address fields
with Addrbook. See 'mew-addrbook-switch'."
  :group 'mew-addrbook
  :type 'symbol)

(defcustom mew-addrbook-for-summary 'nickname
  "*How to replace a From: address in summary-form with Addrbook.
See 'mew-addrbook-switch' and 'mew-summary-form-extract-rule'."
  :group 'mew-addrbook
  :type 'symbol)

(defcustom mew-addrbook-strip-domainpart t
  "*If *non-nil*, a shortname is created by stripping its domain part
when '\\<mew-summary-mode-map>\\[mew-summary-addrbook-add]' in Summary mode."
  :group 'mew-addrbook
  :type 'boolean)

(defcustom mew-addrbook-alias-not-learn-list nil
  "*A list of a part of address. If an address matches to one out of the
list. the address is not registered to Addrbook."
  :group 'mew-addrbook
  :type '(choice (const nil) (repeat string)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Cache
;;;

(defcustom mew-cache-size 10
  "*Number of buffer for message cache."
  :group 'mew-cache
  :type 'integer)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Privacy
;;;

(defcustom mew-draft-privacy-method 'pgp
  "Privacy method to create messages in Draft mode.
You should choose 'pgp or 'smime."
  :group 'mew-privacy
  :type '(choice (const pgp) (const smime)))

(defcustom mew-protect-privacy-always nil
  "*If non-nil, a draft is to be protected according to
'mew-protect-privacy-always-type'."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-protect-privacy-always-type 'pgp-signature
  "*A type of privacy protection for all drafts.
Currently, 'pgp-signature, 'pgp-encryption, 'pgp-signature-encryption,
'pgp-encryption-signature, and nil are available. Since signature
does not require receiver's public key, signature service may be
appropriate for this value."
  :group 'mew-privacy
  :type '(choice (const pgp-signature)
                 (const pgp-encryption)
                 (const pgp-signature-encryption)
		 (const pgp-encryption-signature)
		 (const smime-signature)
                 (const smime-encryption)
                 (const smime-signature-encryption)
		 (const smime-encryption-signature)
                 (other :tag "nil" nil)))

(defcustom mew-protect-privacy-encrypted nil
  "*If non-nil, a draft replying a encrypted message is to be protected
according to 'mew-protect-privacy-encrypted-type'."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-protect-privacy-encrypted-type 'pgp-encryption
  "*A type of privacy protection for drafts replying encrypted
messages. Currently, 'pgp-signature, 'pgp-encryption,
'pgp-signature-encryption, 'pgp-encryption-signature,
and nil are available."
  :group 'mew-privacy
  :type '(choice (const pgp-signature)
                 (const pgp-encryption)
                 (const pgp-signature-encryption)
		 (const pgp-encryption-signature)
		 (const smime-signature)
		 (const smime-encryption)
		 (const smime-signature-encryption)
		 (const smime-encryption-signature)
                 (other :tag "nil" nil)))

(defcustom mew-protect-privacy-with-old-pgp-signature nil
  "*If non-nil and 'mew-use-old-pgp' is non-nil,
the old fashioned PGP message are used when composing."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-passwd-timer-unit 10
  "*Minutes of timer unit to cancel the cached passwords."
  :group 'mew-privacy
  :type 'integer)

(defcustom mew-passwd-lifetime 2
  "*Number of 'mew-passwd-timer-unit' to cancel the cached passwords."
  :group 'mew-privacy
  :type 'integer)

(defcustom mew-passwd-reset-timer t
  "*If non-nil, put the lifetime of a cached password longer when
the password is used."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-encrypt-to-myself t
  "*if non-nil, any message/part to be encrypted is encrypted with
your public key as well as receivers' one."
  :group 'mew-privacy
  :type 'boolean)

(defcustom mew-pgp-signer nil
  "*ID of a PGP key to use for sign"
  :group 'mew-privacy
  :type 'string)

(defcustom mew-smime-signer nil
  "*ID of a S/MIME key to use for sign"
  :group 'mew-privacy
  :type 'string)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; PGP Public key fetch
;;;

(defvar mew-x-pgp-key-list
  '("x-pgp-key:" "x-pgp-key-url:" "x-pgp-public-key:" "x-pgp-public-key-url:"
    "x-pgp5-key:" "x-pgp5-key-url:" "x-pgp5-public-key:"
    "x-pgp5-public-key-url:" "x-public-key:"))

(defvar mew-pgp-pks-port 11371)
(defvar mew-pgp-pks-lang "/pks/lookup?op=get&search=")

;; Tue Dec 16 16:28:11 JST 2003
;; http://pgp.zdv.uni-mainz.de/keyserver/bigbrother/

(defvar mew-pgp-pks-servers
  '(("openpksd.org" t)
    ("blackhole.pca.dfn.de" nil)
    ("pgp.ael.be" nil)
    ("pgp.dtype.org" nil)
    ("pgp.mit.edu" nil)
    ("pgp.nic.ad.jp" nil)
    ("pgp.rediris.es" nil)
    ("pgp.uni-mainz.de" nil)
    ("pgp.uni-paderborn.de" nil)
    ("wwwkeys.1.us.pgp.net" nil)
    ("wwwkeys.2.us.pgp.net" nil)
    ("wwwkeys.3.us.pgp.net" nil)
    ("wwwkeys.ch.pgp.net" nil)
    ("wwwkeys.cz.pgp.net" nil)
    ("wwwkeys.es.pgp.net" nil)
    ("wwwkeys.uk.pgp.net" nil)))

(defun mew-pgp-pks-http-port-p (server alist)
  (nth 1 (assoc server alist)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; SSH
;;;

(defvar mew-ssh-number-of-password-prompts 3)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Sub-programs
;;;

(defvar mew-prog-mewl        "mewl")
(defvar mew-prog-mime-encode "mewencode")
(defvar mew-prog-mime-decode "mewencode")
(defvar mew-prog-8bit        "mewencode")
(defvar mew-prog-unshar      "unshar")
(defvar mew-prog-tar         "tar")
(defvar mew-prog-compress    "compress")
(defvar mew-prog-gzip        "gzip")
(defvar mew-prog-zip         "zip")
(defcustom mew-prog-pgp      "gpg"
  "*PGP name for version check."
  :group 'mew-privacy
  :type 'string)

(defvar mew-prog-pgpkey      "wget")
(defvar mew-prog-pgpkey-args '("-q" "-O" "-"))

(defvar mew-ssh-prog          "ssh")
(defvar mew-ssh-prog-args     nil)

(defvar mew-prog-uncompface  "uncompface")
(defvar mew-prog-icontopbm   "icontopbm")
(defvar mew-prog-pbmtoxbm    "pbmtoxbm")
(defvar mew-prog-pbminvert   "pnminvert")

(defvar mew-prog-grep "grep")
(defvar mew-prog-grep-opts '("-l" "-e"))

(defvar mew-prog-grep-max-msgs 10000)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; X face
;;;

(defcustom mew-x-face-file "~/.xface"
  "*If *non-nil* and the file exists, X-Face: fields is inserted."
  :group 'mew-summary
  :type '(choice file (const nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; spam and ham
;;;

(defcustom mew-spam-prog "bogofilter"
  "*A command which learns spams."
  :group 'mew-summary
  :type 'string)

(defcustom mew-spam-prog-args '("-s" "-N" "-v")
  "*A list of command arguments which learns spams."
  :group 'mew-summary
  :type '(choice (const nil) (repeat string)))

(defcustom mew-ham-prog "bogofilter"
  "*A command which learns hams."
  :group 'mew-summary
  :type 'string)

(defcustom mew-ham-prog-args '("-n" "-S" "-v")
  "*A list of command arguments which learns hams."
  :group 'mew-summary
  :type '(choice (const nil) (repeat string)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Mode names
;;;

(defvar mew-mode-name-header  "Header")
(defvar mew-mode-name-draft   "Draft")
(defvar mew-mode-name-message "Message")
(defvar mew-mode-name-summary "Summary")
(defvar mew-mode-name-virtual "Virtual")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Types
;;;


(defvar mew-file-type "MewX")
(defvar mew-file-creator "EMAx")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; For broken MUAs
;;;

(defcustom mew-decode-broken t
  "If non-nil, Mew decode broken messages.

\(1) Decode quoted encoded-words, which violates RFC 2047.

Good example:
	From: Kazu Yamamoto (=?ISO-2022-JP?B?GyRCOzNLXE9CSScbKEI=?=)
		<kazu@example.org>
Bad example:
	From: Kazu Yamamoto (\"=?ISO-2022-JP?B?GyRCOzNLXE9CSScbKEI=?=\")
		<kazu@example.org>

\(2) Decode raw non-ASCII text, which violates RFC 822.
This is typically found in Subject: field.

Good example:
	Subject: =?iso-2022-jp?B?GyRCJEYkOSRIGyhC?=
Bad example:
	Subject: Raw non-ASCII text.

\(3) Decode invalid MIME parameters, which violates RFC 2231.
\(i)  Raw text.
\(ii) Encorded-word defined in RFC 2047.

Good example:
	Content-Disposition: attachment;
	 filename*=iso-2022-jp''%1B%24B%24F%249%24H%1B%28B

Bad example
	Content-Disposition: attachment;
	 filename=\"=?iso-2022-jp?B?GyRCJEYkOSRIGyhC?=\"

=(4) Decode invalid non-ASCII MIME body, whose charset is US-ASCII or
not present.

Good example:
	Content-Type: text/plain; charset=ISO-2022-jp

	ISO-2022-JP text

Bad example:
	Content-Type: text/plain

	ISO-2022-JP text

\(5) Decode invalid non-ASCII text, whose charset is UTF-8 or not present.

Good example:
	Content-Type: text/plain; charset=ISO-8859-15

	ISO-8859-15 text

Bad example:
	Content-Type: text/plain; charset=UTF-8

	ISO-8859-15 text
"
  :group 'mew-message
  :type 'boolean)

(defcustom mew-use-name-parameter t
  "*If non-nil, the invalid NAME parameter of Content-Type: is checked
as a file name in addition to the legal FILENAME parameter of
Content-Disposition:."
  :group 'mew-message
  :type 'boolean)

(defcustom mew-broken-parameter-list '("name" "filename")
  "*A list of parameter names whose value contains non-ASCII strings
produced by broken MUAs."
  :group 'mew-message
  :type '(repeat string))

(defvar mew-decode-ws-fields '("Subject:"))

(defvar mew-no-warning-fields ()) ;; capitalized

(defvar mew-no-warning-params ()) ;; downcased

(defcustom mew-warning-field-level 1
  "*If warning level of a field is greater than or equal to this value,
the warning is displayed on X-Mew:.
Level 1: syntax is correct, but not recommenced.
Level 2: syntax error."
  :group 'mew-message
  :type 'integer)

(defcustom mew-encode-singlepart-hook nil
  "*Hook called before making a single part."
  :group 'mew-draft
  :type 'hook)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Preventing warning messages when byte-compiling
;;;

(defvar mew-regex-message-files  nil)
(defvar mew-regex-message-files2 nil)
(defvar mew-regex-message-files3 nil)
(defvar mew-regex-message-files4 nil)
(defvar mew-regex-message-files5 nil)

(defvar mew-basic-folders nil)

(provide 'mew-vars)

;;; Copyright Notice:

;; Copyright (C) 1996-2012 Mew developing team.
;; All rights reserved.

;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
;; 1. Redistributions of source code must retain the above copyright
;;    notice, this list of conditions and the following disclaimer.
;; 2. Redistributions in binary form must reproduce the above copyright
;;    notice, this list of conditions and the following disclaimer in the
;;    documentation and/or other materials provided with the distribution.
;; 3. Neither the name of the team nor the names of its contributors
;;    may be used to endorse or promote products derived from this software
;;    without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
;; PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

;;; mew-vars.el ends here