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 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979
|
\input texinfo @c -*-texinfo-*- -*- coding: iso-latin-1 -*-
@c %**start of header
@documentencoding ISO-8859-1
@setfilename bbdb.info
@settitle Insidious Big Brother Database User Manual
@c %**end of header
@c
@c $Id: bbdb.texinfo,v 1.9 2005-07-24 15:23:05 waider Exp $
@c
@ifinfo
@dircategory Emacs
@direntry
* BBDB: (bbdb). The Insidious Big Brother Database.
@end direntry
This file documents the Insidious Big Brother Database
This is edition $Revision: 1.9 $ of the BBDB User Manual for BBDB
version 2.34.
Copyright (c) 1991-1994 Jamie Zawinski <jwz@@netscape.com>
Copyright (c) 1997-1999 Matt Simmons <simmonmt@@acm.org>
Copyright (c) 2000-present The BBDB Development Team
@end ifinfo
@titlepage
@title BBDB User Manual
@subtitle A phone number and address database program for Emacs
@subtitle Edition $Revision: 1.9 $, $Date: 2005-07-24 15:23:05 $
@author by Jamie Zawinski, Matt Simmons and the BBDB Development Team
@page
Copyright @copyright{} 1991-1994 Jamie Zawinski <jwz@@netscape.com>
Copyright @copyright{} 1997-1999 Matt Simmons <simmonmt@@acm.org>
Copyright @copyright{} 2000-present The BBDB Development Team
@sp 2
This is edition $Revision: 1.9 $ of the @cite{BBDB User Manual} for BBDB
version 2.34, $Date: 2005-07-24 15:23:05 $.@refill
@sp 2
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on fnord all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the author.
@end titlepage
@page
@node Top, Installation,,_
@chapter BBDB
@b{BBDB} is a rolodex-like database program for GNU Emacs. @b{BBDB} stands
for @b{@i{Insidious Big Brother Database}}, and is not, repeat, @emph{not} an
obscure reference to the Buck Rogers TV series.
It provides the following features:
@itemize @bullet
@item
Integration with mail and news readers, with little or no
interaction by the user: @refill
@itemize @bullet
@item
easy (or automatic) display of the record corresponding to the sender of
the current message; @refill
@item
automatic creation of records based on the contents of the current
message; @refill
@item
automatic addition of data to arbitrary fields of the record
corresponding to the sender of the current message. @refill
@end itemize
@item
Listing all records which match a regular expression;
@item
Listing all records which match a regular expression in a particular
field (@samp{company} or @samp{notes,} for example); @refill
@end itemize
@menu
* Installation:: Installation
* The BBDB:: Overview
* BBDB Mode:: BBDB Mode
* Interfaces:: Interfaces to various readers
* Reader-specific Features:: Features only available to specific readers
* Other Packages:: Using the BBDB with other packages
* Options:: Options
* Utilities:: Utilities
* Internals:: BBDB Internals
* Mailing Lists:: The BBDB mailing lists
* Changes:: New in this version
* The Latest Version:: Where to Get It
* The Future:: Known Bugs, the TODO list and EOL statements
* Thanks:: to the Ministry of Bugs
* Concept Index:: Concept Index
* Variable Index:: Variable Index
@detailmenu
--- The Detailed Node Listing ---
Installation
* General Prerequisites:: General @b{BBDB} requirements
File Installation
* Normal User:: "Normal" Installations
* XEmacs Package:: Installing as an XEmacs package
Initial Configuration
* Initial Configuration:: How to initially set up the @b{BBDB}
Manual initialization
* Gnus Prep:: Initializing @b{BBDB} support for Gnus
* MH-E Prep:: Initializing @b{BBDB} support for MH-E
* RMAIL Prep:: Initializing @b{BBDB} support for RMAIL
* Sendmail Prep:: Initializing @b{BBDB} support for Sendmail
* VM Prep:: Initializing @b{BBDB} support for VM
Other packages:
* Message Prep:: Initializing @b{BBDB} support for Message mode
* Reportmail Prep:: Initializing @b{BBDB} support for Reportmail
* Supercite Prep:: Initializing @b{BBDB} support for Supercite
* Web Browser Prep:: Initializing @b{BBDB} support for Web Browsers
The @b{BBDB}
* Database Fields:: Description of database fields
* Basic Searching:: Basic database searching commands
* Advanced Searching:: Advanced database searching commands
* Manual Record Addition:: Adding records by hand
Interfaces
* Mail Reading Interfaces:: Mail Reading Interfaces
* News Reading Interfaces:: News Reading Interfaces
* Mail Sending Interfaces:: Mail Sending Interfaces
Reader-specific Features
* Gnus Features:: Gnus-specific Features
* VM Features:: VM-specific Features
Gnus-specific Features
* Gnus Scoring:: Store score adjustments in the @b{BBDB}
* Gnus Summary Buffer:: @b{BBDB} information in the Summary buffer
* GNUS Subject List:: @b{BBDB} information in the Subject List
VM-specific features
* VM Message Summary:: @b{BBDB} information in message summary
Using the @b{BBDB} with other packages
* Using Message Mode:: Using the @b{BBDB} with Message Mode
* Using Reportmail:: Using the @b{BBDB} with Reportmail
* Using Supercite:: Using the @b{BBDB} with Supercite
* Using Web Browsers:: Using the @b{BBDB} with Web Browsers
Options
* Customization Parameters:: Customization Parameters
* Customization Hooks:: Customization Hooks
* Predefined Hooks:: Predefined Hooks
Utilities
* bbdb-ftp:: Storing FTP sites in the @b{BBDB}
* bbdb-print:: Print the @b{BBDB}
* bbdb-snarf:: Record generation from raw text
* bbdb-srv:: External control of the @b{BBDB}
Changes in this Version
* Major Changes:: Major changes in this version
* Other Changes:: Not-so-major changes
The Future
* Known Bugs:: Known Bugs, and how to submit new ones
* TODO List:: The TODO List
* EOL Statements:: EOL (End Of Life) Statements
_
* Top::
@end detailmenu
@end menu
@node Installation, The BBDB, Top, Top
@section Installation
@cindex Installation
@cindex Makefile
This program consists of several groups of files, organized by
directory:
@ifinfo
@example
lisp - the main program code for the @b{BBDB}
tex - TeX support files for @xref{bbdb-print}, the @b{BBDB}
printing utility
texinfo - the documentation files for the @b{BBDB}
utils - miscellaneous external utility programs
misc - things that don't fall into the above categories
bits - things that have been written as add-ons for @b{BBDB}
but have not yet been merged with the main codebase
@end example
@end ifinfo
@iftex
@bgroup@tableindent=1.5in
@table @b
@item lisp
the main program code for the BBDB
@item tex
@TeX@ support files for bbdb-print, the BBDB printing utility
@item texinfo
the documentation files for the BBDB
@item utils
miscellaneous external utility programs
@item bits
things that have been written as add-ons for @b{BBDB} but have not yet
been merged with the main codebase
@end table
@egroup
@end iftex
@menu
* General Prerequisites:: General @b{BBDB} requirements
File Installation
* Normal User:: "Normal" Installations
* XEmacs Package:: Installing as an XEmacs package
Initial Configuration
* Initial Configuration:: How to initially set up the @b{BBDB}
@end menu
@node General Prerequisites, Normal User, Installation, Installation
@subsection General Prerequisites
Various parts of the @b{BBDB} require extra packages to be available
that are not part of the @b{BBDB} distribution. Please note that with
one exception no extra packages (beyond those which ship with both GNU
Emacs and XEmacs) are required for the use of @b{BBDB} core
functionality.@footnote{"Core Functionality" is defined as the parts of
the @b{BBDB} used to implement basic record creation (@samp{M-x
bbdb-create}) and searching (@samp{M-x bbdb}).} This one exception
applies to XEmacs 20.5 users - the @code{xemacs-base} package must be
installed for the correct operation of the core @b{BBDB} functionality.
The table below lists the requirements of the various portions of the
@b{BBDB}. Please note that the absence of any of the below optional
packages will not affect core @b{BBDB} functionality.
@multitable {bbdb-reportmail } {Package needed} {GNU 19.34} {GNU 20.2} {XEmacs} {XEmacs}
@item @* BBDB file
@tab @* Package needed
@tab @* GNU 19.34
@tab @* GNU 20.2
@tab XEmacs@* @center >=20.4
@tab XEmacs@* @center 20.5
@item @code{bbdb-ftp}
@tab EFS or @* Ange-FTP
@tab @center B
@tab @center B
@tab @center B
@tab @center P
@item @code{bbdb-gnus}
@tab Gnus[1]
@tab @center B
@tab @center B
@tab @center B
@tab @center P
@item @code{bbdb-mhe}
@tab MH-E
@tab @center B
@tab @center B
@tab @center B
@tab @center P
@item @code{bbdb-reportmail}
@tab Reportmail
@tab
@tab
@tab @center B
@tab @center P[2]
@item @code{bbdb-sc}
@tab Supercite
@tab @center B
@tab
@tab @center B
@tab @center P
@item @code{bbdb-srv}
@tab @code{gnuserv} and @* @code{itimer}
@tab
@tab
@tab @center B
@tab @center B
@item @code{bbdb-vm}
@tab VM[4]
@tab
@tab
@tab @center B
@tab @center P
@item @code{bbdb-w3}
@tab @code{browse-url}
@tab @center B
@tab @center B
@tab @center B
@tab @center P[3]
@end multitable
@*
@noindent
@b{NOTES:}
@enumerate
@item
The old GNUS mail/newsreader should still work. Please keep in mind
that you have a relatively recent Emacs (GNU 19.34 or later, XEmacs
19.15 or later), you are probably using Gnus.
@item
As of this writing, Reportmail is available as
part of the @code{edit-utils} package.
@item
As of this writing, @code{browse-url} is
available as part of the @code{mail-lib} package.
@item
The source release of VM is currently required due to the use of macros
from the VM codebase in @b{BBDB}'s VM integration.
@end enumerate
Please also note that the XEmacs package locations are as of this
writing. As the XEmacs 20.5 package system is still in development, the
locations may change without warning.
@node Normal User, XEmacs Package, General Prerequisites, Installation
@subsection Normal User Installation
@cindex Normal User Installation
@subheading Configuring the compilation process
First of all, you should run the @code{configure} script at the toplevel
of the distribution. This script will perform a number of checks on
your system and generate the @file{Makefile}'s accordingly.
The @code{configure} script also comes with a number of options that
lets you customize the compilation process. These options are described
below where appropriate.
@subheading Byte Compiling the Lisp files
First, you need to byte-compile the appropriate @b{BBDB} Lisp files.
While this is in theory an optional step, it is virtually required in
practice due to speed reasons.
In order to byte-compile the lisp files, an Emacs of some sort must be
used. By default (at @code{configure} time), @code{emacs} and
@code{xemacs} will be tried in that order. If you want to use a special
Emacs flavor (or if you want to use @code{xemacs} at the first place),
you should pass the @code{--with-emacs=PROG} option to @code{configure}.
In order to successfully compile the @b{BBDB}, the build process also
needs to know the location of the various optional packages. If the
directories containing these optional packages are in the default Emacs
search path (the @code{load-path} variable), no other changes need be
made for the build process to complete successfully.
If the optional packages are not in the default search path, the build
process will not find them unless explicitly told of their location(s).
To tell the build process where to find Gnus, MH-E, and/or VM, use the
@code{configure} options @code{--with-gnus-dir=DIR},
@code{--with-mhe-dir=DIR}, and/or @code{--with-vm-dir=DIR} variables
respectively. To tell the build process where to find any other
package(s), pass the directories containing the lisp files for the
package(s) to the @code{configure} option @code{--with-other-dirs=DIRS}.
If multiple directories are to be added, they should be separated by
spaces or colons, and should @b{not} be quoted. For example, to
add the @file{/p/local/elisp/footnote} and @file{/p/local/elisp/sc}
directories, call the @code{configure} script as follows:
@example
@code{configure --with-other-dirs=/p/local/elisp/footnote:/p/local/elisp/sc}
@end example
After configuring, run one of the following commands:
@ifinfo
@example
@code{make bbdb} - Build the core, mailer independent, components
@code{make gnus} - Core components plus @code{Gnus} support
@code{make mhe} - Core components plus @code{MH-E} support
@code{make rmail} - Core components plus @code{RMAIL} support
@code{make vm} - Build the core components with @code{VM} support
@code{make all} - Core components plus support for all mailers
listed above
@end example
@end ifinfo
@iftex
@bgroup@tableindent=1.5in
@table @b
@item @code{make bbdb}
Build the core, mailer independent, components
@item @code{make gnus}
Core components plus @code{Gnus} support
@item @code{make mhe}
Core components plus @code{MH-E} support
@item @code{make rmail}
Core components plus @code{RMAIL} support
@item @code{make vm}
Build the core components with @code{VM} support
@item @code{make all}
Core components plus support for all mailers listed above
@end table
@egroup
@end iftex
You can also combine the above @code{make} commands. For example, to
build the @b{BBDB} with support for @code{Gnus} and @code{VM}, you can
do so by typing:
@example
make gnus vm
@end example
@subheading Moving the files to their final destination
@subsubheading Lisp files
As stated above, the @file{lisp} subdirectory contains the Emacs Lisp source
files for the @b{BBDB}. Therefore, these files must be in the Emacs
@code{load-path}. There are several ways of doing this, three of which are
described below:
@itemize @bullet
@item
Add the @file{lisp} directory from the source distribution to the
@code{load-path}. This will allow you to run the @b{BBDB} in-place. This
method is recommended for normal users or @b{BBDB} developers, especially if
disk usage is an issue. It is @b{not} recommended for site-wide
installations. @refill
@item
Link the @file{lisp} directory into your @file{site-lisp} directory. This is
for a site-wide installation, but it is subject to the following caveat. If you
link the @file{lisp} directory into @file{site-lisp}, you will make life more
difficult for yourself down the road, as you will not be able to make changes to
the source directory (new versions, patches, etc) without having an effect on
other users who now depend on it. This directory will automatically be added to
the @code{load-path} when Emacs starts. @refill
@item
Make a directory whose sole purpose in life is containing the production copies
of the @b{BBDB} source and byte-compiled source files. Either put this
directory under @file{site-lisp} (or put it somewhere else and link it into
@file{site-lisp}). This directory will automatically be added to the
@code{load-path} when Emacs starts. This is the best of the three listed here,
as it allows for a degree of separation between the (possibly changing) source
tree and the production code.
@end itemize
@ifinfo
@subsubheading TeX files
The @file{tex} subdirectory contains the TeX support files for
bbdb-print, the @b{BBDB} printing utility (@xref{bbdb-print}.). The
three support files, @file{bbdb-cols.tex}, @file{bbdb-print.tex}, and
@file{bbdb-print-brief.tex}, must be placed in a directory that is
either on the default TeX search path or is listed in the
@code{TEXINPUTS} environment variable. If neither of these two options
is taken, TeX will not be able to process the file output by
@code{bbdb-print}.
@end ifinfo
@iftex
@subsubheading @TeX files
The @file{tex} subdirectory contains the @TeX support files for
bbdb-print, the @b{BBDB} printing utility (@xref{bbdb-print}). The three
support files, @file{bbdb-cols.tex}, @file{bbdb-print.tex}, and
@file{bbdb-print-brief.tex}, must be placed in a directory that is
either on the default @TeX search path or is listed in the
@code{TEXINPUTS} environment variable. If neither of these two options
is taken, @TeX will not be able to process the file output by
@code{bbdb-print}.
@end iftex
@subsubheading texinfo files
The @file{bbdb.info} file in this directory contains the documentation
for the @b{BBDB}. This file should either be linked or copied to a
directory on the default path for the @code{info} program or listed in
the @code{INFOPATH} environment variable.
@node XEmacs Package, Initial Configuration, Normal User, Installation
@subsection XEmacs Package Installation
@cindex XEmacs Package Installation
@noindent
@b{NOTE:} XEmacs packages are currently supported only under XEmacs
versions after and including 20.5. If you are not running such a version
of XEmacs, you should install the @b{BBDB} according to the instructions
in @ref{Normal User}.
@subheading Configuring / Byte Compiling
The configuration and byte-compilation procedures are the same as in the
Normal User installation. See @ref{Normal User}.
@subheading Moving the files to their final destination
Support is provided for the automatic installation of the @b{BBDB} in an
XEmacs package directory. The following @code{configure} options are
available for you:
@table @b
@item @code{--with-package-dir=DIR}
This option sets the root of the XEmacs package directory. By default,
@file{/usr/local/lib/xemacs/site-packages} is used.
@item @code{--with-symlinks}
If this option is used, the installation will be done by making symbolic
links to the sources instead of copying the files.
@item @code{--with-linkpath=PATH}
Without this option, the installation process uses the output of
@code{pwd} to determine the current directory. If something else should
be used, you should provide an alternate name for the BBDB toplevel
directory by using @code{--with-linkpath}. If, for example, @code{pwd}
returns @file{/p/local/elisp/bbdb}, but you prefer to use
@file{/usr/local/elisp/bbdb/...} for the links, usr this:
@code{configure --with-linkpath=/usr/local/elisp/bbdb}. This option is
ignored if @code{--with-symlinks} is not used.
@end table
To perform the (un)installation, use the command @code{make (un)install-pkg}.
This will compile the @file{lisp/auto-autoloads.el} file and will
install the appropriate files to the appropriate places. The final
installation tree will take the following form:
@table @code
@item $(PACKAGEDIR)/
@table @code
@item lisp/
@table @code
@item bbdb/
@i{@b{BBDB} lisp source files. This directory contains a copy of all
@code{.el} and @code{.elc} files from the @file{lisp} source directory,
or is a symbolic link to it.}
@end table
@item info/
@table @code
@item bbdb.info*
@i{@b{BBDB} documentation files. These are either copies of the info
files from the @file{texinfo} source directory, or are symbolic links to
them.}
@end table
@item etc/
@table @code
@item bbdb/
@table @code
@item tex/
@i{@b{BBDB} support files for bbdb-print. This directory contains a
copy of the appropriate files from the @file{tex} source directory, or
is a symbolic link to it.}
@item utils/
@i{@b{BBDB} miscellaneous utilities. This directory contains a copy
of the appropriate files from the @file{utils} source directory, or is a
symbolic link to it.}
@end table
@end table
@end table
@end table
@node Initial Configuration, , XEmacs Package, Installation
@subsection Initial Configuration
@cindex Initial Configuration
@findex bbdb-initialize
The simplest way to configure the @b{BBDB} is to include the following
forms in your Emacs configuration file:
@example
@code{(require 'bbdb)}
@code{(bbdb-initialize)}
@end example
@b{Note:} The forms above replace the autoloads needed for previous
versions of the @b{BBDB}.
This will set up the @b{BBDB} for basic querying and record manipulation
(the Core Functionality referred to in the Prerequisites section). It
will not enable any of the mailreader-, newsreader- or other
package-specific @b{BBDB} features. To enable some or all of these
features, the @code{(bbdb-initialize)} form can be enable as shown
below. Alternatively, the features can be enabled manually as described
in the following sections.
@subheading Modifying @code{(bbdb-initialize)}
The @code{bbdb-initialize} function can be used to enable the various
package-specific @b{BBDB} functions. This feature activation is
accomplished through the passing of symbols which tell the function
which features to activate. These symbols are outlined below and in the
Emacs documentation for the @code{bbdb-initialize}@footnote{This
documentation can be accessed by typing @kbd{C-h f bbdb-initialize RET}.}
@subsubheading Initialization symbols for mail and news readers
@table @code
@item gnus
Initialize support for Gnus@footnote{If you are using GNUS (not Gnus),
and if your GNUS version is 3.14 or older, use the @code{Gnus} (note
the capitalization) symbol.}. If you pass the @code{gnus} symbol, you should
probably also pass the @code{message} symbol.
@item mh-e
Initialize support for the MH-E mail reader.
@item rmail
Initialize support for the RMAIL mail reader.
@item sendmail
Initialize support for sendmail (@kbd{M-x mail})
@item vm
Initialize support for the VM mail reader.@footnote{For the VM
initialization to work properly, you must either call
@code{bbdb-initialize} with the @code{vm} symbol from within your VM
initialization file (@file{~/.vm}), or you must call
@code{bbdb-insinuate-vm} manually from within your VM initialization
file.}
@end table
@subsubheading Initialization symbols for other packages
@table @code
@item message
Initialize support for Message mode (the mail composition program
included with Gnus).
@item reportmail
Initialize support for the Reportmail mail notification package.
@item sc
Initialize support for the Supercite message citation package.
Additional initialization is required for Supercite to work with the
@b{BBDB}. @xref{Supercite Prep}.
@item w3
Initialize support for Web browsers.
@end table
@subsubheading Initialization example
To initialize support for Gnus 5.5, Message mode, Supercite, and Web
browsers, the following forms would be used:
@example
(require 'bbdb)
(bbdb-initialize 'gnus 'message 'sc 'w3)
@end example
@subsubheading Manual initialization
If your initialization needs exceed those provided by
@code{bbdb-initialize}, refer to the following sections for a
description of the procedures necessary for enabling @b{BBDB} support
for the packages listed above. The procedures described are the same as
those carried out by the @code{bbdb-initialize} function when passed the
appropriate symbols. That is, the procedure listed in the RMAIL Prep
section below is the same as than executed by @code{bbdb-initialize}
when the @code{rmail} symbol is passed.
@menu
Mail and News readers:
* Gnus Prep:: Initializing @b{BBDB} support for Gnus
* MH-E Prep:: Initializing @b{BBDB} support for MH-E
* RMAIL Prep:: Initializing @b{BBDB} support for RMAIL
* Sendmail Prep:: Initializing @b{BBDB} support for Sendmail
* VM Prep:: Initializing @b{BBDB} support for VM
Other packages:
* Message Prep:: Initializing @b{BBDB} support for Message mode
* Reportmail Prep:: Initializing @b{BBDB} support for Reportmail
* Supercite Prep:: Initializing @b{BBDB} support for Supercite
* Web Browser Prep:: Initializing @b{BBDB} support for Web Browsers
@end menu
@node Gnus Prep, MH-E Prep, Initial Configuration, Initial Configuration
@subsubsection Initializing @b{BBDB} support for Gnus
To take advantage of the @b{Gnus} features of the @b{BBDB}, add one of
the following forms to your Emacs configuration file: @refill
@noindent
For Gnus 3.14 or older:
@code{(add-hook 'gnus-Startup-hook 'bbdb-insinuate-gnus)}
@noindent
For Gnus 3.15 or newer:
@code{(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)}
@code{bbdb-insinuate-gnus} adds bindings for the default keys to
@b{Gnus} and configures @b{Gnus} to notify the @b{BBDB} when new
messages are loaded. This notification is required if the @b{BBDB} is
to be able to display @b{BBDB} entries for messages displayed in
@b{Gnus}.
@node MH-E Prep, RMAIL Prep, Gnus Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for MH-E
To take advantage of the @b{MH-E} features of the @b{BBDB}, add the
following form to your Emacs configuration file: @refill
@example
(add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh)
@end example
@code{bbdb-insinuate-mh} adds bindings for the default keys to
@b{MH-E} and configures @b{MH-E} to notify the @b{BBDB} when new
messages are loaded. This notification is required if the @b{BBDB} is
to be able to display @b{BBDB} entries for messages displayed in
@b{MH-E}.
@node RMAIL Prep, Sendmail Prep, MH-E Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for RMAIL
To take advantage of the @b{RMAIL} features of the @b{BBDB}, add the
following form to your Emacs configuration file: @refill
@example
(add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)
@end example
@code{bbdb-insinuate-rmail} adds bindings for the default keys to
@b{RMAIL} and configures @b{RMAIL} to notify the @b{BBDB} when new
messages are loaded. This notification is required if the @b{BBDB} is
to be able to display @b{BBDB} entries for messages displayed in
@b{RMAIL}.
@node Sendmail Prep, VM Prep, RMAIL Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for Sendmail
To take advantage of send-mail-mode (the one invoked with @code{M-x
mail}) features of the @b{BBDB}, add the following form to your Emacs
configuration file: @refill
@example
(add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
@end example
@code{bbdb-insinuate-sendmail} enables auto-completion in
send-mail-mode.
@node VM Prep, Message Prep, Sendmail Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for VM
To take advantage of the @b{VM} features of the @b{BBDB}, either add
@code{'vm} to the parameters of the @code{(bbdb-initialize)} form, or
add the following form to your @file{~/.vm} file:
@example
@code{(bbdb-insinuate-vm)}
@end example
@code{bbdb-insinuate-vm} adds bindings for the default keys to @b{VM}
and configures @b{VM} to notify the @b{BBDB} when new messages are
loaded. This notification is required if the @b{BBDB} is to be able to
display @b{BBDB} entries for messages displayed in @b{VM}.
@node Message Prep, Reportmail Prep, VM Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for Message mode
To allow the @b{BBDB} to be used in Message mode, add the following form
to your Emacs initialization file:
@example
@code{(bbdb-insinuate-message)}
@end example
@code{bbdb-insinuate-message} adds a binding for @kbd{M-TAB} to Message
mode. This will enable completion of addressees based on @b{BBDB}
records. See @ref{Using Message Mode} for more details on the operation
of Message mode @b{BBDB} record completion.
@node Reportmail Prep, Supercite Prep, Message Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for Reportmail
To allow the Reportmail package to report information from @b{BBDB}
records for new mail, add the following form to your Emacs
initialization file:
@example
@code{(bbdb-insinuate-reportmail)}
@end example
@code{bbdb-insinuate-reportmail} adds to the
@code{display-time-get-field} function to allow access to @b{BBDB}
records during new mail information display. See @ref{Using Reportmail}
for more details on the operation of Reportmail with the @b{BBDB}.
@node Supercite Prep, Web Browser Prep, Reportmail Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for Supercite
To allow the @b{BBDB} to assist in the storage of Supercite citations,
add the following form to your Emacs initialization file:
@example
@code{(bbdb-insinuate-sc)}
@end example
@code{bbdb-insinuate-sc} adds @b{BBDB} functions to two Supercite hooks
- @code{sc-post-hook} and @code{sc-attribs-postselect-hook}. See
@ref{Using Supercite} for more details on the operation of Supercite
citation management using the @b{BBDB}.
Three other Supercite variables must be set/modified to allow the
@b{BBDB} to work with it. These variables are not automatically set as
it would be impossible to reliably set them without interfering with
other user customizations. The modifications are:
@table @code
@item sc-preferred-attribution-list
@code{"sc-consult"} should be added to the list. An example
configuration is:
@example
(setq sc-preferred-attribution-list
'("sc-lastchoice" "x-attribution" "sc-consult"
"initials" "firstname" "lastname"))
@end example
@item sc-attrib-selection-list
The following form should be added to @code{sc-attrib-selection-list}:
@example
'(("sc-from-address"
((".*" . (bbdb/sc-consult-attr
(sc-mail-field "sc-from-address"))))))
@end example
@item sc-mail-glom-frame
The following form should be added to @code{sc-mail-glom-frame}, to
allow the retrieval of the name of a person who is a) in the @b{BBDB}
and b) has only included their net address in the message in question.
@example
("^$" (progn (bbdb/sc-default)
(list 'abort '(step . 0))))
@end example
An example configuration is as follows:
@example
@exdent @code{(setq sc-mail-glom-frame}
@exdent @code{ '((begin (setq sc-mail-headers-start (point)))}
@exdent @code{ ("^x-attribution:[ \t]+.*$" (sc-mail-fetch-field t) nil t)}
@exdent @code{ ("^\\S +:.*$" (sc-mail-fetch-field) nil t)}
@exdent @code{ ("^$" (progn (bbdb/sc-default)}
@exdent @code{ (list 'abort '(step . 0))))}
@exdent @code{ ("^[ \t]+" (sc-mail-append-field))}
@exdent @code{ (sc-mail-warn-if-non-rfc822-p (sc-mail-error-in-mail-field))}
@exdent @code{ (end (setq sc-mail-headers-end (point)))))}
@end example
@end table
The above is also documented in @file{bbdb-sc.el}. The
@code{bbdb/sc-setup-variables} function has been provided as an example for
Supercite variable initialization. Please note that while
@code{bbdb/sc-setup-variables} makes every attempt to safely configure
the Supercite variables, it will not always work. Specifically, the
variables @code{sc-attrib-selection-list} and @code{sc-mail-glom-frame}
will not be overridden if they have already been defined.
@node Web Browser Prep, , Supercite Prep, Initial Configuration
@subsubsection Initializing @b{BBDB} support for Web Browsers
To allow URLs to be added to @b{BBDB} records, add the following form to
your Emacs initialization file:
@example
@code{(bbdb-insinuate-w3)}
@end example
@code{bbdb-insinuate-w3} adds the definition of @kbd{:} to the W3
keymap.
The other @code{bbdb-w3} functions, specifically the passing of URLs
from @b{BBDB} records to Web browsers, do not require initialization
within the @b{BBDB}. They do, however, require the configuration of the
@code{browse-url} package so it knows to which Web browser URLs are to
be passed. For more details on the operation of @code{bbdb-w3}, see
@ref{Using Web Browsers}.
@node The BBDB, BBDB Mode, Installation, Top
@section The @b{BBDB}
This section discusses the basics of the @b{BBDB} - an overview of the
database's layout, and a discussion of the basic @b{BBDB} manipulation
commands.
The database itself lives in a file which is named by the variable
@code{bbdb-file}. If this variable is not set, the database is assumed
to be in @file{~/.bbdb}.
@menu
* Database Fields:: Description of database fields
* Basic Searching:: Basic database searching commands
* Advanced Searching:: Advanced database searching commands
* Manual Record Addition:: Adding records by hand
@end menu
@node Database Fields, Basic Searching, The BBDB, The BBDB
@subsection Database Fields
The database is organized as a set of records, where each record
corresponds to one person or organization. Each record has several
fields, and each field is of one of several types. Below, the built-in
types are listed, followed by a description of how and why some types
can be used more than once in a single record: @refill
@cindex Builtin field types
@multitable @columnfractions .1 .5 .4
@item Type
@tab Description
@tab Notes
@item @code{name}
@tab The name of this person, or none if the record corresponds to an
organization.
@tab Single value, single instance.
@item @code{company}
@tab The name of this person's organization, or none.
@tab Single value, single instance.
@item @code{AKA}
@tab A list of other names for this person.
@tab Multiple values through commas.
@item @code{net}
@tab A list of this person's network addresses.
@tab Multiple values through commas.
@item @code{address}
@tab A list of postal (physical) addresses for this person.
@tab Multiple values through multiple occurences.
@item @code{phone}
@tab A list of telephone numbers for this person.
@tab Multiple values through multiple occurences.
@item @code{notes}
@tab Random commentary.
@tab Multiple values through multiple occurences.
@end multitable
The field types listed above can be classified into four categories, as
indicated by the comments in the `Notes' column.
Field types marked as "Single value, single occurrence" may only occur
once per record. Each occurrence can only have a single value. For
example, there will be only one field of type @code{name} in a record.
It will be named @code{name}, and will contain a single value (the
person's name).
The types marked as "Multiple values through commas" are essentially the
same as the single value, single occurrence field types, but with one
crucial difference: they can contain multiple values in the form of a
comma-separated list. So, for example, while a @code{name} field with a
value of "foo, bar" would be treated as if it contained the single value
"foo, bar", a @code{net} field with the same data would be thought of as
having two separate values - "foo" and "bar". As in the single
occurrence, single value field types, there will be only one occurrence
of each "Multiple values through commas" field type, and the occurrence
will have the same name as the type.
The "Multiple values through multiple occurrences" field type is the
most flexible of the four listed here. There can be multiple
occurrences of each type. This type necessarily does not have the name
restriction imposed by the previous two types. For example, there can
be multiple fields of the @code{address} type, none of which have to be
named @code{address}. One could be named @code{home}, and the other
could be named @code{work}.
Special properties of the @code{notes} field type: All user-defined
fields that don't fit into the other predefined field types
(@code{name}, @code{company}, @code{AKA}, @code{net}, @code{address},
and @code{phone}) will be created as a @code{notes}-type field. In
addition, several of the user-defined field names are "special". That
is, the @b{BBDB} treats the values of these "special" fields differently
than it does other user-defined fields. The "special" fields are:
@cindex Special Field Names
@table @code
@item attribution
@vindex bbdb/sc-attribution-field
@i{(Available only when the Supercite-specific @b{BBDB} functions have been
enabled)} Used for the storage of Supercite attributions. For initialization
details, see @ref{Supercite Prep}. For usage details, see @ref{Using
Supercite}. The field used can be changed by changing the value of
@code{bbdb/sc-attribution-field}.
@item aka
Used to store non-primary names associated with a given record.
@item face
@i{(XEmacs only)} Used for the storage of image data. This data is to be
in the format output by @code{compface}, and commonly found in
@code{X-Face:} headers in messages. If face support has been compiled
into XEmacs, the image contained in the @code{face} header will be
displayed when the record is viewed.
@item finger-host
@vindex bbdb-finger-host-field
Address used in place of the listed net address for fingering the entity
indicated by the record. @xref{BBDB Mode}. The field used can be changed by
changing the value of @code{bbdb-finger-host-field}.
@item gnus-score
@vindex bbdb/gnus-score-field
@b{Gnus} scoring adjustment for this person. For initialization details, see
@ref{Gnus Prep}. For usage details, see @ref{Gnus Features}. The field used
can be changed by changing the value of @code{bbdb/gnus-score-field}.
@item mail-alias
@cindex mail-alias definition
Value used instead of @code{name} for completion. @xref{Mail Sending
Interfaces}.
@item mail-name
@i{(Available only when the Reportmail-specific @b{BBDB} functions have been
enabled)} Used for the storage of non-default names to be used in the
reporting of new mail by Reportmail. For initialization details,
see @ref{Reportmail Prep}. For usage details, see @ref{Using Reportmail}.
@item mark-char
The field containing the character to be used for marking a given poster
in the Gnus Summary Buffer. For usage details, see @ref{Gnus Summary Buffer}.
@item tex-name
@cindex Printing records in the database
@findex bbdb-print
The value of this field is used in place of the @code{name} field when
printing the database using @code{bbdb-print}. @xref{bbdb-print}.
@item www
This field contains the URL associated with the @b{BBDB} record. Common uses
are with @code{bbdb-snarf} (@pxref{bbdb-snarf}) and the @b{BBDB}/Web Browser
functionality (for initialization details, see @ref{Web Browser Prep}. For
usage details, see @ref{Using Web Browsers}).
@end table
@node Basic Searching, Advanced Searching, Database Fields, The BBDB
@subsection Basic searching commands
You can list the contents of the database with the command
@w{@kbd{M-x bbdb}}. You will be prompted for a regular expression, and all
records which match that regexp in the name, company, network address,
or any notes fields will be displayed.@refill
@cindex Searching the database
@findex bbdb
@findex bbdb-name
@findex bbdb-company
@findex bbdb-net
@findex bbdb-notes
A narrower search may be made by using the commands @kbd{bbdb-name},
@kbd{bbdb-company,} @kbd{bbdb-net,} or @kbd{bbdb-notes}. These commands
limit their searches to the name, company, email address, and notes
fields, respectively. If these commands are given a prefix argument,
the listing displayed will be one line per entry; otherwise, the full
database entry will be shown on multiple lines.
The functions described above are predefined to certain keys in the
@code{*BBDB*} buffer. @xref{BBDB Mode}. for more details.
@cindex User-defined fields
The @code{bbdb-notes} command will prompt for the notes field to search
(@kbd{RET} for all). In this way you can limit your searches to the
contents of one particular user-defined notes field. (You can add
user-defined fields with the @code{bbdb-insert-new-field} command;
@xref{BBDB Mode}.)@refill
@cindex Elided display
@cindex One-line display
@node Advanced Searching, Manual Record Addition, Basic Searching, The BBDB
@subsection Advanced searching commands
The following functions can be used to search for records based on
creation and/or modification dates. These functions will match records
that have @code{timestamp} and/or @code{creation-date} fields (as
appropriate. @xref{Predefined Hooks}. for more information on these
fields, which are created by default.
@table @code
@findex bbdb-timestamp-older
@item bbdb-timestamp-older
Display all records modified before a given date. If this function is
called interactively, it will prompt for a date. If it is being called
non-interactively, the date should be provided as a string in
@samp{yyyy-mm-dd} format.
@findex bbdb-timestamp-newer
@item bbdb-timestamp-newer
Display all records modified after a given date. If this function is
called interactively, it will prompt for a date. If it is being called
non-interactively, the date should be provided as a string in
@samp{yyyy-mm-dd} format.
@findex bbdb-creation-older
@item bbdb-creation-older
Display all records created before a given date. If this function is
called interactively, it will prompt for a date. If it is being called
non-interactively, the date should be provided as a string in
@samp{yyyy-mm-dd} format.
@findex bbdb-creation-newer
@item bbdb-creation-newer
Display all records created after a given date. If this function is
called interactively, it will prompt for a date. If it is being called
non-interactively, the date should be provided as a string in
@samp{yyyy-mm-dd} format.
@findex bbdb-creation-no-change
@item bbdb-creation-no-change
Display all records that have not been changed since creation.
@end table
@node Manual Record Addition, , Advanced Searching, The BBDB
@subsection Manual record addition
There are several ways to add new entries to the Insidious Big Brother
Database; the most straightforward is to use @w{@kbd{M-x bbdb-create}},
which will prompt you for all relevant information. However, the
easiest way is to allow them to be added automatically by one of the
mail or news-reading interfaces (@xref{Interfaces}.). @refill
@cindex Creating new records
@cindex Adding new records
There is als @w{@kbd{bbdb-snarf}} (@xref{bbdb-snarf}), which will
attempt to create a record from a text block. Note that this depends
on particular formatting and may not do exactly what you want.
@node BBDB Mode, Interfaces, The BBDB, Top
@section BBDB Mode
@subsection Functions bound to keys in @b{BBDB} Mode
When the @samp{*BBDB*} buffer is active (either summoned by one of the
commands in the previous section [@xref{The BBDB}.] or by your mail
or news program), a variety of commands become available for database
manipulation. Some of the commands listed below take numeric arguments.
These arguments can be generated by entering the number before pressing
the key(s) corresponding to the desired command. The output (if any) of
the listed commands will be displayed in the @samp{*BBDB*} buffer, and
can be navigated through using the usual cursor motion commands.
@cindex BBDB Mode
@cindex *BBDB* buffer
@table @kbd
@item e
@findex bbdb-edit-current-field
@cindex Editing fields
@cindex Changing fields
(@code{bbdb-edit-current-field}) Edit the field on the current line. If
the cursor is in the middle of a multi-line field, such as an address or
comments section, then the entire field is edited, not just the current
line. @refill
@item ;
@findex bbdb-edit-notes
(@code{bbdb-edit-notes}) A shortcut for editing the @var{notes} field. @refill
@item d, C-k
@findex bbdb-delete-current-field-or-record
@cindex Deleting fields
@cindex Removing fields
(@code{bbdb-delete-current-field-or-record}) Delete the field on the
current line. If the current line is the first line of a record, the
@b{BBDB} will, after prompting the user, delete the entire record from
the database. This may also be applied to multiple records at once by
@kbd{*}.
@item C-o
@findex bbdb-insert-new-field
@cindex Adding new fields
@cindex Inserting new fields
@cindex User-defined fields
(@code{bbdb-insert-new-field}) Inserts a new field into the current
record. You are prompted (with completion) for the type of field to
insert (@b{phone}, @b{address}, @b{notes}, etc); if the string you type
is not a known field type, you will be asked whether to add a new field
with the entered name of type @code{notes}.
@cindex Phone numbers
@cindex North American phone numbers
@cindex European phone numbers
If you are inserting a new phone-number field, you can control whether
it is a North American or European phone number by providing a prefix
argument. A prefix arg of @kbd{^U} means it's to be a euronumber, and
any other prefix arg means it's to be a a structured North American
number. If no prefix argument is supplied, the style used is controlled
by the variable @code{bbdb-north-american-phone-numbers-p}. @refill
@item C-x C-t
@findex bbdb-transpose-fields
@cindex Reordering fields
@cindex Transposing fields
(@code{bbdb-transpose-fields}) This is like the @code{transpose-lines}
command, but it is for @b{BBDB} fields. If the cursor is on a field of
a @b{BBDB} record, that field and the previous field will be
transposed.@refill
With non-zero numeric argument @var{ARG}, the previous field is moved
past @var{ARG} fields. With argument 0, the field indicated by
@i{point} is interchanged with the one indicated by @i{mark}.
Both fields must be in the same record, and must be of the same basic type
(that is, you can use this command to change the order in which phone-number
fields are listed, but you can't use it to make an address appear before a
phone number; the order of field types is fixed.)@refill
@item n, p
@findex bbdb-next-record
@findex bbdb-prev-record
(@code{bbdb-next-record}, @code{bbdb-prev-record}) Move to the next and
previous displayed record, respectively. @refill
@item t
@findex bbdb-toggle-records-display-layout
(@code{bbdb-toggle-records-display-layout}) Toggles the display layout of a
record. With a numeric argument
of 0, the current record will be made displayed in one line layout; with any
other argument, the current record will be shown in multi-line layout. @refill
If @kbd{*t} is used instead of simply @kbd{t}, then the state of all
records will be changed instead of just the one at point. In this case,
a numeric argument of 0 means that all records will unconditionally be
made one-line layout; any other numeric argument means that all of the records
will unconditionally be shown expanded; and no numeric argument means
that the records are made to be in the opposite state of the record
under point. @refill
@item T
@findex bbdb-display-record-completely
(@code{bbdb-display-record-completely})
Show all the fields of the current record.
The display layout `full-multi-line' is used for this.
@refill
@item o
@findex bbdb-omit-record
(@code{bbdb-omit-record}) Removes the current record from the display,
but does not delete it from the database; it merely makes it seem as if
the most recent search had not matched this record. With a numeric
argument, omit the next N records. With a negative argument, go
backwards. @refill
@item m
@findex bbdb-send-mail
@cindex Sending mail
@vindex bbdb-send-mail-style
(@code{bbdb-send-mail}) Begin composing mail to the person represented
by the current record. The first email address is used. Normally, the
mail-sending package which is used is determined by which mail-reading
package is loaded; that is, if @b{MH-E} is loaded, then @code{mh-send}
will be used; if @b{VM} is loaded, then @code{vm-mail} is used; if
@b{message} is loaded, then it is used; otherwise, @code{mail} is used.
You can override this by setting the variable
@code{bbdb-send-mail-style} to one of the symbols @code{vm}, @code{mh},
@code{message}, or @code{mail}. @refill
If @kbd{*m} is used instead of simply @kbd{m}, then mail will be sent to
all of the folks listed in the @samp{*BBDB*} buffer instead of just the
person under point. @refill
This function does not at present use the facility provided by
@code{compose-mail} and @code{mail-user-agent}. In a future version of
the @b{BBDB}, it will.
@item s, C-x C-s
@findex bbdb-save-db
@cindex Saving your changes
(@code{bbdb-save-db}) Saves the @b{BBDB} file to disk.
@item r
@findex bbdb-refile-record
@cindex Fixing mistakes
@cindex Merging records
(@code{bbdb-refile-record}) Merge the current record into some other record;
that is, delete the record under point after copying all of the data
within it into some other record. this is useful if you realize that
somehow a redundant record has gotten into the database, and you want to
merge it with another. @refill
If both records have names and/or companies, you are asked which to use.
Phone numbers, addresses, and network addresses are simply concatenated.
The first record is the record under the point; the second is prompted
for. Completion behavior is as dictated by the variable
@code{bbdb-completion-type}. @refill
@item M-d
@findex bbdb-dial
@cindex Dialling phone numbers
(@code{bbdb-dial}) This command will attempt to dial the phone number
currently at point, or if point is at the start of a record, the first
phone number in the record. An extension, if present, is disregarded.
@refill
The method of dialling is controlled by @code{bbdb-modem-dial}. If this
variable is nil, the @b{BBDB} will play touchtones corresponding to the
number to be dialled. Otherwise, this variable is treated as a modem
command string to be prepended to the number prior to feeding it to
@code{bbdb-modem-device}. @refill
The @b{BBDB} plays touchtones using @code{bbdb-sound-player} to play the
sounds and the elements of @code{bbdb-sound-files} as the audio to be
played. The first ten elements of @code{bbdb-sound-files} correspond to
the touchtones for the digits @samp{0} to @samp{9}, while the eleventh
and twelfth elements correspond to @samp{#} and @samp{*}
respectively. The default configuration assumes a Solaris[tm]
installation with the demonstration sound files in
@code{/usr/demo/SOUND/sounds}. @refill
The actual number dialled depends on the following variables:
@table @code
@item bbdb-dial-local-prefix-alist
@vindex bbdb-dial-local-prefix-alist
This is a list of (SEXPR REPLACEMENT) pairs. SEXPR is evaluated to
produce a regular expression which is then applied to the number. If it
matches, whatever it matches is replaced by REPLACEMENT. The match and
replace is performed using each item in the list that matches, in
sequence, so that the output from one item may become input to another.
The default value for this variable is to remove
@code{(bbdb-default-area-code)} (i.e. the value of that variable, in
parenthesis) from the start of the number to be dialled.@refill
@b{Note:} If this procedure produces a transformed number then no
further modifications (such as prefix additions, below) will be made to
the number before dialling.@refill
Using a prefix argument to @code{bbdb-dial} disables the processing of
this variable. The other modifiers, below, are not affected by
this.@refill
@item bbdb-dial-local-prefix
@vindex bbdb-dial-local-prefix
If the number to be dialled starts with a zero, it is deemed to be a
local number, and @code{bbdb-dial-local-prefix} is prepended to it (see
note above concerning @code{bbdb-dial-local-prefix-alist} processing,
however).@refill
@item bbdb-dial-long-distance-prefix
@vindex bbdb-dial-long-distance-prefix
If the number to be dialled starts with a plus sign (+), it is deemed to
be a long distance number, and @code{bbdb-dial-long-distance-prefix} is
prepended to it (see note above concerning
@code{bbdb-dial-local-prefix-alist} processing, however).@refill
@end table
@item f
@findex bbdb-finger
@cindex Finger interface
(@code{bbdb-finger}) This command fingers the network address of a
@b{BBDB} record. If this command is executed from the @samp{*BBDB*} buffer,
it fingers the network address of the record which is at point; otherwise,
it prompts in the minibuffer (with completion) for a user to finger. With a
numeric prefix argument, it fingers the @i{N}th network address of the
current record; with a prefix argument of @kbd{^U}, it fingers all of them.
The @samp{*finger*} buffer is filled asynchronously, meaning that you don't
have to wait around for it to finish; but fingering another user before
the first finger has finished could have unpredictable results.@refill
If this command is executed from the @samp{*BBDB*} buffer, it may be prefixed
with @kbd{*} (as in @kbd{*f} instead of simply @kbd{f}), meaning to
finger all of the users currently listed instead of just the one under
point. The numeric prefix argument has the same interpretation. @refill
@vindex bbdb-finger-host-field
You can define a special network address to ``finger'' by defining a field
@code{finger-host}. The name of the field to be fingered can be changed
by setting @code{bbdb-finger-host-field}.
@item q
@findex bbdb-bury-buffer
(@code{bbdb-bury-buffer}) Hides the @samp{*BBDB*} buffer. @b{Note:}
This command does @b{not} kill the @samp{*BBDB*} buffer.
@item ?
@findex bbdb-help
(@code{bbdb-help}) This displays a one-line help message in the
minibuffer, showing some of the most common bbdb-mode commands.
@item i
@findex bbdb-info
(@code{bbdb-info}) This documentation is displayed. Please note that
either @file{bbdb} or @file{bbdb.info} must be installed in one of the
info directories known to Emacs for this command to work.
@table @code
@item bbdb-info-file
@vindex bbdb-info-file
If this documentation is not installed in the standard Info directory,
then you should set this variable to the name of the texinfo-formatted
version of this file; the @code{bbdb-info} command will use this file
instead.@refill
@end table
@item W
@cindex Browsing the Web page for the current record
@findex bbdb-www
(@code{bbdb-www}) Displays the Web page listed in the @code{www} field
of the current record. @xref{Using Web Browsers}.
@item P
@cindex Printing records in the database
@findex bbdb-print
(@code{bbdb-print}) Creates a TeX file that contains a pretty-printed version
of @b{BBDB} records. If prefixed by @kbd{*}, only the records currently
displayed will print. @xref{bbdb-print}.
@item h
@cindex Changing windows
Moves point to another window via the @code{other-window} function.
@item c
@cindex Creating new records
@findex bbdb-create
(@code{bbdb-create}) Create a new database record from information
supplied by the user.
@item C
@cindex Displaying changed records
@findex bbdb-changed
(@code{bbdb-changed}) Display all records that have been changed since
the last time the database was saved.
@item b
@cindex Searching the database
@findex bbdb
(@code{bbdb}) Begin a new database search. The results of the new
search will be displayed in place of the results of the old search.
@item S a, S c, S o, S n
@cindex Searching the database
@findex bbdb-net
@findex bbdb-company
@findex bbdb-notes
@findex bbdb-name
(@code{bbdb-net}, @code{bbdb-company}, @code{bbdb-notes},
@code{bbdb-name})@*
Begin a new database search. This search will be
limited to the net address, company, notes, or name fields,
respectively, of database records. @xref{Basic Searching}. for more
details.
@item *
@findex bbdb-append-records
@code{bbdb-append-records} will make the next display/search
command to append its results to the BBDB buffer instead of replacing its
content.
With an prefix arg (C-u) toggle between always append and no append.
With an prefix arg that is a positive number append will be enabled for that
many times.
With any other argument append will be enabled once."@refill
@end table
@subsection Other database manipulation functions
@table @code
@findex bbdb-kill-older
@item bbdb-kill-older
If called interactively (or with a single argument - a date in
@samp{yyyy-mm-dd} format), it will kill all records that were last
modified before the given date as determined by the @code{timestamp}
field. @xref{Predefined Hooks}. If called non-interactively with a
date (in @samp{yyyy-mm-dd} format), a comparison function and an action
function, the comparison function is applied to the @code{timestamp}
field of all records, and the action function applied to those for whom
the comparison function returns true. If @samp{nil} is supplied as the
comparison function, @code{string-lessp} is used.
@end table
@node Interfaces, Reader-specific Features, BBDB Mode, Top
@section Interfaces
The @b{BBDB} interfaces itself with several message-handling packages, but
certain parameters control its behavior depending on whether it is
being used from within a mail reader or a news reader. @refill
In all of these packages, two new keybindings will be added:
@table @kbd
@item :
@cindex Showing the sender of the current message
@findex bbdb/vm-show-sender
@findex bbdb/rmail-show-sender
@findex bbdb/mh-show-sender
@findex bbdb/gnus-show-sender
(@code{bbdb/@i{package}-show-sender}) Displays the @b{BBDB} entry corresponding
to the author of the current message. If there is none, you will be
asked whether to create one. The function called is
@code{bbdb/@i{package}-show-sender}, where @code{@i{package}} is either
@code{gnus}, @code{mh}, @code{rmail}, or @code{vm}, depending on the
mail or news program being used when the command is invoked.
@item ;
@cindex Annotating the sender of the current message
@findex bbdb/vm-annotate-sender
@findex bbdb/rmail-annotate-sender
@findex bbdb/mh-annotate-sender
@findex bbdb/gnus-annotate-sender
(@code{bbdb/@i{package}-annotate-sender}) Lets you edit the @samp{notes}
field of the @b{BBDB} record corresponding to the sender of the current
message. If there is no record for the current author, you will be
asked whether to create one. The function called is
@code{bbdb/@i{package}-annotate-sender}, where @code{@i{package}} is
either @code{gnus}, @code{mh}, @code{rmail}, or @code{vm}, depending on
the mail or news program being used when the command is invoked.
@end table
These keybindings (and several other features) will not be
available unless you call the appropriate ``insinuation''
function; @xref{Installation}.@refill
It is possible to configure @b{BBDB} so that it automatically creates a
record when it sees a message from a person who is not in the database.
It is also possible to have text automatically added to the notes field
of the corresponding record depending on the contents of the message
headers. @xref{Customization Hooks}.@refill
@menu
* Mail Reading Interfaces:: Mail Reading Interfaces
* News Reading Interfaces:: News Reading Interfaces
* Mail Sending Interfaces:: Mail Sending Interfaces
@end menu
@node Mail Reading Interfaces, News Reading Interfaces, Interfaces, Interfaces
@subsection Mail Reading Interfaces
There are BBDB interfaces for the following mail readers:
@itemize @bullet
@item
@b{Gnus}, a news- and email- reader written by Lars Magne Ingebrigtsen
(based on @b{GNUS} by Mansanobu Umeda).
@item
@b{MH-E}, the Emacs interface to @b{Mail Handler} (@b{MH}), from the
standard emacs library, but packaged separately from XEmacs since
version 20.4.@refill
@item
@b{RMAIL}, from the standard emacs library (packaged separately for
XEmacs users as of 20.4);
@item
@b{View Mail}, by Kyle Jones, version 5.31 or newer;
@end itemize
@node News Reading Interfaces, Mail Sending Interfaces, Mail Reading Interfaces, Interfaces
@subsection News Reading Interfaces
There are BBDB interfaces for the following news readers:
@itemize @bullet
@item
@b{GNUS}, a newsreader written by Masanobu Umeda. @refill
@item
@b{Gnus}, the modern news- and email-reading incarnation of @b{GNUS}.
@b{Gnus} is written by Lars Magne Ingebrigtsen.@refill
@end itemize
@node Mail Sending Interfaces, , News Reading Interfaces, Interfaces
@subsection Mail Sending Interfaces
@findex bbdb-complete-name
@vindex bbdb-dwim-net-address-allow-redundancy
@cindex Name completion
@cindex Mail address completion
@cindex Address completion
@cindex Format of completed address
When sending mail, the keystroke @kbd{M-TAB} is bound to the
function @code{bbdb-complete-name}. This will take the string that
you have typed (from point back to the preceding colon, comma, or
the beginning of the line) and will complete that against the
contents of the database. What you have typed may be an initial
subsequence of a person's full name or network address; if it
completes ambiguously, then what you have typed will be replaced
with the common portion of the matches. Typing @kbd{M-TAB} again will
show a list of possible completions. If it completes unambiguously,
then an address will be inserted. The variable
@code{bbdb-completion-type} controls whether completion is done on real
names, or network addresses, or both. The address inserted is normally
of the form @w{@code{User Name <email-address>}}; however, if
@code{User Name} has an address of the form
@code{<user.name@@somedomain>}, only the @code{<email-address>} portion
is inserted. This can be overridden by setting
@code{bbdb-dwim-net-address-allow-redundancy} to @code{t}. @refill
This binding is automatically set by the various insinuation functions
documented earlier in this manual. (@xref{Initial Configuration}.)
Briefly, the forms for these functions are:
@table @b
@item Gnus
@code{(add-hook 'gnus-Startup-hook 'bbdb-insinuate-gnus)} @i{for Gnus 3.14 or older}@*
@code{(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)} @i{for Gnus 3.15 or newer}
@item MH-E
@code{(add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh)}
@item RMAIL
@code{(add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)}
@item sendmail
@code{(add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)}
@item VM
@code{(bbdb-insinuate-vm)} @i{Add to @file{~/.vm} file}
@end table
@noindent
The above forms should be added to your Emacs initialization file,
except where otherwise noted.
You can control what ``real name'' is inserted with the
@code{mail-alias} field: if a record has a @code{mail-alias}
field, then that is used instead of their @code{name} field.
@vindex bbdb-completion-display-record
If the variable @code{bbdb-completion-display-record} is true (the
default) then when you successfully complete an address with
@kbd{M-TAB}, the corresponding record will be appended to
the @samp{*BBDB*} buffer. The buffer will not be displayed if it
is not already visible, but the record will be displayed there.
@findex bbdb-yank-addresses
@cindex Sending mail
When sending mail, you can use the command @code{bbdb-yank-addresses}
to CC the current message to the people currently displayed in
the @samp{*BBDB*} buffer. This is useful if you are in the midst of
sending or replying to a message, and you decide to add some recipients.
You can use one of the @kbd{M-x bbdb} commands to display the set of
people that you want to CC the message to, and then execute this command
to add them to the list.
@unnumberedsubsec Mailing Lists and Mail Aliases
@cindex Mailing lists
@cindex Mail Aliases
@cindex mail-alias usage
@findex bbdb-define-all-aliases
@findex bbdb-add-or-remove-mail-alias
@findex define-mail-alias
If you are using Jamie Zawinski's @file{mail-abbrevs.el} package, which
uses the word-abbrev mechanism for mail aliases, then you can store your
mail aliases in the BBDB instead of duplicating the information
elsewhere.@refill
If you want a mail alias to be defined for a person, simply add a
@code{mail-alias} field to their record. You may have multiple aliases
for the same person; simply separate them with commas.@refill
For convenience there is the function @code{bbdb-add-or-remove-mail-alias}
bound to @kbd{a} which adds an alias to one or multiple records when prefixed
by a @kbd{*}. Called with a prefix argument @kbd{C-u} it will remove
the given alias.@refill
If more than one person has the same mail-alias, then that alias expands
to the addresses of all of those people; in this way you can maintain
mailing lists within the BBDB.@refill
When you want to group aliases as in @code{.mailrc} you may just
retained the group aliases in your @code{.mailrc}.
To actually define the aliases which are stored in the BBDB, call the
function @code{bbdb-define-all-aliases} from your
@code{mail-setup-hook} (or @code{message-setup-hook} if you use
Message mode coming with Gnus). This will search the database, and
call @code{define-mail-alias} to define each of the resulting
aliases.@refill
@node Reader-specific Features, Other Packages, Interfaces, Top
@section Reader-specific Features
There are features of the @b{BBDB} that are available only for specific
mail- and news-readers. These features are described below.
The headers which are parsed for email addresses and what records are
displayed can be controlled by the following variables:
@vindex bbdb-get-addresses-from-headers
@vindex bbdb-get-addresses-to-headers
@vindex bbdb-get-addresses-headers
@vindex bbdb-get-only-first-address-p
@code{bbdb-get-addresses-from-headers} controls which headers are parsed
for sender addresses when calling the show-sender function of your MUA.
@code{bbdb-get-addresses-to-headers} controls which headers are parsed
for recipients addresses when calling the show-all-recipients function
of your MUA. When using the pop up feature it will search for the
addresses in @code{bbdb-get-addresses-headers} and display them. By
default it will list only the first address, but by setting
@code{bbdb-get-only-first-address-p} to @code{nil} one will will get
records for all addresses.
If there is no MUA specific variable for ignoring certain addresses then
those addresses matching @code{bbdb-user-mail-names} will be ignored.
@b{BBDB} adds the bindings @kbd{:} for showing all senders and @kbd{;}
for editing the notes of the sender.
@menu
* Gnus Features:: Gnus-specific Features
* VM Features:: VM-specific Features
@end menu
@node Gnus Features, VM Features, Reader-specific Features, Reader-specific Features
@subsection Gnus-specific Features
The @b{BBDB} can be used to provide score information, or to integrate
database information into the @b{Gnus} Summary buffer or the @b{GNUS}
Subject List.
@menu
* Gnus Scoring:: Store score adjustments in the @b{BBDB}
* Gnus Summary Buffer:: @b{BBDB} information in the Summary buffer
* GNUS Subject List:: @b{BBDB} information in the Subject List
@end menu
@node Gnus Scoring, Gnus Summary Buffer, Gnus Features, Gnus Features
@subsubsection Scoring
@vindex bbdb/gnus-score-field
@vindex bbdb/gnus-score-default
@vindex gnus-score-find-score-files-function
The @b{BBDB} can provide scoring information to @b{Gnus} in one of two
ways.
@enumerate
@item
Articles whose authors appear in the @b{BBDB} and who have
@code{gnus-score} fields will have their scores adjusted by the value
contained in that field.
@item
Articles whose authors appear in the @b{BBDB} but who do not have
@code{gnus-score} fields will have their scores adjusted by
@code{bbdb/gnus-score-default}. If @code{bbdb/gnus-score-default} is
@code{nil}, no score adjustment will be made.
@end enumerate
The @b{BBDB} by default searches the field contained in
@code{bbdb/gnus-score-field} for score values. To have the @b{BBDB} use
a different field, change the value of this variable.
To enable @b{BBDB}-assisted scoring, add the @code{bbdb/gnus-score}
function to @code{gnus-score-find-score-files-function}. Assuming that
you want to preserve the default value of this variable, use a form
similar to the following:
@example
(setq gnus-score-find-score-files-function
'(gnus-score-find-bnews bbdb/gnus-score))
@end example
@b{Note:} The default value in @b{Gnus} 5.5 is @code{gnus-score-find-bnews}.
Check your configuration before using the above code, as your values may
be different.
@node Gnus Summary Buffer, GNUS Subject List, Gnus Scoring, Gnus Features
@subsubsection Gnus Summary Buffer Enhancements
@b{Gnus} can use the @b{BBDB} to do one of two things:
@itemize @bullet
@item
Mark authors in the Summary Buffer who have records in the @b{BBDB} with
a user-defined mark character. See Marking Posters, below.
@item
For authors in the Summary Buffer who also have records in the @b{BBDB},
replace their name as listed in the Summary Buffer with their name as
stored in the @b{BBDB}. See Using Names from the @b{BBDB}, below.
@end itemize
@subsubheading Marking Posters
Authors with records in the @b{BBDB} can be marked either with a
user-defined mark character, or with a default one. The marking is
enabled by the use of a Gnus user format code, as determined by
@code{bbdb/gnus-summary-in-bbdb-format-letter}. This variable, which
defaults to @samp{b}, is used to create a format code which is intended
for use in @code{gnus-summary-line-format}. The format code is created
by concatenating @samp{%u} with the value of
@code{bbdb/gnus-summary-in-bbdb-format-letter}. In the default case
this results in the creation of the format code @samp{%ub}.
Posts are marked as follows: If the record for the poster has the field
indicated in @code{bbdb-message-marker-field} (the default is
@code{mark-char}), the value of that field is used as the mark
character.@footnote{While it is possible to put a multi-character mark
in @code{bbdb-message-marker-field} and/or in
@code{bbdb/gnus-summary-known-poster-mark}, the resulting summary buffer
will be misaligned as a result. This misalignment will result from fact
that at this time the character used to indicate posts whose authors are
not in the @b{BBDB} is always a single character, and cannot be
changed.} If no such field is present, the value of
@code{bbdb/gnus-summary-known-poster-mark} will be used instead. If the
author is not in the @b{BBDB}, a space will be used as the mark character.
@subsubheading Using Names from the @b{BBDB}
The names reported for authors of posts in the Summary buffer can be
altered to conform to the values present in their respective @b{BBDB}
records (if any). This rewriting is enabled by the use of a Gnus user
format code, as determined by
@code{bbdb/gnus-summary-user-format-letter}. This variable, which
defaults to @samp{B}, is used to create a format code which is intended
for use in @code{gnus-summary-line-format}. The format code is created
by concatenating @samp{%u} with the value of
@code{bbdb/gnus-summary-user-format-letter}. In the default case this
results in the creation of the format code @samp{%uB}. This format code
is intended to @b{replace} the format code previously used in the Summary
buffer format line to indicate the author and/or net address (usually
@samp{%a}, @samp{%n}, and/or @samp{$N}).
The effects of this format code are in two independent parts - the
marking of known posters, and the rewriting of posters names. The
first, the marking of posters, occurs only when
@code{bbdb/gnus-summary-mark-known-posters} is @code{t} (the default)
and the posters have entries in the @b{BBDB}. When this variable is
true, the marking occurs as described in the previous section, Marking
Posters, above.
The poster name rewriting is done for all posters - not just for those
with records in the @b{BBDB}. That said, rewriting rules for posters in
the @b{BBDB} are more flexible than for those not listed. The rewriting is
governed by two variables, as described below.
@code{bbdb/gnus-summary-prefer-real-names} can have one of three values -
@samp{t}, @samp{bbdb}, or @code{nil}. In general, this variable governs
the preference between net addresses and names. If it is @samp{t}, the
name (if any) will be used. If @samp{nil}, the net address will be
used. The third value, @samp{bbdb}, can be used as a method for
distinguishing between authors with records in the @b{BBDB} and those
without. If the variable is set to @samp{bbdb}, the name from the
@b{BBDB} record will be used if the author has a record in the
@b{BBDB}. If the author is not in the @b{BBDB}, the net address from
the message will be printed. This variable makes little sense if
@code{bbdb/gnus-summary-prefer-bbdb-data} is @samp{nil}, as no names
will be printed in the Summary buffer in this case - only net addresses.
@code{bbdb/gnus-summary-prefer-bbdb-data} is used to (dis)allow use of
the @b{BBDB} for author data retrieval. If it is @samp{t}, data from
the @b{BBDB} will be used if available. If it is @samp{nil}, data from
the @b{BBDB} will not be used.
@noindent
In the following examples, assume the following:
@enumerate
@item
Message: @code{From: Jamie <jwz@@netscape.com>}@*
@b{BBDB}: No record
@item
Message: @code{From: Matt <simmonmt@@acm.org>}@*
@b{BBDB}: Name: @samp{Matthew}, Net: @samp{simmonmt@@purdue.edu}
@end enumerate
@multitable @columnfractions .47 .17 .18 .18
@item @code{bbdb/gnus-summary-prefer-bbdb-data}
@tab @center @code{t}
@tab @center @code{t}
@tab @center @code{nil}
@item @code{bbdb/gnus-summary-prefer-real-names}
@tab @center @code{t}
@tab @center @code{bbdb}
@tab @center @code{t}
@item Printed in Summary buffer for
@tab
@tab
@tab
@item @center Case 1
@tab @center Jamie
@tab @center jwz@@netscape.com
@tab @center Jamie
@item @center Case 2
@tab @center Matthew
@tab @center Matthew
@tab @center Matt
@end multitable
@node GNUS Subject List, , Gnus Summary Buffer, Gnus Features
@subsubsection GNUS Summary Buffer Enhancements
@i{This section is remarkably terse, as I don't have a copy of @b{GNUS}.
If anybody can provide more descriptive information, please let me
know.}
@example
(autoload 'bbdb/gnus-lines-and-from "bbdb-gnus")
(setq gnus-optional-headers 'bbdb/gnus-lines-and-from)
@end example
@table @code
@item bbdb/gnus-mark-known-posters
@vindex bbdb/gnus-mark-known-posters
@cindex GNUS Subject-buffer
If @code{t} (the default), then the @b{GNUS} subject list will contain an
indication of those messages posted by people who have entries in
the Insidious Big Brother Database (they will be marked with an
asterisk.) @refill
@cindex mark-char
You can change the character used to mark records on a record-by-record
basis by adding a @code{mark-char} property to the record, whose value
is be the string to display (preferably one character.) @refill
@item bbdb/gnus-header-prefer-real-names
@vindex bbdb/gnus-header-prefer-real-names
Default: @code{nil}. if @code{t}, then the @b{GNUS} subject list will
display real names instead of network addresses. @refill
@item bbdb/gnus-header-show-bbdb-names
@vindex bbdb/gnus-header-show-bbdb-names
Default: @code{t}. If both this variable and
the @code{bbdb/gnus-header-prefer-real-names} variable are true, then
for news messages from people who are in your database, the name displayed
will be the primary name from the database, rather than the one from
the @samp{From:} line of the message. This doesn't affect the names of
people who aren't in the database, of course.@refill
@item bbdb/gnus-lines-and-from-length
@vindex bbdb/gnus-lines-and-from-length
Default: 18. The number of characters used to display @samp{From:} info in
@b{GNUS}, if you have set @code{gnus-optional-headers} to
@code{bbdb/gnus-lines-and-from}. @refill
@end table
@node VM Features, , Gnus Features, Reader-specific Features
@subsection VM-specific features
The @b{BBDB} can be used to integrate database information into the
message summary.
@menu
* VM Message Summary:: @b{BBDB} information in message summary
* VM what records are displayed::
* VM automatic setup of vm-set-auto-folder-alist::
* VM automatic adding of labels::
@end menu
@node VM Message Summary, VM what records are displayed, VM Features, VM Features
@subsubsection VM Message Summary Enhancements
@vindex vm-summary-format
@findex vm-summary-function-B
@cindex %F
@cindex %UB
VM users can cause their summary buffer to display the name of the
message sender according to @b{BBDB} data, instead of according to the
contents of the current message's headers. In VM 5.40 or later, use
the summary format control @code{%UB"} instead of @code{"%F"}, and the
current record name will be shown there if available. If no entry is
found it behaves like @code{"%F"}. See the documentation for
@code{vm-summary-format} for more details. Warning, this may
significantly slow down summary generation for large folders.
@node VM what records are displayed, VM automatic setup of vm-set-auto-folder-alist, VM Message Summary, VM Features
@subsubsection VM configuration of what records the @b{BBDB} buffer shows
@vindex vm-summary-uninteresting-senders
Email addresses which match @code{vm-summary-uninteresting-senders} are
ignored.
The records in the @b{BBDB} buffer are listed in the same order as found.
@node VM automatic setup of vm-set-auto-folder-alist, VM automatic adding of labels, VM what records are displayed, VM Features
@subsubsection VM automatic setup of @code{vm-set-auto-folder-alist}
@vindex bbdb/vm-set-auto-folder-alist-field
VM users can setup the @code{vm-set-auto-folder-alist} automatically by
calling @code{bbdb/vm-set-auto-folder-alist}. This adds for each @b{BBDB}
record containing a @code{bbdb/vm-set-auto-folder-alist-field} an entry
to @code{vm-set-auto-folder-alist}.
The record field can contain a string which is used as folder name or
if it starts with a @code{'} it is treated as lisp expression returning
a folder name.
@node VM automatic adding of labels, , VM automatic setup of vm-set-auto-folder-alist, VM Features
@subsubsection VM automatic adding of labels
@vindex bbdb/vm-auto-add-label-list
@vindex bbdb/vm-auto-add-label-field
@findex bbdb/vm-auto-add-label
@code{bbdb/vm-auto-add-label-list} is a
List used by @code{bbdb/vm-auto-add-label} to automatically label messages.
Each element in the list is either a string or a list of two strings.
If a single string then it is used as both the field value to check for
and the label to apply to the message. If a list of two strings, the first
is the field value to search for and the second is the label to apply.
@code{bbdb/vm-auto-add-label-field bbdb-define-all-aliases-field} is the
field used by @code{bbdb/vm-auto-add-label} to automatically label messages.
Value is either a single symbol or a list of symbols of bbdb fields that
@code{bbdb/vm-auto-add-label} uses to check for labels to apply to messages.
Defaults to @code{bbdb-define-all-aliases-field} which is typically
@code{mail-alias}.
@code{bbdb/vm-auto-add-label} automatically adds labels to messages
based on the @code{bbdb/vm-auto-add-label-field
bbdb-define-all-aliases-field} field. Add this to
@code{bbdb-notice-hook} and if using VM each message that bbdb notices
will be checked. If the sender has a value in the
@code{bbdb/vm-auto-add-label-field} in their BBDB record that matches a
value in @code{bbdb/vm-auto-add-label-list} then a VM label will be
added to the message.
This works great when `bbdb-user-mail-names' is set. As a result mail
that you send to people (and copy yourself on) is labeled as well.
@node Other Packages, Options, Reader-specific Features, Top
@section Using the @b{BBDB} with other packages
The @b{BBDB} adds functionality to several packages. The following sections
detail these augmentations.
@menu
* Using Message Mode:: Using the @b{BBDB} with Message Mode
* Using Reportmail:: Using the @b{BBDB} with Reportmail
* Using Supercite:: Using the @b{BBDB} with Supercite
* Using Web Browsers:: Using the @b{BBDB} with Web Browsers
@end menu
@node Using Message Mode, Using Reportmail, Other Packages, Other Packages
@subsection Using the @b{BBDB} with Message Mode
At this time, the only feature the @b{BBDB} adds to Message mode is the binding
to @kbd{M-TAB} which allows for @b{BBDB} record completion.
@node Using Reportmail, Using Supercite, Using Message Mode, Other Packages
@subsection Using the @b{BBDB} with Reportmail
The @b{BBDB} can modify the @file{reportmail.el} package to use information
from @b{BBDB} records when identifying the senders or recipients of e-mail
messages.
In normal operation, Reportmail displays the name and net address sender and
recipient of incoming messages. The @b{BBDB} can be configured to intercept
and rewrite this information before it appears in the Emacs mode-line. It
first attempts to rewrite the sender and/or recipient information by
substituting those addresses with information from the @b{BBDB}. Replacement
information is first sought from the @code{mail-name} field in the respective
@b{BBDB} records. If no such field is found, the @code{name} field is
returned. If no @b{BBDB} record is found, no rewriting is performed.
The @b{BBDB}-Reportmail augmentation is accomplished through the advising of
the Reportmail @code{display-time-get-field} function in order to do
a-posteriori modification of the returned value. The augmentation uses the
@code{bbdb/reportmail-alternate-full-name} function to retrieve data from the
@b{BBDB} for use in rewriting.
@node Using Supercite, Using Web Browsers, Using Reportmail, Other Packages
@subsection Using the @b{BBDB} with Supercite
@c <rewrite>
The @b{BBDB} can be used with Supercite to store attributions with @b{BBDB}
records. Normally, when a non-default attribution is entered for a given
message, the entered attribution is used for that message, and is then
discarded. When the @b{BBDB}-Supercite augmentation is enabled, the
non-default attribution will be added to the record (if any) for the entity
being cited. This poor explanation sounds complicated, but it's not. If a
message from @samp{Jamie Zawinski <jwz@@netscape.com>} is being replied to,
Supercite will, by default, suggest the citation @samp{Jamie}. If the
non-default citation @samp{jwz} is entered, Supercite can save it with the
@b{BBDB} record for @samp{Jamie Zawinski} in the @code{attribution} field.
@c </rewrite>
The field used can be changed by changing the value of
@code{bbdb/sc-attribution-field}.
@node Using Web Browsers, , Using Supercite, Other Packages
@subsection Using the @b{BBDB} with Web Browsers
The @b{BBDB}/Web Browser integration is in two parts, one which is
automatically enabled, and one which must be manually enabled (@pxref{Web
Browser Prep}). The first feature added is the ability to display the URL
associated with a given record in a Web Browser. The second is the ability to
add URLs to @b{BBDB} records from within W3, the Emacs Web Browser.
Pressing @kbd{W} in the @code{*BBDB*} buffer while the cursor is positioned
over a record with a @code{www} field will cause the first URL in the field to
be loaded in a Web Browser. This functionality uses @code{browse-url} to
display URLs - see the documentation for @code{browse-url} for information on
selecting the browser to be used.
If W3 is used, and if the @b{BBDB}/W3 functionality has been enabled as
described in @ref{Web Browser Prep}, pressing the @kbd{:} key will add the URL
currently being displayed in W3 to a user-specified @b{BBDB} record.
@node Options, Utilities, Other Packages, Top
@section Options
There are many variables which control the behavior of the Insidious Big
Brother Database, and there are many hook-variables which can be used to
modify its behavior in more complex ways. Several pieces of functionality
are included which use the hooks in this way. @refill
@menu
* Customization Parameters:: Customization Parameters
* Customization Hooks:: Customization Hooks
* Predefined Hooks:: Predefined Hooks
@end menu
@node Customization Parameters, Customization Hooks, Options, Options
@subsection Customization Parameters
@table @code
@item bbdb-file
@vindex bbdb-file
The name of the file which contains your personal database. Default:
@file{~/.bbdb}.
@item bbdb-default-area-code
@vindex bbdb-default-area-code
@cindex Phone numbers
The default area code to use when prompting for a new phone number.
Default: 415. This must be a number, not a string.@refill
@item bbdb-north-american-phone-numbers-p
@vindex bbdb-north-american-phone-numbers-p
@cindex North American phone numbers
@cindex European phone numbers
Whether syntax-checking of phone numbers should be enforced. Default:
@code{t}. This only works for Bell-system phone numbers. If this is true,
then you can't enter invalid phone numbers, and all phone numbers are
pretty-printed in the same way. European phone numbers don't have as
strict a syntax, however, so this is a harder problem for them (on which
I am punting). @refill
You can have both styles of phone number in your database by providing a
prefix argument to the @code{bbdb-insert-new-field} command. @refill
@item bbdb-check-zip-codes-p
@vindex bbdb-check-zip-codes-p
@vindex bbdb-legal-zip-codes
@cindex Zip code checking
@cindex Checking zip codes
@cindex Invalid zip codes
@cindex Not a valid zip code
@cindex List of valid zip codes
@cindex Valid zip codes
Whether syntax-checking of zip codes should be enforced. Default:
@code{t}. If this is true, you can't enter invalid zip codes. A zip
code is valid if it matches one of the regular expressions in the
variable @code{bbdb-legal-zip-codes}. @refill
@item bbdb-address-formatting-alist
@vindex bbdb-address-formatting-alist
@cindex Formatting addresses
@cindex Display of addresses
@cindex Address display
Controls the display of addresses in the buffer. Each entry in this
list consists of an identifying function and a formatting function.
The identifying function must accept an address and return @code{t} if
the associated formatting function is to be used. The formatting
function must insert the formatted address in the current buffer.
Identifying functions usually base their decision on the zip code
format or on the country name. The default entries will format an
address using continental style if the zip code matches
@code{bbdb-continental-zip-regexp}. If the zip code does not match,
addresses are formatted in US style.
@item bbdb-continental-zip-regexp
@vindex bbdb-continental-zip-regexp
@cindex Continental addresses
@cindex European addresses
Decides whether an address should be formatted using US or European
style. If the zip code of an address matches the regular expression,
the European style is used. This works only if the expression
@code{(bbdb-address-is-continental . bbdb-format-address-continental)}
is part of @code{bbdb-address-formatting-alist}.
@item bbdb-electric-p
@vindex bbdb-electric-p
@cindex Electric display
Whether bbdb mode should be @i{``electric''} like @code{electric-buffer-list}.
Default: @code{t}. What this means is that the BBDB buffer which pops
up when you use it can be disposed of by pressing the space bar, at
which point your window configuration will be restored to what it was
before you invoked the db list. (The @code{bbdb-mode} commands still
work as well.) @refill
There are some problems with electric modes; for example, keyboard
macros and incremental search don't work. (This is not a bug in BBDB,
but in @file{electric.el}.)@refill
@item bbdb-case-fold-search
@vindex bbdb-case-fold-search
Default: the same as @code{case-fold-search}. @code{case-fold-search} is
bound to this by @w{@kbd{M-x bbdb}} and related commands. This variable lets
the case-sensitivity of @kbd{^S} and of the bbdb searching commands be
different.
@item bbdb/mail-auto-create-p
@vindex bbdb/mail-auto-create-p
If this is @code{t} (the default), then @b{VM}, @b{MH}, and @b{RMAIL}
will automatically create new bbdb records for people you receive mail
from. If this variable is a function name or lambda expression, then it
is called with no arguments to decide whether an entry should be
automatically created. You can use this to, for example, not create
records for messages which have reached you through a particular mailing
list, or to only create records automatically if the mail has a
particular subject. See the variables
@code{bbdb-ignore-most-messages-alist} and
@code{bbdb-ignore-some-messages-alist} (@xref{Predefined Hooks}.) @refill
@item bbdb/news-auto-create-p
@vindex bbdb/news-auto-create-p
@cindex Automatically creating records
If this is @code{t} (default: @code{nil}), then @b{GNUS} will
automatically create new @b{BBDB} records for people you read messages
by. If this is a function name or lambda expression, then it is called
with no arguments to decide whether an entry should be automatically
created. You can use this to, for example, create or not create
messages which have a particular subject. See the variable
@code{bbdb-auto-notes-alist} (@xref{Predefined Hooks}.). @refill
If you want to autocreate messages based on the current newsgroup, it's
probably a better idea to set this variable to @code{t} or @code{nil} from your
@code{gnus-select-group-hook} instead. @refill
To automatically remember users in certain groups, you can do something
like @refill
@example
@exdent (setq gnus-select-group-hook
@exdent '(lambda ()
@exdent (setq bbdb/news-auto-create-p
@exdent (or (string= "some.news.group" gnus-newsgroup-name)
@exdent (string= "other.news.group" gnus-newsgroup-name)))))
@end example
@item bbdb-quiet-about-name-mismatches
@vindex bbdb-quiet-about-name-mismatches
If this is false (the default), then @b{BBDB} will prompt you when it notices a
name change, that is, when the ``real name'' in a message doesn't correspond
to a record already in the database with the same network address. As in,
@w{@i{``John Smith <jqs@@frob.com>''}} versus
@w{@i{``John Q. Smith <jqs@@frob.com>''.}} If this is true, then you will
not be asked if you want to change it (and it will not be changed.)
If a number then it is the number of seconds to sit-for while
displaying the name mismatch.
@refill
@item bbdb-use-alternate-names
@vindex bbdb-use-alternate-names
@cindex Alternate names
@cindex AKA
If this is false, then the @b{BBDB} will not use the @b{AKA} field.
Otherwise (the default) then the mail and news interfaces will ask you
if you want to add an alternate name when a name-change is noticed, and
will ask you whether the new name should be made the primary one.
Note that if @code{bbdb-quiet-about-name-mismatches} is true, you will
not be asked any questions about alternate names.
@item bbdb-readonly-p
@vindex bbdb-readonly-p
If this is true (default: @code{nil}), then nothing will attempt to change the
database implicitly, and you will be prevented from doing it
explicitly. If you have more than one emacs running at the same time,
you might want to arrange for this to be set to @code{t} in all but one of
them. @refill
@item bbdb-auto-revert-p
@vindex bbdb-auto-revert-p
If this variable is true (default: @code{nil}) and the @b{BBDB} file is noticed to
have changed on disk, it will be automatically reverted without
prompting you first. Otherwise you will be asked. (But if the file has
changed and you have made changes in memory as well, you will always be
asked.) @refill
@item bbdb-notice-auto-save-file
@vindex bbdb-notice-auto-save-file
@cindex Auto-save files
If this is true (default: @code{nil}), then the @b{BBDB} will notice when its
auto-save file is newer than the file is was read from, and will offer
to revert. @refill
@item bbdb-use-pop-up
@vindex bbdb-use-pop-up
@cindex Automatic display of the corresponding record
If true (the default), display a continuously-updating @b{BBDB}
window while in @b{VM}, @b{MH}, @b{RMAIL}, or @b{GNUS}.
Each time a new message is selected, the record corresponding to
that message's sender will be displayed in another window. The
buffer in this other window will be in bbdb-mode, and all
corresponding commands will be available. @refill
This buffer will be positioned on the screen by finding the tallest
of the windows present, and splitting it such that the bottom
@code{bbdb-pop-up-target-lines} lines of the window display the
@samp{*BBDB*} buffer. With the default configurations of @b{VM},
@b{MH}, @b{RMAIL}, and @b{GNUS}, this means that the bbdb-list
buffer will be just below the message-body buffer. @refill
If this is the symbol @code{horiz}, then the @b{BBDB} window will be
stacked horizontally instead of vertically, if there is room to do that
tastefully. @refill
@item bbdb-pop-up-target-lines
@vindex bbdb-pop-up-target-lines
Desired number of lines in a @b{VM/MH/RMAIL/GNUS} pop-up @b{BBDB} window,
default 5. @refill
@item bbdb-completion-type
@vindex bbdb-completion-type
@cindex Completion
@cindex Name completion
@cindex Mail address completion
@cindex Address completion
Controls the behavior of the @code{bbdb-complete-name} command. If @code{nil}
(the default), completion is done across the set of all full-names and
user-ids in the database; if the symbol @code{name}, completion is
done on real-names only; if the symbol @code{net}, completion is done
on network addresses only; if it is @code{primary}, then completion is
done only across the set of primary network addresses (the first address
in the list of addresses for a given user). If it is
@code{primary-or-name}, completion is done across primaries and real
names. @refill
@item bbdb-expand-mail-aliases
@vindex bbdb-expand-mail-aliases
@cindex Completion
@cindex Name completion
@cindex Mail address completion
@cindex Address completion
If non-nil, expand mail aliases in `bbdb-complete-name'.
@refill
@item bbdb-complete-name-allow-cycling
@vindex bbdb-complete-name-allow-cycling
@cindex Completion
@cindex Name completion
@cindex Mail address completion
@cindex Address completion
Whether to allow cycling of email addresses when calling
`bbdb-complete-name' on a completed address in a composition buffer."
@refill
@item bbdb-complete-name-full-completion
@vindex bbdb-complete-name-full-completion
@cindex Completion
@cindex Name completion
@cindex Mail address completion
@cindex Address completion
Show full expanded completion rather than partial matches.
If t then do it always, if a number then just is the number of
completions for a specific match is below that number.
@refill
@item bbdb-user-mail-names
@vindex bbdb-user-mail-names
A regular expression identifying the addresses that belong to you. If a
message from an address matching this is seen, the @b{BBDB} record for the
@samp{To:} line will be shown instead of the one for the @samp{From:}
line. If this is @code{nil}, it will default to the value of
@code{(user-login-name)}. @refill
@item bbdb-always-add-addresses
@vindex bbdb-always-add-addresses
If this is @code{t}, then whenever the Insidious Big Brother Database
notices a new email address corresponding to a person who is in the
database, it will add it to the database. If this is @code{nil} (the
default), then whenever a new network address is noticed for a person in
the database, you will be asked whether to add the address. If this is
the symbol @code{never} (really if it is not @code{t} and not @code{nil})
then new network addresses will never be automatically added. @refill
@item bbdb-new-nets-always-primary
@vindex bbdb-new-nets-always-primary
If this is @code{t}, then when the Insidious Big Brother Database adds a new
address to a record, it will always add it to the front of the list of
addresses, making it the primary address. If this is @code{nil} (the default),
then you will be asked. If this is the symbol @code{never} (really if
it is not @code{t} and not @code{nil}) then new network addresses will
always be added to the end of the list. @refill
@item bbdb-canonicalize-redundant-nets-p
@vindex bbdb-canonicalize-redundant-nets-p
If this is non-@code{nil}, redundant network addresses will be ignored.
If a record has an address of the form @code{foo@@baz.com}, setting this
to @code{t} will cause subsequently-noticed addresses
like @code{foo@@bar.baz.com} to be ignored (since we already have a more
general form of that address.) This is similar in function to one of
the possible uses of the variable @code{bbdb-canonicalize-net-hook}
but is somewhat more automatic. (This can't quite be implemented in
terms of the canonicalize-net-hook because it needs access to the
database to determine whether an address is redundant, and the
canonicalize-net-hook is purely a textual manipulation which is
performed before any database access.)
@item bbdb-message-caching-enabled
@vindex bbdb-message-caching-enabled
Whether caching of the message->bbdb-record association should be
used for the interfaces which support it (@b{VM}, @b{MH}, and
@b{RMAIL}). This can speed things up a lot. One implication of
this variable being true (the default) is that the
@code{bbdb-notice-hook} will not be called each time a message is
selected, but only the first time. Likewise, if selecting a message
would generate a question (whether to add an address, change the
name, etc) you will only be asked that question the very first time
the message is selected. @refill
@item bbdb-offer-save
@vindex bbdb-offer-save
If @code{t} (the default), then certain actions will cause the @b{BBDB} to
ask you whether you wish to save the database. If @code{nil}, then the
offer to save will never be made. If not @code{t} and not @code{nil}, then
any time it would ask you, it will just save it without asking. @refill
@end table
@node Customization Hooks, Predefined Hooks, Customization Parameters, Options
@subsection Customization Hooks
All of the hooks variables described below may be set to a symbol or
lambda expression, which will be funcalled; or may be set to a list of
symbols or lambda expressions, each of which will be funcalled in turn.
Almost all hooks in Emacs work this way. But notice that some of the
hooks described below are called with arguments.
@table @code
@item bbdb-list-hook
@vindex bbdb-list-hook
Hook or hooks invoked after the bbdb-list-buffer is filled in. Invoked
with no arguments. @refill
@item bbdb-create-hook
@vindex bbdb-create-hook
Hook or hooks invoked each time a new bbdb-record is created. Invoked
with one argument, the new record. This is called @emph{before} the record is
added to the database. Note that @code{bbdb-change-hook} will be called as
well. @refill
@item bbdb-change-hook
@vindex bbdb-change-hook
Hook or hooks invoked each time a bbdb-record is altered. Invoked with
one argument, the record. This is called @emph{before} the database buffer
is modified. Note that if a new bbdb record is created, both this hook and
@code{bbdb-create-hook} will be called. @refill
@item bbdb-mode-hook
@vindex bbdb-mode-hook
Hook or hooks invoked when the @samp{*BBDB*} buffer is created.
@item bbdb-notice-hook
@vindex bbdb-notice-hook
Hook or hooks invoked each time a bbdb-record is ``noticed,'' that
is, each time it is displayed by the news or mail interfaces.
Invoked with one argument, the new record. The record need not have
been modified for this to be called - use @code{bbdb-change-hook} for that.
You can use this to, for example, add something to the notes field
based on the subject of the current message. It is up to your hook
to determine whether it is running in @b{GNUS}, @b{VM},
@b{MH}, or @b{RMAIL}, and to act appropriately. @refill
Also note that @code{bbdb-change-hook} will @emph{not} be called as a
result of any modifications you may make to the record inside this
hook. @refill
Beware that if the variable @code{bbdb-message-caching-enabled} is
true (a good idea) then when you are using @b{VM}, @b{MH}, or
@b{RMAIL}, this hook will be called only the first time that
message is selected. (The @b{GNUS} interface does not use caching.)
When debugging the value of this hook, it is a good idea to set
caching-enabled to @code{nil}. @refill
@item bbdb-after-read-db-hook
@vindex bbdb-after-read-db-hook
Hook or hooks invoked (with no arguments) just after the Insidious Big
Brother Database is read in. Note that this can be called more than once if
the @b{BBDB} is reverted. One possible use for this is to rename the
@file{.bbdb} buffer; for example @refill
@code{(setq bbdb-after-read-db-hook '(lambda () (rename-buffer " bbdb")))}
@noindent
will cause the buffer visiting the @code{bbdb-file} to be
called @w{@code{" bbdb"}}. The leading space in its name will prevent
it from showing up in the buffer list.
@item bbdb-load-hook
@vindex bbdb-load-hook
Hook or hooks invoked (with no arguments) when the Insidious Big Brother
Database code is first loaded. WARNING: Slow functions should not be
put on this hook, as the @b{BBDB} code will, if not loaded before, be
loaded during the first use of @b{BBDB}-related Customization
functions. Slow functions should be put on @code{bbdb-initialize-hook}.
@item bbdb-initialize-hook
@vindex bbdb-initialize-hook
@findex bbdb-initialize
Hook or hooks invoked (with no arguments) when the
@code{bbdb-initialize} function is called.
@item bbdb-canonicalize-net-hook
@vindex bbdb-canonicalize-net-hook
If this is non-@code{nil}, it should be a function of one argument: a
network address string. (Note that, unlike the other hook-variables
described above, this may not be a list of functions.) Whenever the
Insidious Big Brother Database ``notices'' a message, the corresponding
network address will be passed to this function first, as a kind of
``filter'' to do whatever transformations upon it you like before it is
compared against or added to the database. For example: it is the case
that @code{CS.CMU.EDU} is a valid return address for all mail
originating at a machine in the @code{.CS.CMU.EDU} domain. So, if you
wanted all such addresses to be canonically hashed as
@code{user@@CS.CMU.EDU}, instead of as @code{user@@somehost.CS.CMU.EDU},
you might set this variable to a function like this: @refill
@example
(setq bbdb-canonicalize-net-hook
'(lambda (addr)
(cond ((string-match
"\\`\\([^@@]+@@\\).*\\.\\(CS\\.CMU\\.EDU\\)\\'"
addr)
(concat (substring addr
(match-beginning 1) (match-end 1))
(substring addr
(match-beginning 2) (match-end 2))))
(t addr))))
@end example
You could also use this function to rewrite UUCP-style addresses into
domain-style addresses, or any number of other things.@refill
This function will be called repeatedly until it returns a value EQ to the
value passed in. So multiple rewrite rules might apply to a single
address.@refill
There is an example of the use of this variable in the
file @file{bbdb-hooks.el}: the function
@code{sample-bbdb-canonicalize-net-hook}.@refill
@end table
@vindex bbdb-change-hook
@findex bbdb-delete-redundant-nets
The @code{bbdb-canonicalize-net-hook} is powerful in that it allows
arbitrary rewriting of addresses, however, in many cases that is
overkill. The function @code{bbdb-delete-redundant-nets} can be
used as a value of @code{bbdb-change-hook} to cause network addresses
which appear to be ``redundant'' to be deleted each time a modification
is made to a record. @refill
This works as follows: suppose one gets mail from @code{user@@foo.bar.com},
and then later gets mail from @code{user@@bar.com}. At this point, one
can generally delete the @code{user@@foo.bar.com} address, since the
@code{user@@bar.com} address is more general. (See also the
variable `bbdb-canonicalize-redundant-nets-p', which has the effect of
ignoring subsequent addresses from @code{user@@quux.bar.com} if the
address @code{user@@bar.com} is already known.)@refill
@node Predefined Hooks, , Customization Hooks, Options
@subsection Predefined Hooks
@findex bbdb-timestamp-hook
@cindex Timestamping records
If the variable @code{bbdb-change-hook} is set to the symbol
@code{bbdb-timestamp-hook} (the default), then every record in the
database will have a field named @samp{timestamp}, which will always
contain the date and time at which this record was created or last
modified.
@findex bbdb-creation-date-hook
If the variable @code{bbdb-create-hook} is set to the symbol
@code{bbdb-creation-date-hook} (the default), then every record in the
database will have a field named @samp{creation-date}, which will
contain the date and time at which this record was added to the
database.
@findex bbdb-ignore-most-messages-hook
@vindex bbdb-ignore-most-messages-alist
@cindex Automatically creating records
If the variable @code{bbdb/mail-auto-create-p} is set to the symbol
@code{bbdb-ignore-most-messages-hook}, then the variable
@code{bbdb-ignore-most-messages-alist} will determine which messages
should have records automatically created for them. The format of this
alist is @refill
@example
(( @var{HEADER-NAME} . @var{REGEXP} ) @dots{} )
@end example
@noindent
for example,
@example
(("From" . "@@.*\\.maximegalon\\.edu")
("Subject" . "time travel"))
@end example
@noindent
will cause @b{BBDB} entries to be made only for messages sent by
people at Maximegalon U., or (that's @emph{or}) people posting
about time travel. @refill
There may be only one entry per header in this alist: that is, @refill
@example
(("From" . "addr1\\|addr2") @dots{} )
@end example
@noindent
is legal, but
@example
(("From" . "addr1") ("From" . "addr2") @dots{} )
@end example
@noindent
is not.
@vindex bbdb/mail-auto-create-p
@vindex bbdb/news-auto-create-p
@findex bbdb-ignore-some-messages-hook
@vindex bbdb-ignore-some-messages-alist
If the variable @code{bbdb/mail-auto-create-p} is set to the symbol
@code{bbdb-ignore-some-messages-hook}, then the variable
@code{bbdb-ignore-some-messages-alist} will determine which messages
should have records automatically created for them. This is the exact
inverse of the semantics of the @code{bbdb-ignore-most-messages-alist}:
the alist specifies which messages should @emph{not} have records
automatically created for them, instead of which should. For
example, @refill
@example
(("From" . "mailer.daemon")
("To" . "mailing-list-1\\|mailing-list-2")
("CC" . "mailing-list-1\\|mailing-list-2"))
@end example
@noindent
will cause @b{BBDB} entries to not be made for messages from any mailer daemon,
or messages sent to or @b{CC}ed to either of two mailing lists. @refill
The variable @code{bbdb/news-auto-create-p} may be set to either of the
above-mentioned functions as well, to get this behavior for netnews
messages instead of mail messages.@refill
@vindex bbdb-notice-hook
@vindex bbdb-auto-notes-alist
@cindex Automatically adding text to records
If the variable @code{bbdb-notice-hook} is set to the symbol
@code{bbdb-auto-notes-hook}, then the variable @code{bbdb-auto-notes-alist}
may be used to automatically add text to the notes fields of the records
corresponding to certain messages. The format of this alist is @refill
@example
(( @var{HEADER-NAME}
(@var{REGEXP} . @var{STRING}) @dots{} )
@dots{} )
@end example
@noindent
for example,
@example
(("To" ("-vm@@" . "VM mailing list"))
("Subject" ("sprocket" . "mail about sprockets")
("you bonehead" . "called me a bonehead")))
@end example
@noindent
will cause the text @code{"VM mailing list"} to be added to the notes field of
the record corresponding to anyone you get mail from via one of the @b{VM}
mailing lists. If, that is, @code{bbdb/mail-auto-create-p} is set such
that the record would have been created, or if the record already
existed.@refill
The format of elements of this list may also be
@example
(@var{REGEXP} @var{FIELD-NAME} @var{STRING})
@end example
@noindent
or
@example
(@var{REGEXP} @var{FIELD-NAME} @var{STRING} @var{REPLACE-P})
@end example
@noindent
meaning add the given string to the named field. The field-name may not
be @samp{name}, @samp{aka}, @samp{address}, @samp{phone}, or @samp{net}
(builtin fields) but must be either @samp{notes}, @samp{company}, or the
name of a user-defined note-field. @refill
@example
("pattern" . "string to add")
@end example
@noindent
is equivalent to
@example
("pattern" notes "string to add")
@end example
@noindent
@var{STRING} can contain @code{\&} or @code{\N} escapes like in the function
@code{replace-match}. For example, to automatically add the contents of the
@b{organization} field of a message to the @code{company} field of a @b{BBDB}
record, you can use this: @refill
@example
("Organization" (".*" company "\\&"))
@end example
@noindent
(Note you need two \ to get a single \ into a lisp string literal.)
If STRING is an integer @i{N}, the @i{N}th matching subexpression is
used, so the above example could be written more efficiently as @refill
@example
("Organization" (".*" company 0))
@end example
If STRING is neither a string or an integer, it should be a function
which is called with the contents of the field, and the result of the
function call is used.
If the @var{REPLACE-P} flag is true, then the string replaces the old
contents instead of being appended to it.
If multiple clauses match the message, all of the corresponding strings
will be added. @refill
If the string is being appended (@var{REPLACE-P} is false or not
provided) then the new string is appended to the end of the existing
field value, with an intervening newline. So each piece of text
automatically added to this field will go on its own line. @refill
You can control what the separator is by putting a @code{field-separator}
property on the symbol naming the field. For example, to make text
automatically added to a field named @code{newsgroups} be separated by
commas, you could do @refill
@example
(put 'newsgroups 'field-separator "; ")
@end example
This variable works for news as well. You might want to arrange for
this to have a different value when in mail as when in news. @refill
There may be only one entry per header in this alist: that is,@refill
@example
(("Subject" ("\\bfoo\\b" . "Foo!!")
("bar" . "Bar!")))
@end example
@noindent
will work, but
@example
(("Subject" ("\\bfoo\\b" . "Foo!!"))
("Subject" ("bar" . "Bar!")))
@end example
@noindent
will not.
Here's a more complicated example: some people include bitmaps of
themselves in their mail messages in an @b{X-Face:} header field.
You can capture this field into the @samp{*BBDB*} with the
following:
@example
(setq bbdb-auto-notes-alist
(append bbdb-auto-notes-alist
(list "x-face"
(list (concat "[ \t\n]*\\([^ \t\n]*\\)"
"\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
"\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
"\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
)
'face
"\\1\\3\\5\\7"))))
@end example
@noindent
(The calls to @code{list} and @code{concat} are just for readability, it
could easily be a constant.) The tricky bit here is that it strips out
the newlines and whitespace used for header continuation, which are not
actually a part of the face data. So though the mail message may have
the face data on multiple lines, the entry in the @samp{*BBDB*} will
be just one line.
@vindex bbdb-auto-notes-ignore
@code{bbdb-auto-notes-ignore} is an alist of headers and regexps to
ignore in @code{bbdb-auto-notes-hook}. Each element looks like @refill
@example
(@var{HEADER} . @var{REGEXP})
@end example
@noindent
for example,
@example
("Organization" . "^Gatewayed from\\|^Source only")
@end example
@noindent
would exclude the phony @code{Organization:} headers in GNU mailing-lists
gatewayed to the @code{gnu.*} newsgroups. Note that this exclusion
applies only to a single field, not to the entire message. For that,
use the variable @code{bbdb-auto-notes-ignore-all}.
@vindex bbdb-auto-notes-ignore-all
@code{bbdb-auto-notes-ignore-all} is an alist of headers and regexps
which cause the entire message to be ignored in @code{bbdb-auto-notes-hook}.
Each element looks like @refill
@example
(@var{HEADER} . @var{REGEXP})
@end example
@noindent
for example,
@example
("From" . "BLAT\\.COM")
@end example
@noindent
would exclude any notes recording for message coming from @code{BLAT.COM}.
Note that this is different from @code{bbdb-auto-notes-ignore}, which
applies only to a particular header field, rather than the entire message.
@node Utilities, Internals, Options, Top
@section Utilities
This section describes @b{BBDB} functionality that does not fit neatly into
other sections.
@menu
* bbdb-ftp:: Storing FTP sites in the @b{BBDB}
* bbdb-print:: Print the @b{BBDB}
* bbdb-snarf:: Record generation from raw text
* bbdb-srv:: External control of the @b{BBDB}
@end menu
@node bbdb-ftp
@subsection @code{bbdb-ftp}
@cindex Storing FTP sites in the BBDB
@findex bbdb-ftp
The @code{bbdb-ftp} utility enables the storage of FTP sites as @b{BBDB}
records. The @code{bbdb-create-ftp-site} function is used to create a
@b{BBDB} record for an FTP site. The command will prompt for information
needed to create the record. The FTP site for a given record can be accessed
with the @code{bbdb-ftp} command.
@node bbdb-print, bbdb-snarf, bbdb-ftp, Utilities
@subsection @code{bbdb-print}
@cindex Printing records in the database
@findex bbdb-print
@code{bbdb-print} is a utility for pretty-printing entries from the @b{BBDB}
using TeX. It is invoked by pressing @kbd{P} in the @code{*BBDB*} buffer -
this will cause all records in the @b{BBDB} to be printed as governed by the
variables described below. If @kbd{P} is prefixed by a @kbd{*}, only the
currently-displayed records will be printed. Once invoked, @code{bbdb-print}
will generate the TeX output in a buffer named @file{~/bbdb.tex} (controlled
by @code{bbdb-print-file-name}). The generated output will be shown, and must
be @b{manually} saved.
For each record printed, @code{bbdb-print} will look for the presence of the
@code{tex-name} field. If this field is found, its value will be printed
instead of the @code{name} field for the record in question. This field is
intended to allow the storage of names with accents or other characters that
would be illegal in the address portion of a message. While other fields have
special characters quoted by @code{bbdb-print} as described below, the
contents of the @code{tex-name} field (if present) are used verbatim.
The following variables govern the printing of records (and of the printing of
the fields therein):
@table @code
@item bbdb-print-omit-fields
@vindex bbdb-print-omit-fields
This variable should be set to a list of the fields that are not to be printed
by @code{bbdb-print}. It defaults to:@*
@center @code{(omit tex-name aka mail-alias)}
@item bbdb-print-file-name
@vindex bbdb-print-file-name
The name of the file where generated TeX output is to be stored. The default
is @file{~/bbdb.tex}.
@item bbdb-print-require
@vindex bbdb-print-require
The fields required for printing a record. This allows, for example, only
records with phone numbers to be printed. The value of the value of the
variable will be evaluated once for each record, and the record will be
printed only if the evaluation returns a non-nil value. The symbols
@code{name}, @code{company}, @code{net}, @code{phone}, @code{address}, and
@code{notes} will be set to the appropriate values during evaluation; they
will be nil if the field does not exist or is elided.
The value of this variable can be any lisp expression, but typically
it will be used for a boolean combination of the field variables, as
in the following simple examples:
@itemize @bullet
@item Print only people whose phone numbers are known:@*
@center @code{(setq bbdb-print-require 'phone)}
@item Print people whose names AND companies are known:@*
@center @code{(setq bbdb-print-require '(and name company))}
@item Print people whose names, and either addresses OR phone numbers are
known:@*
@center @code{(setq bbdb-print-require '(and name (or address phone))).}
The default value is:@*
@center @code{(or address phone)}
@end itemize
@item bbdb-print-alist
@vindex bbdb-print-alist
Formatting options for all formats of @code{bbdb-print}. The value is an
alist of the form@*
@center @code{((@var{OPTION} . @var{VALUE}) (@var{OPTION} . @var{VALUE}) ...)}
Separate settings can be configured using @code{bbdb-print-brief-alist} and
@code{bbdb-print-full-alist}. Settings in these variables will override the
ones in @code{bbdb-print-alist}.
The possible options and legal settings are:
@table @code
@item columns
@code{1}, @code{2}, @code{3}, @code{4}, @code{quad} (4 little
2-column pages per sheet) or @code{grid} (12 credit-card-sized pages per
sheet).
@item separator
@code{0}-@code{7}, the style of heading for each letter. @code{0}=none,
@code{1}=line, @code{2}=boxed letters, @code{3}=large boxed letters,
@code{4}=large letters, @code{5}=letters with lines, @code{6}=letters with
suits, @code{7}=boxed letters with suits.
@item omit-area-code
A regular expression matching area codes to omit.
@item phone-on-first-line
If @code{t}, the first phone number will be put on the same line as the name.
If @code{nil}, the name will be the only text on the line. If set to a
string, the field of type @code{phone} whose name matches the string will be
used. The string should be a valid regular expression.
@item n-phones
Maximum number of phone numbers to include.
@item n-addresses
Maximum number of addresses to include.
@item include-files
List of TeX files to @code{\input}. If the filenames are not absolute, the
files must be located somewhere in the TeX input path.
@item ps-fonts
Postscript fonts (TimesNewRoman and Courier) will be used if the value
is non-@code{nil}. Standard TeX fonts (ec-fonts) will be used
otherwise.
@item font-size
The integer point size of the font to be used.
@item hsize
The horizontal dimension of the pages. The value must be a string, and must
be a valid TeX dimension. Alternatively, the TeX default will be used if the
value is @code{nil}.
@item vsize
The vertical dimension of the pages. The value must be a string, and must
be a valid TeX dimension. Alternatively, the TeX default will be used if the
value is @code{nil}.
@item hoffset
The TeX output will be offset to the right by the value of this option. The
value must be either a string containing a valid TeX dimension or @code{nil}
or @code{0} to use the default TeX horizontal offset.
@item voffset
The TeX output will be offset downward by the value of this option. The
value must be either a string containing a valid TeX dimension or @code{nil}
or @code{0} to use the default TeX vertical offset.
@item quad-hsize
Horizontal size to be used for the individual pages in the quad format. The
value must be a string containing a valid TeX dimension.
@item quad-vsize
Vertical size to be used for the individual pages in the quad format. The
value must be a string containing a valid TeX dimension.
@end table
The default value is
@example
((omit-area-code . "(@var{AREA-CODE})")
(phone-on-first-line . "^[ \t]*$")
(ps-fonts . nil)
(font-size . 6)
(quad-hsize . "3.15in")
(quad-vsize . "4.5in"))
@end example
Where @var{AREA-CODE} is the value of @code{bbdb-default-area-code} or
@samp{000} if there is no default area code.
@item bbdb-print-brief-alist
@vindex bbdb-print-brief-alist
Extra options for the @code{bbdb-print} brief format. The value(s) of
this variable can either supplement or override the values in
@code{bbdb-print-alist}. The format and possible values of this variable are
as in @code{bbdb-print-alist}, described above.
The default value is
@example
((columns . 1)
(separator . 1)
(n-phones . 2)
(n-addresses . 1)
(include-files "bbdb-print-brief" "bbdb-cols"))
@end example
@item bbdb-print-full-alist
@vindex bbdb-print-full-alist
Extra options for the @code{bbdb-print} non-brief format. The value(s) of
this variable can either supplement or override the values in
@code{bbdb-print-alist}. The format and possible values of this variable are
as in @code{bbdb-print-alist}, described above.
The default value is
@example
((columns . 3)
(separator . 2)
(include-files "bbdb-print" "bbdb-cols"))
@end example
@item bbdb-print-prolog
@vindex bbdb-print-prolog
TeX statements to include at the beginning of the @code{bbdb-print} output
file.
@item bbdb-print-epilog
@vindex bbdb-print-epilog
TeX statements to include at the end of the @code{bbdb-print} output file.
@end table
@node bbdb-snarf, bbdb-srv, bbdb-print, Utilities
@subsection @code{bbdb-snarf}
@code{bbdb-snarf} provides the ability to generate @b{BBDB} records from raw
text. If invoked as @code{bbdb-snarf}, it attempts to generate the record
from the information around point (the cursor). If invoked as
@code{bbdb-snarf-region}@footnote{@code{bbdb-snarf} is actually a wrapper for
@code{bbdb-snarf-region} that determines the relevant region and passes it
on.}, the active region is used to generate the record.
@noindent
@b{Restrictions:}
@enumerate
@item
@code{bbdb-snarf} currently recognizes only US-style phone numbers.
@item
@code{bbdb-snarf} works best with things that look like mailing addresses.
@end enumerate
@noindent
Example of an address that @code{bbdb-snarf} will recognize:
@example
another test person
1234 Gridley St.
Los Angeles, CA 91342
555-1212
test@@person.net
http://www.foo.bar/
other stuff about this person
@end example
@node bbdb-srv, , bbdb-snarf, Utilities
@subsection @code{bbdb-srv}
@code{bbdb-srv} provides the ability to initiate the display of @b{BBDB}
records from outside of Emacs. This allows external programs to cause
the @b{BBDB} record for a given person to appear in the running Emacs
when, for example, mail is recieved from that person. One specific
application, described below, is the integration of Netscape and the
@b{BBDB}, allowing the display of @b{BBDB} records corresponding to Mail
and/or News messages displayed in Netscape.
@code{bbdb-srv} is composed of two parts - an external Perl script
(@file{utils/bbdb-srv.pl}), and an Emacs Lisp file
(@file{lisp/bbdb-srv.el}). The external portion is used to send
commands to the internal portion.
@b{NOTE:} @code{bbdb-srv} requires @code{gnuserv} and @code{itimer},
both included with XEmacs. @code{gnuserv} must be started with the
@code{gnuserv-start} command before @code{bbdb-srv} can be used.
In it's most basic form, mail or news headers are passed to the Perl
script. The Perl script then causes the @b{BBDB} record (if any)
corresponding to the passed headers to be displayed in the running
Emacs. While @code{bbdb-srv} will operate with just a @samp{From:}
field, it works better when passed both @samp{From:} and @samp{To:}
headers. When @code{bbdb-srv} notices that the logged-in user is named
in the @samp{From:} header, it will attempt to display the record (if
any) for the person named in the @samp{To:} header. If no @samp{To:}
header is passed, it falls back on the record (if any) for the logged-in
user (the person named in the @samp{From:} header).
An example manual invocation of @code{bbdb-srv} is as follows:
@example
% cat |bbdb-srv.pl
From: Jamie Zawinski <jwz@@netscape.com>
To: Matt Simmons <simmonmt@@acm.org>
@key{CTRL-D}
@end example
If the invoking user is Jamie Zawinski, the record for Matt Simmons (if
any) will be displayed. If the invoking user is not Jamie Zawinski, the
record for Jamie Zawinski (if any) will be displayed.
As mentioned above @code{bbdb-srv} can be used with Netscape Mail and
Netscape News. Please note that it can only be used with the UNIX
versions 3.0b2 and greater of these applications. To allow Netscape to
use @code{bbdb-srv}, set the @samp{NS_MSG_DISPLAY_HOOK} variable to
@code{bbdb-srv.pl}@footnote{Use the full path to @code{bbdb-srv.pl} if
it is not in the default path.} as follows:
@noindent
Bourne Shell (@file{/bin/sh}) and variants:
@example
# NS_MSG_DISPLAY_HOOK bbdb-srv.pl
# export NS_MSG_DISPLAY_HOOK
@end example
@noindent
C-Shell (@file{/bin/csh}) and variants:
@example
% setenv NS_MSG_DISPLAY_HOOK bbdb-srv.pl
@end example
The following variables can be used to customize the behavior of
@code{bbdb-srv}:
@table @code
@vindex bbdb/srv-auto-create-p
@item bbdb/srv-auto-create-p
This variable is similar to @code{bbdb/news-auto-create-p} and
@code{bbdb/mail-auto-create-p}. That is, when headers are passed in to
@code{bbdb-srv}, a new @b{BBDB} record can be created if none exists,
depending on the value of this variable. Possible values are:
@table @asis
@item @code{t}
Automatically create new @b{BBDB} records if the headers passed in do
not correspond to an already-existing record.
@item @code{nil}
Do not automatically create new @b{BBDB} records.
@item @var{FUNCTION}
@var{FUNCTION} is called. If it returns @code{t}, a record will be
created for the person named in the @samp{From:} header. If it returns
@code{nil}, no record will be created.
A suggested function for use is
@code{bbdb/srv-auto-create-mail-news-dispatcher}. This function will
attempt to determine the source of the passed headers - whether they
were part of a mail message or of a news article. The action (if any)
dictated by the value of either @code{bbdb/mail-auto-create-p} or
@code{bbdb/news-auto-create-p}, based on the determined source of the
passed headers.
@end table
@vindex bbdb/srv-display-delay
@item bbdb/srv/display-delay
@code{bbdb-srv} pauses between displaying the records corresponding to
each passed set of headers. This variable controls the length of time
(in seconds) of the delay between the display of different records.
Note when setting this variable that only one set of headers can be
queued at a time. If three sets of headers are passed to
@code{bbdb-srv} in less than the delay time, only the first and last
will be displayed.
@end table
@node Internals, Mailing Lists, Utilities, Top
@section Internals
@b{This section is currently a dumping ground for things that should
eventually go here, but were found elsewhere in the file.}
@b{INFORMATION IN THIS SECTION IS FOR INFORMATIONAL PURPOSES ONLY. IT
SHOULD NOT BE TAKEN AS DOCUMENTATION OF AN EXTERNAL API. EVERYTHING
LISTED BELOW IS SUBJECT TO CHANGE WITHOUT NOTICE}
The first time you use
one of the @b{BBDB} commands, this file is read into an emacs buffer, and
remains there. As you make changes to the database, this buffer is
changed as well, ensuring that if it is auto-saved, it will be saved in
its most current state. @refill
@subsection BBDB data file format
The data file is arranged in a hierarchical fashion. At the top level
are vectors, with one vector per database record. It is @b{very}
important that each vector be on its own line, as the BBDB builds and
stores markers based on this layout. The markers are then used to
increase the speed of database modifications (more on this later). The
record vectors contain the individual fields of the record. These
fields can be of any type, but are currently integers, strings, lists of
strings, alists, vectors, or lists of vectors. In the case of fields
that contain one or more vectors, they can be further broken down in
terms of the fields of their component vectors.
In an effort to provide a more concrete example to illustrate the above,
and to provide a reference for database accessor and modifier functions,
we describe the database format below. This description starts with the
fields of the individual record vectors, and drills down through the
vectors used by some of the fields.
@subsubsection Record Vectors
@multitable @columnfractions .13 .19 .36 .32
@item @b{Name}
@tab @b{Type}
@tab @b{Accessor and Modifier}
@tab @b{Description}
@item First name
@tab String
@tab @code{bbdb-record-firstname}@*
@code{bbdb-record-set-firstname}
@tab Entity's first name
@item Last name
@tab String
@tab @code{bbdb-record-lastname}@*
@code{bbdb-record-set-lastname}
@tab Entity's last name
@item AKAs
@tab List of Strings
@tab @code{bbdb-record-aka}@*
@code{bbdb-record-set-aka}
@tab Alternate names for entity
@item Company
@tab String
@tab @code{bbdb-record-company}@*
@code{bbdb-record-set-company}
@tab Company with which entity is associated
@item Phones
@tab List of Vectors
@tab @code{bbdb-record-phones}@*
@code{bbdb-record-set-phones}
@tab List of phone number vectors
@item Addresses
@tab List of Vectors
@tab @code{bbdb-record-addresses}@*
@code{bbdb-record-set-addresses}
@tab List of address vectors
@item Net address
@tab List of Strings
@tab @code{bbdb-record-net}@*
@code{bbdb-record-set-net}
@tab List of network addresses
@item Notes
@tab String or Alist
@tab @code{bbdb-record-raw-notes}@*
@code{bbdb-record-set-raw-notes}
@tab String or Association list of note fields (strings)
@item Cache
@tab Vector
@tab @code{bbdb-record-cache}@*
@code{bbdb-record-set-cache}
@tab Record cache.@*
@i{Internal version only.}
@end multitable
The phone, address and cache vector fields are described below. Please
note that, as indicated in the table above, the cache is present only in
the internal version of the database - it is not written out as part of
the @file{.bbdb} file.
In addition, the accessor and modifier functions for the notes alist
are described.
@subsubsection Phone Vectors
To access the fields in the below table, you must first get the list of
phone vectors using the @code{bbdb-record-phones} function. Note that
if you alter the phones field with the @code{bbdb-record-set-phones}
function, you are altering the entire phones list for the given record.
Use the modifier functions below for modifications to individual phone
vectors.
@multitable @columnfractions .13 .19 .36 .32
@item @b{Name}
@tab @b{Type}
@tab @b{Accessor and Modifier}
@tab @b{Description}
@item Location
@tab String
@tab @code{bbdb-phone-location}@*
@code{bbdb-phone-set-location}
@tab Phone number identifier
@item Area
@tab Integer
@tab @code{bbdb-phone-area}@*
@code{bbdb-phone-set-area}
@tab Area code for phone number
@item Exchange
@tab Integer
@tab @code{bbdb-phone-exchange}@*
@code{bbdb-phone-set-exchange}
@tab Exchange (aka prefix) for phone number
@item Suffix
@tab Integer
@tab @code{bbdb-phone-suffix}@*
@code{bbdb-phone-set-suffix}
@tab Suffix for phone number
@item Extension
@tab Integer
@tab @code{bbdb-phone-extension}@*
@code{bbdb-phone-set-extension}
@tab Phone number extension (@samp{0} if none)
@end multitable
@subsubsection Address Vectors
To access the fields in the below table, you must first get the list of
address vectors using the @code{bbdb-record-addresses} function. Note
that if you alter the addresses field with the
@code{bbdb-record-set-addresses} function, you are altering the entire
addresses list for the given record. Use the modifier functions below
for modifications to individual address vectors.
@multitable @columnfractions .13 .19 .36 .32
@item @b{Name}
@tab @b{Type}
@tab @b{Accessor and Modifier}
@tab @b{Description}
@item Location
@tab String
@tab @code{bbdb-address-location}@*
@code{bbdb-address-set-location}
@tab Address identifier
@item Streets
@tab List
@tab @code{bbdb-address-streets}@*
@code{bbdb-address-set-streets}
@tab List of street address lines. @code{nil} if none.
@item Street3
@tab String
@tab @code{bbdb-address-street3}@*
@code{bbdb-address-set-street3}
@tab Third line of street address. ``'' if none.
@item City
@tab String
@tab @code{bbdb-address-city}@*
@code{bbdb-address-set-city}
@tab City name
@item State
@tab String
@tab @code{bbdb-address-state}@*
@code{bbdb-address-set-state}
@tab State abbreviation
@item Zip
@tab Integer (american)
List (non-american)
@tab @code{bbdb-address-zip}@*
@code{bbdb-address-set-zip}
@tab Zip code
@item Country
@tab String
@tab @code{bbdb-address-country}@*
@code{bbdb-address-set-country}
@tab Country
@end multitable
@subsubsection Cache Vector
This vector is present only in the internal database representation. It
is not written out to the database file because it contains information
aggregated from the rest of the record that is reconstructed when the
database is read. To write the cache information to the database file
would increase the risk of database inconsistency, and would violate the
principles of normalization.
To access the cache fields using the functions listed below that begin
with @code{bbdb-cache-}, you must first get the cache vector using the
@code{bbdb-record-cache} function. The functions that begin with
@code{bbdb-record-} get the cache vector internally. Note that if you
alter the cache field in the high-level record with the
@code{bbdb-record-set-cache} function, you are altering the entire cache
vector for the given record. Use the modifier functions below for
modifications to individual cache fields.
@multitable @columnfractions .15 .17 .36 .32
@item @b{Name}
@tab @b{Type}
@tab @b{Accessor and Modifier}
@tab @b{Description}
@item Name Cache
@tab String
@tab @code{bbdb-cache-namecache}@*
@code{bbdb-cache-set-namecache}
@tab Preconcatenated name of entity
@item Sort Key
@tab String
@tab @code{bbdb-cache-sortkey}@*
@code{bbdb-cache-set-sortkey}
@tab Preconcatenated sort key for record
@item Marker
@tab Marker
@tab @code{bbdb-cache-marker}@*
@code{bbdb-record-marker}@*
@code{bbdb-cache-set-marker}@*
@code{bbdb-record-set-marker}@*
@tab Marker in @file{.bbdb} for start of record
@item Deleted
@tab Boolean
@tab @code{bbdb-cache-deleted-p}@*
@code{bbdb-record-deleted-p}@*
@code{bbdb-cache-set-deleted-p}@*
@code{bbdb-record-set-deleted-p}
@tab Set to @code{t} if record has been deleted, @code{nil} if not
@end multitable
The functions listed above will return @code{nil} if their respective
cache fields are not set. The functions listed below will return the
value of their cache fields if set, but will also build (and set) the
correct field values if the fields are unset:
@table @code
@item bbdb-record-name
Return the name in the Name Cache field of the cache (if set). If
the name has not been built yet (if the field is @code{nil}), the name is
built, stored in the Name Cache field, and returned.
@item bbdb-record-sortkey
Return the name it the Sort Key field of the cache (if set). If the
Sort Key field has not yet been set (if the field is @code{nil}), the
Sort Key is built, stored in the Sort Key field, and returned.
@end table
@subsubsection Notes String or Alist
If there is only a single note for a given record, the notes field for
that record will be a string. If there is more than one note, the notes
field will be an association list (alist) with elements of the form
@center ( @var{NAME} . @var{VALUE} )
@noindent
where @var{NAME} is the symbol for the name of the note, and
@var{VALUE} is the value of the note.
@subsubsection Example BBDB record
@node Mailing Lists, Changes, Internals, Top
@section Mailing Lists
(If you are looking for a way to create mailing lists with @b{BBDB}, you
should be looking at the section on @xref{Mail Sending Interfaces}.)
There are three mailing lists for the @b{BBDB}.
@code{bbdb-info@@lists.sourceforge.net} gets moderate traffic, and is
intended for the discussion and distribution of development versions of
the @b{BBDB}. Users of development versions of the @b{BBDB} should be
subscribed to this list. It is also to this list that bugs should be
reported. @xref{Known Bugs}. for instructions on submitting bug reports.
The second mailing list @code{bbdb-announce@@lists.sourceforge.net} has
very low volume. Any user of the @b{BBDB} should consider subscribing to
this list, as new releases and security issues will be posted here.
A third mailing list, @code{bbdb-cvs@@lists.sourceforge.net}, is
intended for developers to follow the changes made to the @b{BBDB}
development version. Developers of the @b{BBDB} should consider to
subscribe to this list.
@node Changes, The Latest Version, Mailing Lists, Top
@section Changes in this Version
@menu
* Major Changes:: Major changes in this version
* Other Changes:: Not-so-major changes
@end menu
@node Major Changes, Other Changes, Changes, Changes
@subsection Major Changes
@subsubheading Database File Version Change
(the following version-migration text will move in a future version. It is in
this section currently because new users will likely not experience it)
There has been a version change in the @b{BBDB} database file. The new
version supports non-US zip codes, and an additional ``Country'' field
in addresses.
An automatic version-migration mechanism has been implemented that allows
older version @file{.bbdb} files to either be migrated to the new version, or
used as-is without migrating. When the @b{BBDB} detects a database file with
an old version, it will display the features that have been introduced @b{in
the database file} from the time of the older version's implementation. It
will offer the choice of migration or use of the @b{BBDB} with the
older-version file.
If migration is chosen, the database file will be automatically changed to the
new format. If migration is declined, the file will kept in the older format
in the @code{.bbdb} buffer, but will be stored internally in the new format.
When changes need to be made to the @code{.bbdb} buffer, changed records will
be reverse-migrated from their internal version to that of the disk file.
@node Other Changes, , Major Changes, Changes
@subsection Other Changes
@subsubheading TeX Output
By default, ec fonts are used for TeX output instead of cm fonts. With
the @code{ps-fonts} option set in @code{bbdb-print-alist}, TimesNewRoman
and Courier fonts are used.
@itemize @bullet
@end itemize
@node The Latest Version, The Future, Changes, Top
@section The Latest Version
@noindent
Released versions of the @b{BBDB} can be found at the
following site:
@itemize @bullet
@item
WWW: @code{http://bbdb.sourceforge.net}
@item
FTP: @code{ftp://ftp.sourceforge.net/pub/bbdb}
@end itemize
@noindent
Development versions of the @b{BBDB} can be obtained in the
following ways:
@itemize @bullet
@item
WWW: @code{http://bbdb.sourceforge.net}
@item
Anonymous CVS: See @code{http://bbdb.sourceforge.net} for instructions.
@end itemize
Users of development versions of the @b{BBDB} should subscribe to the
@code{bbdb-info} mailing list. @xref{Mailing Lists}.
@node The Future, , The Latest Version, Top
@section The Future
The future consists of Bugs and Features.
@menu
* Known Bugs:: Known Bugs, and how to submit new ones
* TODO List:: The TODO List
* EOL Statements:: EOL (End Of Life) Statements
@end menu
@node Known Bugs, TODO List, The Future, The Future
@subsection Known Bugs
@enumerate
@item
@b{@kbd{M-TAB} conflicts with ispell.} Workaround: The binding
installed by the @b{BBDB} for address completion/expansion conflicts with
that used by ispell. The suggested workarounds are to rebind the ispell
key (the @b{BBDB} binding is not configurable at this time), to manually
invoke ispell via @kbd{M-x}, or to not use ispell completion functionality
in @b{BBDB}-enabled message composition buffers. The following is an
example of such a rebinding, supplied by Kai Grojohan:
@lisp
(defun my-message-mode-keys ()
(define-key message-mode-map (kbd "M-TAB") 'bbdb-complete-name))
(add-hook 'message-mode-hook 'my-message-mode-keys)
@end lisp
@item
@b{@b{BBDB} and abbrev expansion is inconsistent.} Workaround:
Currently, @kbd{M-TAB} must be used to expand/complete against @b{BBDB}
names and net addresses, and @kbd{TAB} must be used to expand abbrevs (the
values in the @code{mail-alias} field). Unification is planned for a
future version.
@item
@b{The @code{*BBDB*} buffer does not always come up when the first
article in a Gnus Summary Buffer is selected.} Workaround: Pressing
@kbd{g} to reload the article. This will cause the @code{*BBDB*} buffer
to be displayed.
@item
@b{Expansion will fail when the name to be expanded is a subset of
the name for another record.} For example, if you have entries for
@samp{John} and @samp{Johnathan}, you will not be able to expand the
name for @samp{John}. Workaround: Use the net address for the subset
name (@samp{John} in this example).
@end enumerate
@cindex Bug Reports
It is commonly known that there are no bugs in the @b{BBDB}. Bugs
found in defiance of this rule should be submitted using @kbd{M-x
bbdb-submit-bug-report}. These bug reports will bbe sent to the
@code{bbdb-info} mailing list (@pxref{Mailing Lists}) and are
available from public archives. Other big brothers may be reading
your bug reports.
@node TODO List, EOL Statements, Known Bugs, The Future
@subsection TODO List
@subsubheading The Near Future
@itemize @bullet
@item
Add bbdb/@i{MUA}-delete-sender-record
@item
Configurable completion. Should allow user to specify "complete on
names first, then nets", etc.
@item
More variables for upgrading. Specifically a variable that lets users
specify extra fields for upgrading (an alist @samp{(a . b)} that says
field @samp{a} should be upgraded the same way as field @samp{b}.
@item
Change all functions that switch on MUAs to use compose-mail (ex:
@code{bbdb-send-mail-internal}).
@item
Soren Dayton's method for generically extending the @b{BBDB} with
special-purpose fields
@item
Sorting records on alternate keys. @code{bbdb-sort-by} from Boris
Goldowsky.
@c nnml:bbdb-maint
@item
Sorting individual types of fields - Sam Steingold's method.
@item
Button 3 menus (Mark Moll and Soren Dayton)
@c @item
@c @b{BBDB}-controlled mail splitting in Gnus. Add hook for Soren to make
@c splitting better. Routine from Brian Edmonds.
@c Anyone have contact info for Soren Dayton?
@item
Conditionalized erasure of properties when text is pasted into the @b{BBDB}.
@item
Should notice when there are @samp{Reply-To:} addresses.@refill
@item
Should have a command for merging together two divergent copies of
a @file{.bbdb} file (in case you read mail on one machine and news on
another, for instance.)@refill
@item
The @samp{*BBDB*} buffer should be resized to exactly fit what it's
displaying, even when not in ``electric'' mode.@refill
@item
It should be possible to do completion on last names as well as first
names.@refill
@item
The BBDB buffer is left at the top of the stack when GNUS is exited
because GNUS runs its exit-hooks too early. This should be fixed.@refill
@item
String area codes (German area codes can begin with zeroes) patch from
@code{Michael Sperber <sperber@@informatik.uni-tuebingen.de>}
@c @item
@c Internationalization of addresses. Country code to control formats for
@c printing, etc. Country->Format mapping.
@item
Default country variable, similar to @code{bbdb-default-area-code}.
@item
Make format self-describing in comment
@item
ISO-8859-x characters in records for printing.
@item
Prefix for @kbd{W} (@code{bbdb-www}) command to allow selection of
different addresses.
@item
Generalized buttons (via extents) for fields. Example: @samp{(a . b)}
means create button that calls @samp{b} for each entry in the @samp{a}
field.
@item
Remove support for GNUS. Start with lisp Makefile (remove nntp and gnus
loads).
@item
More flexible auto-addition. Conditionalizing of addition (conditions
or supplied function). Prompt if multiple records that meet criteria exist.
@item
Different output formats. See Toby Speight's @code{<s8iurdodvm.fsf@@plato.ansa.co.uk>}
and Bin Mu's @code{<199801221605.KAA23663@@DerivaTech.Com>}.
@item
Generalized area-code-split program that could split, for example, based
on input copied (or straight fetch of page) from the Bellcore NANP page.
@item
Print multivalue (comma-separated) fields with one value per line
@item
Easier BBDB extension. See @code{<xcdyb30f3hb.fsf@@ra.cs.uchicago.edu>}
from Soren Dayton.
@item
Take birthdays from the @b{BBDB}, add them to calendar. From Boris
Goldowsky.
@c In nnml:bbdb-maint
@item
Make mail aliases file for other mailers. From Boris Goldowsky.
@c In nnml:bbdb-maint
@item
Various patches from Boris Goldowsky in @file{bbdb-ext}.
@item
Various other patches:
@itemize @minus
@item
@code{bbdb-filters-0.2}
@item
@code{bbdb-frame.el}
@item
@code{bbdb-letter-1.0}
@item
@code{bbdb-plz}
@item
@code{bbdb-query}
@item
@code{country}
@item
@code{country-info}
@end itemize
@noindent
Note that these files have not been investigated. They may or
may not be incorporated.
@item
Ability to remove all properties from copied strings.
@end itemize
@subsubheading Not-So-Near Future
@itemize @bullet
@item
Fix Gnus scoring so it rebuilds when gnus-score disappears
@item
Multiline note fields
@item
Change key to be some kind of unique number
@item
There should be better support for non-American addresses and phone
numbers. This might be Near Future if somebody volunteers to send me patches.
@item
Should reimplement ``electric'' mode to not be so broken.@refill
@item
The @kbd{*C-o} keystroke should add a field to all displayed records.
Perhaps @kbd{*;} should append some text to an arbitrary field of all
displayed records. @refill
@item
Multiple @file{.bbdb} files with precedence relationships. See Wes
Hardaker's @*@code{<sdu3awz75a.fsf@@oakdale.ucdavis.edu>}
@item
Automatically grab information about a person from their sig. See
Graham Clark's @code{info-bbdb} post
@code{<6282.199706161624@@havra.dcs.ed.ac.uk>} and Adrian Aichner's
@code{info-bbdb} post
@code{<rxsiuzebpgp.fsf@@midnight.ecf.teradyne.com>}. Would like to have
@code{bbdb-snarf} attack the sig then compare the snarfed data with the
header data.
@end itemize
@subsubheading Thoughts
@itemize @bullet
@item
Are there enough hooks?
@item
The interfaces should share more code. @refill
@item
The @code{bbdb-create-internal} function should be more forgiving.@refill
@item
More @kbd{*} commands in general, including @kbd{*d}.
@end itemize
@node EOL Statements, , TODO List, The Future
@subsection End of Life (EOL) Statements
The items in the following list describe items for which support will be
removed in coming versions of the @b{BBDB}. The items listed are
guaranteed to be supported and present only until the EOL date. They
may be removed without warning at any time thereafter.
@enumerate
@item
@code{advertized-bbdb-delete-current-field-or-record}@*
Support for this function will be removed for version 2.2. It is
recommended that all code depending on this variable be switched to use
@code{bbdb-delete-current-field-or-record}. The two functions have the
same calling conventions and effects. This EOL statement was added for
version 2.1.
@item
Support for the GNUS (not Gnus) newsreader@*
The GNUS-specific parts of the @b{BBDB} will be actively removed for the
2.2 release. No further maintenance and/or bugfixes are planned for
GNUS code at this time. This EOL statement was added for version 2.1.
@end enumerate
@node Thanks, , , Top
@section Thanks
Thanks to everyone on the info-bbdb mailing list for many useful
suggestions. This hack would be far less insidious without their input!
@subheading Thanks list for versions after 2.00.06.
@c I'm trying to include as many code contributors as possible here. It
@c doesn't happen without your help!
Thanks to Alex Schroeder, Ronan Waide, Thomas DeWeese, Robert Fenk,
Didier Verna, Bill Carpenter.
@subheading Thanks list for versions after 1.51 prior to and including 2.00.06.
Thanks to Adrian Aichner, Kees de Bruin, David Carlton, Soren Dayton,
Brian Edmonds, Boris Goldowsky, Seth Golub, John Heidemann, Christopher
Kline, Carsten Leonhardt, Hrvoje Niksic, Jens-Ulrik Hoger Petersen,
Colin Rafferty, Matt Simmons, Sam Steingold, Marco Walther, Christoph
Wedler.
@subheading Thanks list for versions prior to and including 1.51.
And special thanks to Sebastian Kremer, Joe Wells, Todd Kaufmann, Andy
Norman, Ivan Vazquez, Stewart Clamen, Roland McGrath, Dave Brennan,
Kimball Collins, Dirk Grunwald, Philippe Queinnec, Boris Putanec, Dave
Disser, Francois Felix Ingrand, Sean Owens, Guido Bosch, Lance Brown,
Tom Emerson, George Hartzell, Luis Miguel Silveira, Kimmo Suominen,
Derek Upham, David Zuhn, Rod Whitby, Richard Mlynarik.
Last, but not least, thanks to Jamie Zawinski for writing @b{BBDB} in the
first place.
@ifinfo
@node _,,,(dir)
@unnumbered _
@example
in.sid.i.ous aj \in-'sid-e-*s\
[L insidiosus, fr. insidiae ambush, fr. insidere to sit in, sit on,
fr. in- + sedere to sit -- more at SIT]
1 a : awaiting a chance to entrap TREACHEROUS
b : harmful but enticing SEDUCTIVE
2 a : having a gradual and cumulative effect SUBTLE
b of a disease
: developing so gradually as to be well established before
becoming apparent
in.sid.i.ous.ly av
in.sid.i.ous.ness n
@end example
@menu
* Top::
@end menu
@end ifinfo
@node Concept Index, Variable Index,, Top
@unnumbered Concept Index
@printindex cp
@node Variable Index, , Concept Index, Top
@unnumbered Variable Index
@printindex vr
@contents
@bye
|