bbdb-3.1.2/0000755000175000017500000000000012327261605007413 500000000000000bbdb-3.1.2/configure.ac0000644000175000017500000000323312327260464011624 00000000000000# configure.ac --- configuration setup for BBDB # Copyright (C) 2000-2001 Didier Verna # Copyright (C) 2011-2014 Roland Winkler # # Author: Didier Verna # Maintainer: Roland Winkler # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . # # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([bbdb],[3.1.2],[bbdb-info@lists.sourceforge.net],[],[http://savannah.nongnu.org/projects/bbdb/]) AC_CONFIG_SRCDIR([lisp/bbdb.el]) AC_CONFIG_MACRO_DIR([m4]) # We need GNU Automake 1.13 for AM_ELCFLAGS. AM_INIT_AUTOMAKE([1.13 -Wall gnu]) AC_PACKAGE_DATE # Checks for programs. AC_PROG_INSTALL # Search for Emacs AM_PATH_LISPDIR AS_IF([test "$EMACS" = no], [AC_MSG_ERROR([cannot find Emacs])]) # Checks for libraries. EMACS_VM AC_SUBST([AM_ELCFLAGS]) # Generate lisp/bbdb-site.el via lisp/Makefile as pkgdatadir is only known # at "make" time. AC_CONFIG_FILES([Makefile lisp/Makefile lisp/bbdb-pkg.el doc/Makefile tex/Makefile]) AC_OUTPUT bbdb-3.1.2/doc/0000755000175000017500000000000012327261605010160 500000000000000bbdb-3.1.2/doc/texinfo.tex0000644000175000017500000116703612327261573012320 00000000000000% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2013-02-01.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. This Exception is an additional permission under section 7 % of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\hashChar = `\# \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). This command % is not documented, not supported, and doesn't work. % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} % \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\centersub\centerH \else \let\centersub\centerV \fi \centersub{\hfil \ignorespaces#1\unskip \hfil}% \let\centersub\relax % don't let the definition persist, just in case } \def\centerH#1{{% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }} % \newcount\centerpenalty \def\centerV#1{% % The idea here is the same as in \startdefun, \cartouche, etc.: if % @center is the first thing after a section heading, we need to wipe % out the negative parskip inserted by \sectionheading, but still % prevent a page break here. \centerpenalty = \lastpenalty \ifnum\centerpenalty>10000 \vskip\parskip \fi \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi \line{\kern\leftskip #1\kern\rightskip}% } % @sp n outputs n lines of vertical space % \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment % \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} % \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\rgbDarkRed} \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else \txiescapepdf\pdfoutlinedest \fi % % Also escape PDF chars in the display string. \edef\pdfoutlinetext{#1}% \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). % Example: % #1 = \textrm % #2 = \rmshape % #3 = 10 % #4 = \mainmagstep % #5 = OT1 % \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % % (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions, \definetextfontsizex % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{27pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqkbd \markupsetcodequoteleft \let\markupsetuprqkbd \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ptexslash \fi\fi\fi \aftersmartic } % Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp % @code (and similar) prints in typewriter, but with spaces the same % size as normal in the surrounding text, without hyphenation, etc. % This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\normaldash \let_\realunder \fi \codex } } \def\codex #1{\tclose{#1}\endgroup} \def\normaldash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is bad. % @allowcodebreaks provides a document-level way to turn breaking at - % and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % For @command, @env, @file, @option quotes seem unnecessary, % so use \code rather than \samp. \let\command=\code \let\env=\code \let\file=\code \let\option=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. % (This \urefnobreak definition isn't used now, leaving it for a while % for comparison.) \def\urefnobreak#1{\dourefnobreak #1,,,\finish} \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode\ampChar=\active \catcode\dotChar=\active \catcode\hashChar=\active \catcode\questChar=\active \catcode\slashChar=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} \def\xkey{\key} \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} \long\def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \selectfonts\lllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: \font\thisecfont = ectt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. Because % it is always used for titles, nothing else, we call \rmisbold. \par % should be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% \rmisbold \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 \ptexraggedright } % Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\normaldash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. % \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % \def\doifcmddefined#1#2{{% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname #2\endcsname\relax #1% If not defined, \let\next as above. \fi \expandafter }\next } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} % @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} % Set the `txicommandconditionals' variable, so documents have a way to % test if the @ifcommand...defined conditionals are available. \set txicommandconditionals % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these unexpandable (because we define \tt as a dummy) % definitions when @{ or @} appear in index entry text. Also, more % complicated, when \tex is in effect and \{ is a \delimiter again. % We can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. Perhaps we % should define @lbrace and @rbrace commands a la @comma. \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sansserif \definedummyword\sc \definedummyword\slanted \definedummyword\t % % Commands that take arguments. \definedummyword\abbr \definedummyword\acronym \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\dmn \definedummyword\email \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\image \definedummyword\indicateurl \definedummyword\inforef \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % % Unfortunately, texindex is not prepared to handle braces in the % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% \def\lbracechar{|a}% % \def\}{|b}% \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\arrow{->}% \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\geq{>=}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\leq{<=}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us % ignore left quotes in the sort term. {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{\ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip \nobreak \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \checkenv{}% should not be in an environment. % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) However, when a paragraph is not started next % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out % or the negative glue will cause weirdly wrong output, typically % obscuring the section heading with something else. \vskip-\parskip % % This is so the last item on the main vertical list is a known % \penalty > 10000, so \startdefun, etc., can recognize the situation % and do the needful. \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax \advance\rightskip by \lispnarrowing \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. % \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi } % Keep a nonzero parskip for the environment, since we're doing normal filling. % \def\Eindentedblock{% \par {\parskip=0pt \afterenvbreak}% } \def\Esmallindentedblock{\Eindentedblock} % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. We used to recommend @var for that, so % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{\begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % % ... and for \example: \spaceisspace % % The \empty here causes a following catcode 5 newline to be eaten as % part of reading whitespace after a control sequence. It does not % eat a catcode 13 newline. There's no good way to handle the two % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX % would then have different behavior). See the Macro Details node in % the manual for the workaround we recommend for macros and % line-oriented commands. % \scantokens{#1\empty}% \endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% used when scanning invocations \scanctxt \catcode`\\=0 } % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" % for the single characters \ { }. Thus, we end up with the "commands" % that would be written @\ @{ @} in a Texinfo document. % % We already have @{ and @}. For @\, we define it here, and only for % this purpose, to produce a typewriter backslash (so, the @\ that we % define for @math can't be used with @macro calls): % \def\\{\normalbackslash}% % % We would like to do this for \, too, since that is what makeinfo does. % But it is not possible, because Texinfo already has a command @, for a % cedilla accent. Documents must use @comma{} instead. % % \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % For macro processing make @ a letter so that we can make Texinfo private macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH % in the params list to some hook where the argument si to be expanded. If % there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. % % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, you need that no macro has more than 256 arguments, otherwise an % error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } % \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } \def\macargexpandinbody@{% %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Save the token stack pointer into macro #1 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} % Restore the token stack pointer from number in macro #1 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} % newtoks that can be used non \outer . \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} % Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } % This defines a Texinfo @macro. There are eight cases: recursive and % nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else \ifnum\paramno<10\relax % at most 9 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse \fi \fi \fi} \catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg). % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox \newbox\infofilenamebox \newbox\printedmanualbox % \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% % \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \def\printedmanual{\ignorespaces #5}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% % % If the printed reference name (arg #3) was not explicitly given in % the @xref, figure out what we want to use. \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Auto section-title: use chapter/section title inside % the square brackets if we have it. \ifdim \wd\printedmanualbox > 0pt % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \edef\pdfxrefdest{#1}% \ifx\pdfxrefdest\empty \def\pdfxrefdest{Top}% no empty targets \else \txiescapepdf\pdfxrefdest % escape PDF special chars \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. % % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. % % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. % \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% \ifdim \wd2 > 7sp % nonempty? \ifdim \wd2 = \wd\toprefbox \else % same as Top? \putwordSection{} ``\printedrefname'' \putwordin{}\space \fi \fi #1% } % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \else \ifx\centersub\centerV % for @center @image, we need a vbox so we can have our vertical space \imagevmodetrue \vbox\bgroup % vbox has better behavior than vtop herev \fi\fi % \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. % However, if we're at the top level, we don't want the % normal paragraph indentation. % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip % space after a standalone image \fi \ifx\centersub\centerV \egroup \fi \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'{\dotless{i}}} \gdef^^ee{\^{\dotless{i}}} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % The story here is that in math mode, the \char of \backslashcurfont % ends up printing the roman \ from the math symbol font (because \char % in math mode uses the \mathcode, and plain.tex sets % \mathcode`\\="026E). It seems better for @backslashchar{} to always % print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. Also revert - to its normal character, in % case the active - from code has slipped in. % {@catcode`- = @active @gdef@normalturnoffactive{% @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore bbdb-3.1.2/doc/bbdb.texi0000644000175000017500000000423012261714375011667 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename bbdb.info @settitle Insidious Big Brother Database (BBDB) User Manual @c %**end of header @copying This file documents the Insidious Big Brother Database (BBDB) Copyright (C) 2011-2014 Roland Winkler @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Section being ``GNU GENERAL PUBLIC LICENSE,'' A copy of the license is included in the section entitled ``GNU Free Documentation License.'' @end quotation @end copying @dircategory Emacs misc features @direntry * BBDB: (bbdb). Insidious Big Brother Database (BBDB). @end direntry @titlepage @title Insidious Big Brother Database (BBDB) User Manual @page @vskip 0pt plus 1filll @insertcopying @end titlepage @c Output the table of the contents at the beginning. @contents @ifnottex @node Top, First Chapter, (dir), (dir) @top BBDB User Manual @insertcopying @end ifnottex @menu * First Chapter:: The first chapter is the only chapter in this sample. Appendices * Copying:: The GNU General Public License gives you permission to redistribute GNU Emacs on certain terms; it also explains that there is no warranty. * GNU Free Documentation License:: The license for this documentation. * Index:: Complete index. @end menu @node First Chapter, Copying, Top, Top @chapter First Chapter @cindex chapter, first This is the first chapter. @cindex index entry, another Here is a numbered list. @enumerate @item This is the first item. @item This is the second item. @end enumerate @node Copying, GNU Free Documentation License, First Chapter, Top @appendix GNU GENERAL PUBLIC LICENSE @include gpl.texi @node GNU Free Documentation License, Index, Copying, Top @appendix GNU Free Documentation License @include doclicense.texi @node Index, , GNU Free Documentation License, Top @unnumbered Index @printindex cp @bye bbdb-3.1.2/doc/gpl.texi0000644000175000017500000010442111667246307011567 00000000000000@c The GNU General Public License. @center Version 3, 29 June 2007 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @heading Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program---to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @heading TERMS AND CONDITIONS @enumerate 0 @item Definitions. ``This License'' refers to version 3 of the GNU General Public License. ``Copyright'' also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. ``The Program'' refers to any copyrightable work licensed under this License. Each licensee is addressed as ``you''. ``Licensees'' and ``recipients'' may be individuals or organizations. To ``modify'' a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a ``modified version'' of the earlier work or a work ``based on'' the earlier work. A ``covered work'' means either the unmodified Program or a work based on the Program. To ``propagate'' a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To ``convey'' a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays ``Appropriate Legal Notices'' to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. @item Source Code. The ``source code'' for a work means the preferred form of the work for making modifications to it. ``Object code'' means any non-source form of a work. A ``Standard Interface'' means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The ``System Libraries'' of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A ``Major Component'', in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The ``Corresponding Source'' for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. @item Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. @item Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. @item Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. @item Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: @enumerate a @item The work must carry prominent notices stating that you modified it, and giving a relevant date. @item The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to ``keep intact all notices''. @item You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. @item If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. @end enumerate A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. @item Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: @enumerate a @item Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. @item Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. @item Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. @item Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. @item Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. @end enumerate A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A ``User Product'' is either (1) a ``consumer product'', which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, ``normally used'' refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. ``Installation Information'' for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. @item Additional Terms. ``Additional permissions'' are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: @enumerate a @item Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or @item Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or @item Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or @item Limiting the use for publicity purposes of names of licensors or authors of the material; or @item Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or @item Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. @end enumerate All other non-permissive additional terms are considered ``further restrictions'' within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. @item Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. @item Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. @item Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An ``entity transaction'' is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. @item Patents. A ``contributor'' is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's ``contributor version''. A contributor's ``essential patent claims'' are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, ``control'' includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a ``patent license'' is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To ``grant'' such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. ``Knowingly relying'' means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is ``discriminatory'' if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. @item No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. @item Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. @item Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. @item Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. @item Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. @item Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. @end enumerate @heading END OF TERMS AND CONDITIONS @heading How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found. @smallexample @var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see @url{http://www.gnu.org/licenses/}. @end smallexample Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: @smallexample @var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details. @end smallexample The hypothetical commands @samp{show w} and @samp{show c} should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an ``about box''. You should also get your employer (if you work as a programmer) or school, if any, to sign a ``copyright disclaimer'' for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see @url{http://www.gnu.org/licenses/}. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. bbdb-3.1.2/doc/doclicense.texi0000644000175000017500000005604511667246306013124 00000000000000@c -*-texinfo-*- @c The GNU Free Documentation License. @center Version 1.3, 3 November 2008 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc. @uref{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The ``publisher'' means any person or entity that distributes copies of the Document to the public. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. @item RELICENSING ``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A ``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the site means any set of copyrightable works thus published on the MMC site. ``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. ``Incorporate'' means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is ``eligible for relicensing'' if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. @end enumerate @page @heading ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: @smallexample @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with@dots{}Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: bbdb-3.1.2/doc/Makefile.in0000644000175000017500000005722412327261573012163 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # doc/Makefile.am for BBDB # # Copyright (C) 2013 Christian Egli # Copyright (C) 2013-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(bbdb_TEXINFOS) texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/emacs_vm.m4 \ $(top_srcdir)/m4/package_date.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/bbdb.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = bbdb.dvi PDFS = bbdb.pdf PSS = bbdb.ps HTMLS = bbdb.html TEXINFOS = bbdb.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(docdir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(doc_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_ELCFLAGS = @AM_ELCFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EMACS = @EMACS@ EMACSLOADPATH = @EMACSLOADPATH@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_DATE = @PACKAGE_DATE@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = bbdb.texi bbdb_TEXINFOS = doclicense.texi gpl.texi doc_DATA = bbdb.pdf all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): .texi.info: $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ $< .texi.pdf: $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ $< .texi.html: $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/bbdb.info: bbdb.texi $(bbdb_TEXINFOS) bbdb.dvi: bbdb.texi $(bbdb_TEXINFOS) bbdb.pdf: bbdb.texi $(bbdb_TEXINFOS) bbdb.html: bbdb.texi $(bbdb_TEXINFOS) .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf bbdb.t2d bbdb.t2p clean-aminfo: -test -z "bbdb.dvi bbdb.pdf bbdb.ps bbdb.html" \ || rm -rf bbdb.dvi bbdb.pdf bbdb.ps bbdb.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) $(DATA) installdirs: for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-aminfo clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-docDATA install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-docDATA uninstall-dvi-am uninstall-html-am \ uninstall-info-am uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-aminfo clean-generic \ cscopelist-am ctags-am dist-info distclean distclean-generic \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-docDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean mostlyclean-aminfo \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-docDATA uninstall-dvi-am \ uninstall-html-am uninstall-info-am uninstall-pdf-am \ uninstall-ps-am bbdb.info bbdb.pdf: $(bbdb_TEXINFOS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bbdb-3.1.2/doc/bbdb.info0000644000175000017500000017730712327261605011665 00000000000000This is bbdb.info, produced by makeinfo version 4.13 from bbdb.texi. This file documents the Insidious Big Brother Database (BBDB) Copyright (C) 2011-2014 Roland Winkler Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Section being "GNU GENERAL PUBLIC LICENSE," A copy of the license is included in the section entitled "GNU Free Documentation License." INFO-DIR-SECTION Emacs misc features START-INFO-DIR-ENTRY * BBDB: (bbdb). Insidious Big Brother Database (BBDB). END-INFO-DIR-ENTRY  File: bbdb.info, Node: Top, Next: First Chapter, Prev: (dir), Up: (dir) BBDB User Manual **************** This file documents the Insidious Big Brother Database (BBDB) Copyright (C) 2011-2014 Roland Winkler Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Section being "GNU GENERAL PUBLIC LICENSE," A copy of the license is included in the section entitled "GNU Free Documentation License." * Menu: * First Chapter:: The first chapter is the only chapter in this sample. Appendices * Copying:: The GNU General Public License gives you permission to redistribute GNU Emacs on certain terms; it also explains that there is no warranty. * GNU Free Documentation License:: The license for this documentation. * Index:: Complete index.  File: bbdb.info, Node: First Chapter, Next: Copying, Prev: Top, Up: Top 1 First Chapter *************** This is the first chapter. Here is a numbered list. 1. This is the first item. 2. This is the second item.  File: bbdb.info, Node: Copying, Next: GNU Free Documentation License, Prev: First Chapter, Up: Top Appendix A GNU GENERAL PUBLIC LICENSE ************************************* Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/' Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble ======== The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS ==================== 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a. The work must carry prominent notices stating that you modified it, and giving a relevant date. b. The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c. You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d. If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c. Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d. Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e. Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a. Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b. Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c. Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d. Limiting the use for publicity purposes of names of licensors or authors of the material; or e. Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f. Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS =========================== How to Apply These Terms to Your New Programs ============================================= If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. Copyright (C) YEAR NAME OF AUTHOR This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see `http://www.gnu.org/licenses/'. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: PROGRAM Copyright (C) YEAR NAME OF AUTHOR This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see `http://www.gnu.org/licenses/'. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read `http://www.gnu.org/philosophy/why-not-lgpl.html'.  File: bbdb.info, Node: GNU Free Documentation License, Next: Index, Prev: Copying, Up: Top Appendix B GNU Free Documentation License ***************************************** Version 1.3, 3 November 2008 Copyright (C) 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc. `http://fsf.org/' Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The "publisher" means any person or entity that distributes copies of the Document to the public. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See `http://www.gnu.org/copyleft/'. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING "Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. "Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. ADDENDUM: How to use this License for your documents ==================================================== To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.  File: bbdb.info, Node: Index, Prev: GNU Free Documentation License, Up: Top Index ***** [index] * Menu: * chapter, first: First Chapter. (line 6) * index entry, another: First Chapter. (line 6)  Tag Table: Node: Top730 Node: First Chapter1830 Node: Copying2062 Node: GNU Free Documentation License39646 Node: Index64811  End Tag Table bbdb-3.1.2/doc/Makefile.am0000644000175000017500000000170312307506701012132 00000000000000# doc/Makefile.am for BBDB # # Copyright (C) 2013 Christian Egli # Copyright (C) 2013-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . info_TEXINFOS = bbdb.texi bbdb_TEXINFOS = doclicense.texi gpl.texi doc_DATA = bbdb.pdf bbdb.info bbdb.pdf: $(bbdb_TEXINFOS) bbdb-3.1.2/missing0000754000175000017500000001533112327261573010740 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bbdb-3.1.2/autogen.sh0000754000175000017500000000234612261714461011340 00000000000000#!/bin/sh ### autogen.sh - tool to help build BBDB from a git checkout ## Copyright (C) 2013 Christian Egli ## Copyright (C) 2013-2014 Roland Winkler ## ## This file is part of the Insidious Big Brother Database (aka BBDB), ## ## BBDB is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## BBDB is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with BBDB. If not, see . ### Commentary: ## The BBDB git repository does not include the configure script ## (and associated helpers). The first time you fetch BBDB from git, ## run this script to generate the necessary files. ### Code: set -e # Refresh GNU autotools toolchain. autoreconf --verbose --force --install --warnings=all echo "You can now run \`./configure'." exit 0 bbdb-3.1.2/Makefile.in0000644000175000017500000006461312327261573011416 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # main Makefile.am for BBDB # # Copyright (C) 2013 Christian Egli # Copyright (C) 2013-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) COPYING TODO \ install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/emacs_vm.m4 \ $(top_srcdir)/m4/package_date.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" DATA = $(doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_ELCFLAGS = @AM_ELCFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EMACS = @EMACS@ EMACSLOADPATH = @EMACSLOADPATH@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_DATE = @PACKAGE_DATE@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = lisp doc tex doc_DATA = COPYING ChangeLog AUTHORS NEWS README TODO EXTRA_DIST = autogen.sh BBDB_ELPA_FILES = README COPYING lisp/*.el doc/bbdb.info doc/dir tex/*.tex BBDB_ELPA_PACKAGE = bbdb-$(PACKAGE_VERSION).tar CLEANFILES = doc/dir all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-docDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-docDATA # doc/dir is needed for the ELPA package doc/dir: doc/bbdb.info install-info $< $@ # Package everything in a form suitable for ELPA. elpa: $(BBDB_ELPA_FILES) $(AMTAR) --transform='s:\(lisp\|doc\|tex\)/::' \ --transform='s::bbdb-$(PACKAGE_VERSION)/:' \ --exclude=bbdb-loaddefs.el \ -cf $(BBDB_ELPA_PACKAGE) $(BBDB_ELPA_FILES) @echo "Created $(BBDB_ELPA_PACKAGE)" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bbdb-3.1.2/TODO0000644000175000017500000000420412261714075010024 00000000000000BBDB todo List -*-outline-*- Copyright (C) 2011-2014 Roland Winkler See the end of the file for license conditions. * Bug fixes * Release BBDB v3. ** Facilitate update BBDB v2.x to v3 Compile list of changes BBDB v3 versus v2.x. Which variables / functions / commands / key bindings / concepts in v3 have replaced which ones from v2? Is it possible / meaningful to set up a file bbdb-v2.el with aliases for v2 variable and function names mapping to the names used in v3? ** Update / rewrite texinfo manual ** Copyright Identify contributors. Assign copyright to FSF. ** Get BBDB on the GNU ELPA ** Write BBDB tests using ERT * Features ** Command bbdb-copy-fields-as-kill ** Prioritize BBDB records 2011-04-11 Sam Steingold Records with low priority are not considered for printing etc. ** Prioritize email addresses of a record 2011-04-11 Sam Steingold Records with low priority are still considered for identifying old emails and news messages. But they are ignored for new emails (e.g., completion). ** Import / export BBDB records (e.g. vcard or its XML derivative) 2011-04-05 Leo ** Allow splitting of bbdb-file into multiple files ** bbdb-narrow-display: Inverse of bbdb-append-display * Internals ** Remove bbdb-auto-notes-rules-expanded? 2011-05-05 Leo Copyright (C) 2011-2014 Roland Winkler This file is part of the Insidious Big Brother Database (aka BBDB), BBDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. BBDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with BBDB. If not, see . bbdb-3.1.2/AUTHORS0000644000175000017500000000420512270472332010402 00000000000000Many people have contributed code included in BBDB. Abhi Yerra Adam C. Finnefrock Alex Schroeder Albert L. Ting Barak A. Pearlmutter Robert Widhopf-Fenk Boris Goldowsky : bbdb-print.el David Carlton Christopher Kline Colin Rafferty Soren Dayton Didier Verna Brian Edmonds Christian Egli Dave Love Greg Troxel Gijs Hillenius Dirk Grunwald : bbdb-print.el Hrvoje Niksic Ivan Kanis : bbdb-ispell Jack Repenning : bbdb-mhe.el Simon Josefsson Jeff Bigler Jeff Mincy Jim Blandy Jim Blandy Jochen Küpper John Heidemann : bbdb-snarf.el Jamie Zawinski Kees de Bruin Karl Fogel Fritz Knabe : bbdb-mhe.el Kousik Nandy Carsten Leonhardt Luigi Semenzato : bbdb-print.el Marco Walther Stefan Monnier Jean-Yves Perrier Jens-Ulrik Holger Petersen Philip Hudson Leo Liu Sam Steingold Seth Golub Matt Simmons SL Baur Kevin Davidson : bbdb-pgp.el Todd Kaufmann : bbdb-mhe.el Tom Tromey Teodor Zlatanov Waider Christoph Wedler Roland Winkler Steve Youngs ShengHuo Zhu Local Variables: coding: utf-8 End: bbdb-3.1.2/INSTALL0000644000175000017500000003660512327261573010402 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. bbdb-3.1.2/COPYING0000644000175000017500000010451310642030347010365 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . bbdb-3.1.2/install-sh0000754000175000017500000003325512327261573011352 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bbdb-3.1.2/lisp/0000755000175000017500000000000012327261604010361 500000000000000bbdb-3.1.2/lisp/bbdb-pgp.el0000644000175000017500000002433412261714230012301 00000000000000;;; bbdb-pgp.el --- use BBDB to handle PGP preferences ;; Copyright (C) 1997,1999 Kevin Davidson ;; Copyright (C) 2013 Gijs Hillenius ;; Copyright (C) 2013-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;; It is believed that encrypted mail works best if all mail between ;; individuals is encrypted - even concerning matters that are not ;; confidential. The reasoning is that confidential messages cannot ;; then be easily spotted and decryption efforts concentrated on them. ;; Some people therefore prefer to have all their email encrypted. ;; This package allows you to mark the BBDB entries for those ;; individuals so that messages will be (signed or) encrypted ;; when they are sent. ;;; Usage: ;; Add the xfield pgp-mail (see `bbdb-pgp-field') with the value ;; `sign' or `encrypt' to the BBDB records of the message recipients. ;; If the value is `sign-query' or `encrypt-query', this will query ;; whether to send signed or encrypted messages. ;; ;; Then call `bbdb-pgp' on outgoing message to add MML tags, ;; see info node `(message)security'. For all message recipients ;; in `bbdb-pgp-headers', this command grabs the action in `bbdb-pgp-field' ;; of their BBDB records. If this proposes multiple actions, ;; perform the action which appears first in `bbdb-pgp-ranked-actions'. ;; If this proposes no action at all, use `bbdb-pgp-default'. ;; The variable `bbdb-pgp-method' defines the method which is actually used ;; for signing and encrypting, see also `bbdb-pgp-method-alist'. ;; ;; `bbdb-pgp' works with both `mail-mode' and `message-mode' to send ;; signed or encrypted mail. ;; ;; To run `bbdb-pgp' automatically when sending a message, ;; use `bbdb-initialize' with arg `pgp' to add this function ;; to `message-send-hook' and `mail-send-hook'. ;; Yet see info node `(message)Signing and encryption' why you ;; might not want to rely for encryption on a hook function ;; which runs just before the message is sent, that is, you might want ;; to call the command `bbdb-pgp' manually, then call `mml-preview'. ;; ;; A thought: For these hooks we could define a wrapper that calls ;; first `bbdb-pgp', then `mml-preview' for preview. The wrapper should ;; abort the sending of the message if the preview is not getting ;; the user's approval. Yet this might require some recursive editing mode ;; so that the user can browse the preview before approving it. ;; ;;; Todo: ;; Spot incoming PGP-signed or encrypted messages and prompt for adding ;; `bbdb-pgp-field' to the senders' BBDB records; similar to how ;; bbdb-sc.el maintains attribution preferences. ;;; Code: (require 'message) (require 'bbdb-com) (defcustom bbdb-pgp-field 'pgp-mail "BBDB xfield holding the PGP action. If the recipient of a message has this xfield in his/her BBDB record, its value determines whether `bbdb-pgp' signs or encrypts the message. The value of this xfield should be one of the following symbols: sign Sign the message sign-query Query whether to sign the message encrypt Encrypt the message encrypt-query Query whether to encrypt the message If the xfield is absent use `bbdb-pgp-default'. See also info node `(message)security'." :type '(symbol :tag "BBDB xfield") :group 'bbdb-utilities-pgp) (defcustom bbdb-pgp-default nil "Default action when sending a message and the recipients are not in BBDB. This should be one of the following symbols: nil Do nothing sign Sign the message sign-query Query whether to sign the message encrypt Encrypt the message encrypt-query Query whether to encrypt the message See info node `(message)security'." :type '(choice (const :tag "Do Nothing" nil) (const :tag "Encrypt" encrypt) (const :tag "Query encryption" encrypt-query) (const :tag "Sign" sign) (const :tag "Query signing" sign-query)) :group 'bbdb-utilities-pgp) (defcustom bbdb-pgp-ranked-actions '(encrypt-query sign-query encrypt sign) "Ranked list of actions when sending a message. If a message has multiple recipients such that their BBDB records specify different actions for this message, `bbdb-pgp' will perform the action which appears first in `bbdb-pgp-ranked-actions'. This list should include the following four symbols: sign Sign the message sign-query Query whether to sign the message encrypt Encrypt the message encrypt-query Query whether to encrypt the message." :type '(repeat (symbol :tag "Action")) :group 'bbdb-utilities-pgp) (defcustom bbdb-pgp-headers '("To" "Cc") "Message headers to look at." :type '(repeat (string :tag "Message header")) :group 'bbdb-utilities-pgp) (defcustom bbdb-pgp-method 'pgpmime "Method for signing and encrypting messages. It should be one of the keys of `bbdb-pgp-method-alist'. The default methods include pgp Add MML tags for PGP format pgpauto Add MML tags for PGP-auto format pgpmime Add MML tags for PGP/MIME smime Add MML tags for S/MIME See info node `(message)security'." :type '(choice (const :tag "MML PGP" pgp) (const :tag "MML PGP-auto" pgpauto) (const :tag "MML PGP/MIME" pgpmime) (const :tag "MML S/MIME" smime) (symbol :tag "Custom")) :group 'bbdb-utilities-pgp) (defcustom bbdb-pgp-method-alist '((pgp mml-secure-message-sign-pgp mml-secure-message-encrypt-pgp) (pgpmime mml-secure-message-sign-pgpmime mml-secure-message-encrypt-pgpmime) (smime mml-secure-message-sign-smime mml-secure-message-encrypt-smime) (pgpauto mml-secure-message-sign-pgpauto mml-secure-message-encrypt-pgpauto)) "Alist of methods for signing and encrypting a message with `bbdb-pgp'. Each method is a list (KEY SIGN ENCRYPT). The symbol KEY identifies the method. The function SIGN signs the message; the function ENCRYPT encrypts it. These functions take no arguments. The default methods include pgp Add MML tags for PGP format pgpauto Add MML tags for PGP-auto format pgpmime Add MML tags for PGP/MIME smime Add MML tags for S/MIME See info node `(message)security'." :type '(repeat (list (symbol :tag "Key") (symbol :tag "Sign method") (symbol :tag "Encrypt method"))) :group 'bbdb-utilities-pgp) ;;;###autoload (defun bbdb-read-xfield-pgp-mail (&optional init) "Set `bbdb-pgp-field', requiring match with `bbdb-pgp-ranked-actions'." (bbdb-read-string "PGP action: " init (mapcar 'list bbdb-pgp-ranked-actions) t)) ;;;###autoload (defun bbdb-pgp () "Add PGP MML tags to a message according to the recipients' BBDB records. For all message recipients in `bbdb-pgp-headers', this grabs the action in `bbdb-pgp-field' of their BBDB records. If this proposes multiple actions, perform the action which appears first in `bbdb-pgp-ranked-actions'. If this proposes no action at all, use `bbdb-pgp-default'. The variable `bbdb-pgp-method' defines the method which is actually used for signing and encrypting. This command works with both `mail-mode' and `message-mode' to send signed or encrypted mail. To run this command automatically when sending a message, use `bbdb-initialize' with arg `pgp' to add this function to `message-send-hook' and `mail-send-hook'. Yet see info node `(message)Signing and encryption' why you might not want to rely for encryption on a hook function which runs just before the message is sent, that is, you might want to call the command `bbdb-pgp' manually, then call `mml-preview'." (interactive) (save-excursion (save-restriction (widen) (message-narrow-to-headers) (when mail-aliases ;; (sendmail-sync-aliases) ; needed? (expand-mail-aliases (point-min) (point-max))) (let ((actions (or (delq nil (delete-dups (mapcar (lambda (record) (bbdb-record-xfield-intern record bbdb-pgp-field)) (delete-dups (apply 'nconc (mapcar (lambda (address) (bbdb-message-search (car address) (cadr address))) (bbdb-extract-address-components (mapconcat (lambda (header) (mail-fetch-field header nil t)) bbdb-pgp-headers ", ") t))))))) (and bbdb-pgp-default (list bbdb-pgp-default))))) (when actions (widen) ; after analyzing the headers (let ((ranked-actions bbdb-pgp-ranked-actions) action) (while ranked-actions (if (memq (setq action (pop ranked-actions)) actions) (cond ((or (eq action 'sign) (and (eq action 'sign-query) (y-or-n-p "Sign message? "))) (funcall (nth 1 (assq bbdb-pgp-method bbdb-pgp-method-alist))) (setq ranked-actions nil)) ((or (eq action 'encrypt) (and (eq action 'encrypt-query) (y-or-n-p "Encrypt message? "))) (funcall (nth 2 (assq bbdb-pgp-method bbdb-pgp-method-alist))) (setq ranked-actions nil))))))))))) (provide 'bbdb-pgp) bbdb-3.1.2/lisp/bbdb.el0000644000175000017500000060555012322313565011526 00000000000000;;; bbdb.el --- core of BBDB ;; Copyright (C) 1991, 1992, 1993, 1994 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file is the core of the Insidious Big Brother Database (aka BBDB), ;;; See the BBDB info manual for documentation. ;;; ;;; ----------------------------------------------------------------------- ;;; | There is a mailing list for discussion of BBDB: | ;;; | bbdb-info@lists.sourceforge.net | ;;; | To join, send mail to bbdb-info-request@lists.sourceforge.net | ;;; | (do not forget the "-request" part or you'll look silly in front of | ;;; | lots of people who have the ability to remember it indefinitely...) | ;;; | | ;;; | When joining this list or reporting bugs, please mention which | ;;; | version of BBDB you have. | ;;; ----------------------------------------------------------------------- (require 'timezone) (require 'bbdb-site) ;; When running BBDB, we have (require 'bbdb-autoloads) (eval-when-compile ; pacify the compiler. (autoload 'widget-group-match "wid-edit") (autoload 'bbdb-migrate "bbdb-migrate") (autoload 'bbdb-do-records "bbdb-com") (autoload 'bbdb-append-display-p "bbdb-com") (autoload 'bbdb-toggle-records-layout "bbdb-com") (autoload 'bbdb-dwim-mail "bbdb-com") (autoload 'bbdb-layout-prefix "bbdb-com") (autoload 'bbdb-completing-read-records "bbdb-com") (autoload 'mail-position-on-field "sendmail") (autoload 'vm-select-folder-buffer "vm-folder") ;; cannot use autoload for variables... (defvar message-mode-map) ;; message.el (defvar mail-mode-map) ;; sendmail.el (defvar gnus-article-buffer)) ;; gnus-art.el ;; Custom groups (defgroup bbdb nil "The Insidious Big Brother Database." :group 'news :group 'mail) (defgroup bbdb-record-display nil "Variables that affect the display of BBDB records" :group 'bbdb) (defgroup bbdb-record-edit nil "Variables that affect the editing of BBDB records" :group 'bbdb) (defgroup bbdb-sendmail nil "Variables that affect sending mail." :group 'bbdb) (defgroup bbdb-mua nil "Variables that specify the BBDB-MUA interface" :group 'bbdb) (defgroup bbdb-mua-gnus nil "Gnus-specific BBDB customizations" :group 'bbdb-mua) (put 'bbdb-mua-gnus 'custom-loads '(bbdb-gnus)) (defgroup bbdb-mua-gnus-scoring nil "Gnus-specific scoring BBDB customizations" :group 'bbdb-mua-gnus) (put 'bbdb-mua-gnus-scoring 'custom-loads '(bbdb-gnus)) (defgroup bbdb-mua-gnus-splitting nil "Gnus-specific splitting BBDB customizations" :group 'bbdb-mua-gnus) (put 'bbdb-mua-gnus-splitting 'custom-loads '(bbdb-gnus)) (defgroup bbdb-mua-vm nil "VM-specific BBDB customizations" :group 'bbdb-mua) (put 'bbdb-mua-vm 'custom-loads '(bbdb-vm)) (defgroup bbdb-mua-message nil "Message-specific BBDB customizations" :group 'bbdb-mua) (put 'bbdb-mua-message 'custom-loads '(bbdb-message)) (defgroup bbdb-utilities nil "Customizations for BBDB Utilities" :group 'bbdb) (defgroup bbdb-utilities-dialing nil "BBDB Customizations for phone number dialing" :group 'bbdb) (defgroup bbdb-utilities-print nil "Customizations for printing the BBDB." :group 'bbdb) (put 'bbdb-utilities-print 'custom-loads '(bbdb-print)) (defgroup bbdb-utilities-anniv nil "Customizations for BBDB Anniversaries" :group 'bbdb-utilities) (put 'bbdb-utilities-anniv 'custom-loads '(bbdb-anniv)) (defgroup bbdb-utilities-ispell nil "Customizations for BBDB ispell interface" :group 'bbdb-utilities) (put 'bbdb-utilities-ispell 'custom-loads '(bbdb-ispell)) (defgroup bbdb-utilities-snarf nil "Customizations for BBDB snarf" :group 'bbdb-utilities) (put 'bbdb-utilities-snarf 'custom-loads '(bbdb-snarf)) (defgroup bbdb-utilities-pgp nil "Customizations for BBDB pgp" :group 'bbdb-utilities) (put 'bbdb-utilities-pgp 'custom-loads '(bbdb-pgp)) (defgroup bbdb-utilities-sc nil "Customizations for using Supercite with the BBDB." :group 'bbdb-utilities :prefix "bbdb-sc") (put 'bbdb-utilities-sc 'custom-loads '(bbdb-sc)) ;;; Customizable variables (defcustom bbdb-file (locate-user-emacs-file "bbdb" ".bbdb") "The name of the Insidious Big Brother Database file." :group 'bbdb :type 'file) ;; This should be removed, and the following put in place: ;; a hierarchical structure of bbdb files, some perhaps read-only, ;; perhaps caching in the local bbdb. This way one could have, e.g. an ;; organization address book, with each person having access to it, and ;; then a local address book with personal stuff in it. (defcustom bbdb-file-remote nil "The remote file to save the BBDB database to. When this is non-nil, it should be a file name. When BBDB reads `bbdb-file', it also checks this file, and if it is newer than `bbdb-file', it loads this file. When BBDB writes `bbdb-file', it also writes this file. This feature allows one to keep the database in one place while using different computers, thus reducing the need for merging different files." :group 'bbdb :type '(choice (const :tag "none" nil) (file :tag "remote file name"))) (defcustom bbdb-file-remote-save-always t "If t `bbdb-file-remote' is saved automatically when `bbdb-file' is saved. When nil, ask." :group 'bbdb :type 'boolean) (defcustom bbdb-read-only nil "If t then BBDB will not modify `bbdb-file'. If you have more than one Emacs running at the same time, you might want to set this to t in all but one of them." :group 'bbdb :type '(choice (const :tag "Database is read-only" t) (const :tag "Database is writable" nil))) (defcustom bbdb-auto-revert nil "If t revert unchanged database without querying. If t and `bbdb-file' has changed on disk, while the database has not been modified inside Emacs, revert the database automatically. If nil or the database has been changed inside Emacs, always query before reverting." :group 'bbdb :type '(choice (const :tag "Revert unchanged database without querying" t) (const :tag "Ask before reverting database"))) (defcustom bbdb-check-auto-save-file nil "If t BBDB will check its auto-save file. If this file is newer than `bbdb-file', BBDB will offer to revert." :group 'bbdb :type '(choice (const :tag "Check auto-save file" t) (const :tag "Do not check auto-save file" nil))) (defcustom bbdb-before-save-hook nil "Hook run before saving `bbdb-file'." :group 'bbdb :type 'hook) (defcustom bbdb-after-save-hook nil "Hook run after saving `bbdb-file'." :group 'bbdb :type 'hook) ;; The default element of `bbdb-create-hook' is `bbdb-creation-date'. ;; The default element of `bbdb-change-hook' is `bbdb-timestamp'. ;; -- We have a problem here: ;; Usually, hook variables are not set, but functions are added ;; by calling `add-hook' and removed by calling `remove-hook'. ;; If the user calls `add-hook' in the init file (usually before loading ;; the package that defines the hook variable), this also initializes ;; the respective hook variable. Yet this collides with a non-nil ;; default value of a hook variable because a non-nil INITVALUE for `defvar' ;; or `defcustom' has no effect if a variable is already bound. ;; Therefore, the following code calls `add-hook' unconditionally. ;; Yet this is not a perfect solution either for two reasons. ;; First, `defcustom' gets confused if the default is set outside `defcustom'. ;; So we use `defvar', though these are really user variables. ;; Second, if the user wants to remove the default functions from the ;; respective hooks, the current solution requires that he or she calls ;; `remove-hook' *after* loading bbdb.el. However, it is more likely that ;; users call `add-hook' on these variables in their init files than calling ;; `remove-hook'. In that sense, the following should work for most people. ;; Nonetheless, suggestions for better solutions are appreciated! (defvar bbdb-create-hook nil "*Hook run each time a new BBDB record is created. Run with one argument, the new record. This is called before the record is added to the database, followed by a call of `bbdb-change-hook'. If a record has been created by analyzing a mail message, hook functions can use the variable `bbdb-update-records-address' to determine the header and class of the mail address according to `bbdb-message-headers'.") (add-hook 'bbdb-create-hook 'bbdb-creation-date) (defvar bbdb-change-hook nil "*Hook run each time a BBDB record is changed. Run with one argument, the record. This is called before the database is modified. If a new bbdb record is created, `bbdb-create-hook' is called first, followed by a call of this hook.") (add-hook 'bbdb-change-hook 'bbdb-timestamp) (defcustom bbdb-time-stamp-format "%Y-%m-%d %T %z" "The BBDB time stamp format. See `format-time-string'. This function is called with arg UNIVERSAL being non-nil." :group 'bbdb :type 'string) (defcustom bbdb-after-change-hook nil "Hook run each time a BBDB record is changed. Run with one argument, the record. This is called after the database is modified. So if you want to modify a record when it is created or changed, use instead `bbdb-create-hook' and / or `bbdb-change-hook'." :group 'bbdb :type 'hook) (defcustom bbdb-after-read-db-hook nil "Hook run (with no arguments) after `bbdb-file' is read. Note that this can be called more than once if the BBDB is reverted." :group 'bbdb :type 'hook) (defcustom bbdb-initialize-hook nil "Normal hook run after the BBDB initialization function `bbdb-initialize'." :group 'bbdb :type 'hook) (defcustom bbdb-mode-hook nil "Normal hook run when the *BBDB* buffer is created." :group 'bbdb :type 'hook) (defcustom bbdb-silent nil "If t, BBDB suppresses all its informational messages and queries. Be very very certain you want to set this to t, because it will suppress queries to alter record names, assign names to addresses, etc. Lisp Hackers: See also `bbdb-silent-internal'." :group 'bbdb :type '(choice (const :tag "Run silently" t) (const :tag "Disable silent running" nil))) (defcustom bbdb-info-file nil "Location of the bbdb info file, if it's not in the standard place." :group 'bbdb :type '(choice (const :tag "Standard location" nil) (file :tag "Nonstandard location"))) ;;; Record display (defcustom bbdb-pop-up-window-size 0.5 "Vertical size of BBDB window (vertical split). If it is an integer number, it is the number of lines used by BBDB. If it is a fraction between 0.0 and 1.0 (inclusive), it is the fraction of the tallest existing window that BBDB will take over. If it is t use `display-buffer'/`pop-to-buffer' to create the BBDB window. See also `bbdb-mua-pop-up-window-size'." :group 'bbdb-record-display :type '(choice (number :tag "BBDB window size") (const :tag "Use `pop-to-buffer'" t))) (defcustom bbdb-dedicated-window nil "Make *BBDB* window a dedicated window. Allowed values include nil (not dedicated) 'bbdb (weakly dedicated) and t (strongly dedicated)." :group 'bbdb-record-display :type '(choice (const :tag "BBDB window not dedicated" nil) (const :tag "BBDB window weakly dedicated" 'bbdb) (const :tag "BBDB window strongly dedicated" t))) (defcustom bbdb-layout-alist '((one-line (order . (phone mail-alias mail notes)) (name-end . 24) (toggle . t)) (multi-line (omit . (creation-date timestamp name-format name-face)) (toggle . t) (indentation . 21)) (pop-up-multi-line (omit . (creation-date timestamp name-format name-face)) (indentation . 21)) (full-multi-line (indentation . 21))) "Alist describing each display layout. The format of an element is (LAYOUT-NAME OPTION-ALIST). By default there are four different layout types used by BBDB, which are `one-line', `multi-line', `pop-up-multi-line' (used for pop-ups) and `full-multi-line' (showing all fields of a record). OPTION-ALIST specifies the options for the layout. Valid options are: ------- Availability -------- Format one-line multi-line default if unset ------------------------------------------------------------------------------ (toggle . BOOL) + + nil (order . FIELD-LIST) + + '(phone ...) (omit . FIELD-LIST) + + nil (name-end . INTEGER) + - 40 (indentation . INTEGER) - + 21 (primary . BOOL) - + nil (display-p . FUNCTION) + + nil - toggle: controls if this layout is included when toggeling the layout - order: defines a user specific order for the fields, where t is a place holder for all remaining fields - omit: is a list of xfields which should not be displayed or t to exclude all xfields except those listed in the order option - name-end: sets the column where the name should end in one-line layout. - indentation: sets the level of indentation for multi-line display. - primary: controls whether only the primary mail is shown or all are shown. - display-p: a function controlling whether the record is to be displayed. When you add a new layout FOO, you can write a corresponding layout function `bbdb-display-record-layout-FOO'. If you do not write your own layout function, the multi-line layout will be used." :group 'bbdb-record-display :type `(repeat (cons :tag "Layout Definition" (choice :tag "Layout type" (const one-line) (const multi-line) (const pop-up-multi-line) (const full-multi-line) (symbol)) (set :tag "Properties" (cons :tag "Order" (const :tag "List of fields to order by" order) (repeat (choice (const phone) (const address) (const mail) (const AKA) (const notes) (symbol :tag "other") (const :tag "Remaining fields" t)))) (choice :tag "Omit" :value (omit . nil) (cons :tag "List of fields to omit" (const :tag "Fields not to display" omit) (repeat (choice (const phone) (const address) (const mail) (const AKA) (const notes) (symbol :tag "other")))) (const :tag "Exclude all fields except those listed in the order note" t)) (cons :tag "Indentation" :value (indentation . 14) (const :tag "Level of indentation for multi-line layout" indentation) (number :tag "Column")) (cons :tag "End of name field" :value (name-end . 24) (const :tag "The column where the name should end in one-line layout" name-end) (number :tag "Column")) (cons :tag "Toggle" (const :tag "The layout is included when toggling layout" toggle) boolean) (cons :tag "Primary Mail Only" (const :tag "Only the primary mail address is included" primary) boolean) (cons :tag "Display-p" (const :tag "Show only records passing this test" display-p) (choice (const :tag "No test" nil) (function :tag "Predicate"))))))) (defcustom bbdb-layout 'multi-line "Default display layout." :group 'bbdb-record-display :type '(choice (const one-line) (const multi-line) (const full-multi-line) (symbol))) (defcustom bbdb-pop-up-layout 'pop-up-multi-line "Default layout for pop-up BBDB buffers (mail, news, etc.)." :group 'bbdb-record-display :type '(choice (const one-line) (const multi-line) (const full-multi-line) (symbol))) (defcustom bbdb-wrap-column nil "Wrap column for multi-line display. If nil do not wrap lines." :group 'bbdb-record-display :type '(choice (const :tag "No line wrapping" nil) (number :tag "Wrap column"))) (defcustom bbdb-case-fold-search (default-value 'case-fold-search) "Value of `case-fold-search' used by BBDB and friends. This variable lets the case-sensitivity of the BBDB commands be different from standard commands like command `isearch-forward'." :group 'bbdb-record-display :type 'boolean) (defcustom bbdb-name-format 'first-last "Format for displaying names. If first-last names are displayed as \"Firstname Lastname\". If last-first names are displayed as \"Lastname, Firstname\". This can be overriden per record via the xfield name-format, which should take the same values. See also `bbdb-read-name-format'." :group 'bbdb-record-display :type '(choice (const :tag "Firstname Lastname" first-last) (const :tag "Lastname, Firstname" last-first))) ;; See http://en.wikipedia.org/wiki/Postal_address ;; http://www.upu.int/en/activities/addressing/postal-addressing-systems-in-member-countries.html (defcustom bbdb-address-format-list '((("Argentina") "spcSC" "@%s\n@%p, @%c@, %S@\n%C@" "@%c@") (("Australia") "scSpC" "@%s\n@%c@ %S@ %p@\n%C@" "@%c@") (("Austria" "Germany" "Spain" "Switzerland") "spcSC" "@%s\n@%p @%c@ (%S)@\n%C@" "@%c@") (("Canada") "scSCp" "@%s\n@%c@, %S@\n%C@ %p@" "@%c@") (("China") "scpSC" "@%s\n@%c@\n%p@ %S@\n%C@" "@%c@") ; English format ; (("China") "CpScs" "@%C @%p\n@%S @%c@ %s@" "@%c@") ; Chinese format (("India") "scpSC" "@%s\n@%c@ %p@ (%S)@\n%C@" "@%c@") (("USA") "scSpC" "@%s\n@%c@, %S@ %p@\n%C@" "@%c@") (t bbdb-edit-address-default bbdb-format-address-default "@%c@")) "List of address editing and formatting rules for BBDB. Each rule is a list (IDENTIFIER EDIT FORMAT FORMAT). The first rule for which IDENTIFIER matches an address is used for editing and formatting the address. IDENTIFIER may be a list of countries. IDENTIFIER may also be a function that is called with one arg, the address to be used. The rule applies if the function returns non-nil. See `bbdb-address-continental-p' for an example. If IDENTIFIER is t, this rule always applies. Usually, this should be the last rule that becomes a fall-back (default). EDIT may be a function that is called with one argument, the address. See `bbdb-edit-address-default' for an example. EDIT may also be an editting format string. It is a string containing the five letters s, c, p, S, and C that specify the order for editing the five elements of an address: s streets c city p postcode S state C country The first FORMAT of each rule is used for multi-line layout, the second FORMAT is used for one-line layout. FORMAT may be a function that is called with one argument, the address. See `bbdb-format-address-default' for an example. FORMAT may also be a format string. It consists of formatting elements separated by a delimiter defined via the first (and last) character of FORMAT. Each formatting element may contain one of the following format specifiers: %s streets (used repeatedly for each street part) %c city %p postcode %S state %C country A formatting element will be applied only if the corresponding part of the address is a non-empty string. See also `bbdb-print-address-format-list'." :group 'bbdb-record-display :type '(repeat (list (choice (const :tag "Default" t) (function :tag "Function") (repeat (string))) (choice (string) (function :tag "Function")) (choice (string) (function :tag "Function")) (choice (string) (function :tag "Function"))))) (defcustom bbdb-continental-postcode-regexp "^\\s *[A-Z][A-Z]?\\s *-\\s *[0-9][0-9][0-9]" "Regexp matching continental postcodes. Used by address format identifier `bbdb-address-continental-p'. The regexp should match postcodes of the form CH-8052, NL-2300RA, and SE-132 54." :group 'bbdb-record-display :type 'regexp) (defcustom bbdb-default-separator '("[,;]" ", ") "The default field separator. It is a list (SPLIT-RE JOIN). This is used for fields which do not have an entry in `bbdb-separator-alist'." :group 'bbdb-record-display :type '(list regexp string)) (defcustom bbdb-separator-alist '((name-first-last "[ ,;]" " ") (name-last-first "[ ,;]" ", ") (organization "[,;]" ", ") (affix "[,;]" ", ") (aka "[,;]" ", ") (mail "[,;]" ", ") (mail-alias "[,;]" ", ") (vm-folder "[,;]" ", ") (birthday "\n" "\n") (wedding "\n" "\n") (anniversary "\n" "\n") (notes "\n" "\n")) "Alist of field separators. Each element is of the form (FIELD SPLIT-RE JOIN). For fields lacking an entry here `bbdb-default-separator' is used instead." :group 'bbdb-record-display :type '(repeat (list symbol regexp string))) (defcustom bbdb-user-menu-commands nil "User defined menu entries which should be appended to the BBDB menu. This should be a list of menu entries. When set to a function, it is called with two arguments RECORD and FIELD and it should either return nil or a list of menu entries. Used by `bbdb-mouse-menu'." :group 'bbdb-record-display :type 'sexp) (defcustom bbdb-display-hook nil "Hook run after the *BBDB* is filled in." :group 'bbdb-record-display :type 'hook) (defcustom bbdb-multiple-buffers nil "When non-nil we create a new buffer of every buffer causing pop-ups. You can also set this to a function returning a buffer name. Here a value may be the predefined function `bbdb-multiple-buffers-default'." :group 'bbdb-record-display :type '(choice (const :tag "Disabled" nil) (function :tag "Enabled" bbdb-multiple-buffers-default) (function :tag "User defined function"))) (defcustom bbdb-image nil "If non-nil display records with an image. If a symbol this should be an xfield holding the name of the image file associated with the record. If it is `name' or `fl-name', the first and last name of the record are used as file name. If it is `lf-name', the last and first name of the record are used as file name. If a function it is called with one arg, the record, and it should return the name of the image file. The file is searched in the directories in `bbdb-image-path'. File name suffixes are appended according to `bbdb-image-suffixes'. See `locate-file'." :group 'bbdb-record-display :type '(choice (const :tag "Disabled" nil) (function :tag "User defined function") (symbol :tag "Record field"))) (defcustom bbdb-image-path nil "List of directories to search for `bbdb-image'." :group 'bbdb-record-display :type '(repeat (directory))) (defcustom bbdb-image-suffixes '(".png" ".jpg" ".gif" ".xpm") "List of file name suffixes searched for `bbdb-image'." :group 'bbdb-record-display :type '(repeat (string :tag "File suffix"))) (defcustom bbdb-read-name-format 'fullname "Default format for reading names via `bbdb-read-name'. If it is 'first-last read first and last name separately. If it is 'last-first read last and first name separately. With any other value read full name at once. See also `bbdb-name-format'." :group 'bbdb-record-display :type '(choice (const :tag "Firstname Lastname" first-last) (const :tag "Lastname, Firstname" last-first) (const :tag "Full name" fullname))) ;;; Record editing (defcustom bbdb-lastname-prefixes '("von" "de" "di") "List of lastname prefixes recognized in name fields. Used to enhance dividing name strings into firstname and lastname parts. Case is ignored." :group 'bbdb-record-edit :type '(repeat string)) (defcustom bbdb-lastname-re (concat "[- \t]*\\(\\(?:\\<" (regexp-opt bbdb-lastname-prefixes) ;; multiple last names concatenated by `-' "\\>[- \t]+\\)?\\(?:\\w+[ \t]*-[ \t]*\\)*\\w+\\)\\'") "Regexp matching the last name of a full name. Its first parenthetical subexpression becomes the last name." :group 'bbdb-record-edit :type 'regexp) (defcustom bbdb-lastname-suffixes '("Jr" "Sr" "II" "III") "List of lastname suffixes recognized in name fields. Used to dividing name strings into firstname and lastname parts. All suffixes are complemented by optional `.'. Case is ignored." :group 'bbdb-record-edit :type '(repeat string)) (defcustom bbdb-lastname-suffix-re (concat "[-,. \t/\\]+\\(" (regexp-opt bbdb-lastname-suffixes) ;; suffices are complemented by optional `.'. "\\.?\\)\\W*\\'") "Regexp matching the suffix of a last name. Its first parenthetical subexpression becomes the suffix." :group 'bbdb-record-edit :type 'regexp) (defcustom bbdb-default-domain nil "Default domain to append when reading a new mail address. If a mail address does not contain `[@%!]', append @`bbdb-default-domain' to it. The address is not altered if `bbdb-default-domain' is nil or if a prefix argument is given to the command `bbdb-insert-field'." :group 'bbdb-record-edit :type '(choice (const :tag "none" nil) (string :tag "Default Domain" :value nil))) (defcustom bbdb-phone-style 'nanp "Phone numbering plan assumed by BBDB. The value 'nanp refers to the North American Numbering Plan. The value nil refers to a free-style numbering plan. You can have both styles of phone number in your database by providing a prefix argument to the command `bbdb-insert-field'." :group 'bbdb-record-edit :type '(choice (const :tag "NANP" nanp) (const :tag "none" nil))) (defcustom bbdb-default-area-code nil "Default area code to use when reading a new phone number. This variable also affects dialing." :group 'bbdb-record-edit :type '(choice (const :tag "none" nil) (integer :tag "Default Area Code")) :set (lambda( symb val ) (if (or (and (stringp val) (string-match "^[0-9]+$" val)) (integerp val) (null val)) (set symb val) (error "%s must contain digits only." symb)))) (defcustom bbdb-allow-duplicates nil "When non-nil BBDB allows records with duplicate names and email addresses. In rare cases, this may lead to confusion with BBDB's MUA interface." :group 'bbdb-record-edit :type 'boolean) (defcustom bbdb-default-label-list '("home" "work" "other") "Default list of labels for Address and Phone fields." :group 'bbdb-record-edit :type '(repeat string)) (defcustom bbdb-address-label-list bbdb-default-label-list "List of labels for Address field." :group 'bbdb-record-edit :type '(repeat string)) (defcustom bbdb-phone-label-list '("home" "work" "cell" "other") "List of labels for Phone field." :group 'bbdb-record-edit :type '(repeat string)) (defcustom bbdb-default-country "Emacs";; what do you mean, it's not a country? "Default country to use if none is specified." :group 'bbdb-record-edit :type '(choice (const :tag "None" nil) (string :tag "Default Country"))) (defcustom bbdb-check-postcode t "If non-nil, require legal postcodes when entering an address. The format of legal postcodes is determined by the variable `bbdb-legal-postcodes'." :group 'bbdb-record-edit :type 'boolean) (defcustom bbdb-legal-postcodes '(;; empty string "^$" ;; Matches 1 to 6 digits. "^[ \t\n]*[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[ \t\n]*$" ;; Matches 5 digits and 3 or 4 digits. "^[ \t\n]*\\([0-9][0-9][0-9][0-9][0-9]\\)[ \t\n]*-?[ \t\n]*\\([0-9][0-9][0-9][0-9]?\\)[ \t\n]*$" ;; Match postcodes for Canada, UK, etc. (result is ("LL47" "U4B")). "^[ \t\n]*\\([A-Za-z0-9]+\\)[ \t\n]+\\([A-Za-z0-9]+\\)[ \t\n]*$" ;; Match postcodes for continental Europe. Examples "CH-8057" ;; or "F - 83320" (result is ("CH" "8057") or ("F" "83320")). ;; Support for "NL-2300RA" added at request from Carsten Dominik ;; "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+ ?[A-Z]*\\)[ \t\n]*$" ;; Match postcodes from Sweden where the five digits are grouped 3+2 ;; at the request from Mats Lofdahl . ;; (result is ("SE" (133 36))) "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+\\)[ \t\n]+\\([0-9]+\\)[ \t\n]*$") "List of regexps that match legal postcodes. Whether this is used at all depends on the variable `bbdb-check-postcode'." :group 'bbdb-record-edit :type '(repeat regexp)) (defcustom bbdb-default-xfield 'notes "Default xfield when editing BBDB records." :group 'bbdb-record-edit :type '(symbol :tag "Xfield")) (defcustom bbdb-edit-foo (cons bbdb-default-xfield 'current-fields) "Fields to edit with command `bbdb-edit-foo'. This is a cons pair (WITHOUT-PREFIX . WITH-PREFIX). The car is used if the command is called without a prefix. The cdr is used if the command is called with a prefix. WITHOUT-PREFIX and WITH-PREFIX may take the values: name The full name affix The list of affixes organization The list of organizations aka the list of AKAs mail the list of email addresses phone the list of phone numbers address the list of addresses current-fields Read the field to edit using a completion table that includes all fields of the current record. all-fields Read the field to edit using a completion table that includes all fields currently known to BBDB. Any other symbol is interpreted as the label of an xfield." :group 'bbdb-record-edit :type '(cons (symbol :tag "Field without prefix") (symbol :tag "Field with prefix"))) ;;; MUA interface (defcustom bbdb-annotate-field bbdb-default-xfield "Field to annotate via `bbdb-annotate-record' and friends. This may take the values: affix The list of affixes organization The list of organizations aka the list of AKAs mail the list of email addresses all-fields Read the field to edit using a completion table that includes all fields currently known to BBDB. Any other symbol is interpreted as the label of an xfield." :group 'bbdb-mua :type '(symbol :tag "Field to annotate")) (defcustom bbdb-mua-edit-field bbdb-default-xfield "Field to edit with command `bbdb-mua-edit-field' and friends. This may take the values: name The full name affix The list of affixes organization The list of organizations aka the list of AKAs mail the list of email addresses all-fields Read the field to edit using a completion table that includes all fields currently known to BBDB. Any other symbol is interpreted as the label of an xfield." :group 'bbdb-mua :type '(symbol :tag "Field to edit")) (defcustom bbdb-mua-update-interactive-p '(search . query) "How BBDB's interactive MUA commands update BBDB records. This is a cons pair (WITHOUT-PREFIX . WITH-PREFIX). The car is used if the command is called without a prefix. The cdr is used if the command is called with a prefix (and if the prefix is not used for another purpose). WITHOUT-PREFIX and WITH-PREFIX may take the values \(here ADDRESS is an email address found in a message): nil Do nothing. search Search for existing records matching ADDRESS. update Search for existing records matching ADDRESS; update name and mail field if necessary. query Search for existing records matching ADDRESS; query for creation of a new record if the record does not exist. create or t Search for existing records matching ADDRESS; create a new record if it does not yet exist. a function This functions will be called with no arguments. It should return one of the above values. read Read the value interactively." :group 'bbdb-mua :type '(cons (choice (const :tag "do nothing" nil) (const :tag "search for existing records" search) (const :tag "update existing records" update) (const :tag "query annotation of all messages" query) (const :tag "annotate all messages" create) (function :tag "User-defined function") (const :tag "read arg interactively" read)) (choice (const :tag "do nothing" nil) (const :tag "search for existing records" search) (const :tag "update existing records" update) (const :tag "query annotation of all messages" query) (const :tag "annotate all messages" create) (function :tag "User-defined function") (const :tag "read arg interactively" read)))) (defcustom bbdb-mua-auto-update-p 'bbdb-select-message "How `bbdb-mua-auto-update' updates BBDB records automatically. Allowed values are (here ADDRESS is an email address found in a message): nil Do nothing. search Search for existing records matching ADDRESS. update Search for existing records matching ADDRESS; update name and mail field if necessary. query Search for existing records matching ADDRESS; query for creation of a new record if the record does not exist. create or t Search for existing records matching ADDRESS; create a new record if it does not yet exist. a function This functions will be called with no arguments. It should return one of the above values. For an example, see `bbdb-select-message' with `bbdb-mua-update-records-p', `bbdb-accept-message-alist' and `bbdb-ignore-message-alist'. To initiate auto-updating of BBDB records, call `bbdb-mua-auto-update-init' for the respective MUAs in your init file." :group 'bbdb-mua :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" search) (const :tag "update existing records" update) (const :tag "query annotation of all messages" query) (const :tag "annotate all messages" create) (function :tag "User-defined function"))) (defcustom bbdb-update-records-p 'search "Return value for `bbdb-select-message' and friends. These functions can select messages for further processing by BBDB, The amount of subsequent processing is determined by `bbdb-update-records-p'. Allowed values are (here ADDRESS is an email address selected by `bbdb-select-message'): nil Do nothing. search Search for existing records matching ADDRESS. update Search for existing records matching ADDRESS; update name and mail field if necessary. query Search for existing records matching ADDRESS; query for creation of a new record if the record does not exist. create or t Search for existing records matching ADDRESS; create a new record if it does not yet exist. a function This functions will be called with no arguments. It should return one of the above values." ;; Also: Used for communication between `bbdb-update-records' ;; and `bbdb-query-create'. :group 'bbdb-mua :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" search) (const :tag "update existing records" update) (const :tag "query annotation of all messages" query) (const :tag "annotate all messages" create) (function :tag "User-defined function"))) (defcustom bbdb-message-headers '((sender "From" "Resent-From" "Reply-To" "Sender") (recipients "Resent-To" "Resent-CC" "To" "CC" "BCC")) "Alist of headers to search for sender and recipients mail addresses. Each element is of the form (CLASS HEADER ...) The symbol CLASS defines a class of headers. The strings HEADER belong to CLASS." :group 'bbdb-mua :type 'list) (defcustom bbdb-message-all-addresses nil "If t `bbdb-update-records' returns all mail addresses of a message. Otherwise this function returns only the first mail address of each message." :group 'bbdb-mua :type 'boolean) (defcustom bbdb-message-try-all-headers nil "If t try all message headers to extract an email address from a message. Several BBDB commands extract either the sender or the recipients' email addresses from a message according to `bbdb-message-headers'. If BBDB does not find any email address in this subset of message headers (for example, because an email address is excluded because of `bbdb-user-mail-address-re') but `bbdb-message-try-all-headers' is t, then these commands will also consider the email addresses in the remaining headers." :group 'bbdb-mua :type 'boolean) (defcustom bbdb-accept-message-alist t "Alist describing which messages to automatically create BBDB records for. The format of this alist is ((HEADER-NAME . REGEXP) ...) For example, if ((\"From\" . \"@.*\\.maximegalon\\.edu\") (\"Subject\" . \"time travel\")) BBDB records are only created for messages sent by people at Maximegalon U., or people posting about time travel. If t accept all messages. If nil do not accept any messages. See also `bbdb-ignore-message-alist', which has the opposite effect." :group 'bbdb-mua :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regexp to match on header value")))) (defcustom bbdb-ignore-message-alist nil "Alist describing which messages not to automatically create BBDB records for. The format of this alist is ((HEADER-NAME . REGEXP) ... ) For example, if ((\"From\" . \"mailer-daemon\") ((\"To\" \"CC\") . \"mailing-list-1\\\\|mailing-list-2\")) no BBDB records are created for messages from any mailer daemon, or messages sent to or CCed to either of two mailing lists. If t ignore all messages. If nil do not ignore any messages. See also `bbdb-accept-message-alist', which has the opposite effect." :group 'bbdb-mua :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regexp to match on header value")))) (defcustom bbdb-user-mail-address-re (and (stringp user-mail-address) (string-match "\\`\\([^@]*\\)\\(@\\|\\'\\)" user-mail-address) (concat "\\<" (regexp-quote (match-string 1 user-mail-address)) "\\>")) "A regular expression matching your mail addresses. Several BBDB commands extract either the sender or the recipients' email addresses from a message according to `bbdb-message-headers'. Yet an email address will be ignored if it matches `bbdb-user-mail-address-re'. This way the commands will not operate on your own record. See also `bbdb-message-try-all-headers'." :group 'bbdb-mua :type '(regexp :tag "Regexp matching your mail addresses")) (defcustom bbdb-add-name 'query "How to handle new names for existing BBDB records. This handles messages where the real name differs from the name in a BBDB record with the same mail address, as in \"John Smith \" versus \"John Q. Smith \". Allowed values are: t Automatically change the name to the new value. query Query whether to use the new name. nil Ignore the new name. a number Number of seconds BBDB displays the name mismatch. (without further action). a function This is called with two args, the record and the new name. It should return one of the above values. a regexp If the new name matches this regexp ignore it. Otherwise query to add it. See also `bbdb-add-aka'." :group 'bbdb-mua :type '(choice (const :tag "Automatically use the new name" t) (const :tag "Query for name changes" query) (const :tag "Ignore the new name" nil) (integer :tag "Number of seconds to display name mismatch") (function :tag "Function for analyzing name handling") (regexp :tag "If the new name matches this regexp ignore it."))) (defcustom bbdb-add-aka 'query "How to handle alternate names for existing BBDB records. Allowed values are: t Automatically store alternate names as AKA. query Query whether to store alternate names as an AKA. nil Ignore alternate names. a function This is called with two args, the record and the new name. It should return one of the above values. a regexp If the alternate name matches this regexp ignore it. Otherwise query to add it. See also `bbdb-add-name'." :group 'bbdb-mua :type '(choice (const :tag "Automatically store alternate names as AKA" t) (const :tag "Query for alternate names" query) (const :tag "Ignore alternate names" nil) (function :tag "Function for alternate name handling") (regexp :tag "If the alternate name matches this regexp ignore it."))) (defcustom bbdb-add-mails 'query "How to handle new mail addresses for existing BBDB records. This handles messages where the mail address differs from the mail addresses in a BBDB record with the same name as in \"John Q. Smith \" versus \"John Q. Smith \". Allowed values are: t Automatically add new mail addresses to the list of mail addresses. query Query whether to add it. nil Ignore new mail addresses. a number Number of seconds BBDB displays the new address (without further action). a function This is called with two args, the record and the new mail address. It should return one of the above values. a regexp If the new mail address matches this regexp ignore the new address. Otherwise query to add it. See also `bbdb-new-mails-primary' and `bbdb-ignore-redundant-mails'." :group 'bbdb-mua :type '(choice (const :tag "Automatically add new mail addresses" t) (const :tag "Query before adding new mail addresses" query) (const :tag "Never add new mail addresses" nil) (number :tag "Number of seconds to display new addresses") (function :tag "Function for analyzing name handling") (regexp :tag "If the new address matches this regexp ignore it."))) (defcustom bbdb-new-mails-primary 'query "Where to put new mail addresses for existing BBDB records. A new mail address may either become the new primary mail address, when it is put at the beginning of the list of mail addresses. Or the new mail address is added at the end of the list of mail addresses. Allowed values are: t Make a new address automatically the primary address. query Query whether to make it the primary address. nil Add the new address to the end of the list. a function This is called with two args, the record and the new mail address. It should return one of the above values. a regexp If the new mail address matches this regexp put it at the end. Otherwise query to make it the primary address. See also `bbdb-add-mails'." :group 'bbdb-mua :type '(choice (const :tag "New address automatically made primary" t) (const :tag "Query before making a new address primary" query) (const :tag "Do not make new address primary" nil) (function :tag "Function for analyzing primary handling") (regexp :tag "If the new mail address matches this regexp put it at the end."))) (defcustom bbdb-canonicalize-mail-function nil "If non-nil, it should be a function of one arg: a mail address string. When BBDB \"notices\" a message, the corresponding mail addresses are passed to this function first. It acts as a kind of \"filter\" to transform the mail addresses before they are compared against or added to the database. See `bbdb-canonicalize-mail-1' for a more complete example. If this function returns nil, BBDB assumes that there is no mail address. See also `bbdb-ignore-redundant-mails'." :group 'bbdb-mua :type 'function) (defcustom bbdb-ignore-redundant-mails 'query "How to handle redundant mail addresses for existing BBDB records. For example, \"foo@bar.baz.com\" is redundant w.r.t. \"foo@baz.com\". This affects two things, whether a new redundant mail address is added to BBDB and whether an old mail address, which has become redundant because of a newly added mail address, is removed from BBDB. Allowed values are: t Automatically ignore redundant mail addresses. query Query whether to ignore them. nil Do not ignore redundant mail addresses. a number Number of seconds BBDB displays redundant mail addresses (without further action). a function This is called with two args, the record and the new mail address. It should return one of the above values. a regexp If the new mail address matches this regexp never ignore this mail address. Otherwise query to ignore it. See also `bbdb-add-mails' and `bbdb-canonicalize-mail-function'." :group 'bbdb-mua :type '(choice (const :tag "Automatically ignore redundant mail addresses" t) (const :tag "Query whether to ignore them" query) (const :tag "Do not ignore redundant mail addresses" nil) (number :tag "Number of seconds to display redundant addresses") (function :tag "Function for handling redundant mail addresses") (regexp :tag "If the new address matches this regexp never ignore it."))) (define-obsolete-variable-alias 'bbdb-canonicalize-redundant-mails 'bbdb-ignore-redundant-mails) (defcustom bbdb-message-clean-name-function 'bbdb-message-clean-name-default "Function to clean up the name in the header of a message. It takes one argument, the name as extracted by `mail-extract-address-components'." :group 'bbdb-mua :type 'function) (defcustom bbdb-message-mail-as-name t "If non-nil use mail address of message as fallback for name of new records." :group 'bbdb-mua :type 'boolean) (defcustom bbdb-notice-mail-hook nil "Hook run each time a mail address of a record is \"noticed\" in a message. This means that the mail address in a message belongs to an existing BBDB record or to a record BBDB has created for the mail address. Run with one argument, the record. It is up to the hook function to determine which MUA is used and to act appropriately. Hook functions can use the variable `bbdb-update-records-address' to determine the header and class of the mail address according to `bbdb-message-headers'. See `bbdb-auto-notes' for how to annotate records using `bbdb-update-records-address' and the headers of a mail message. The record need not have been modified for this hook to be called; use `bbdb-change-hook' for that. `bbdb-change-hook' will NOT be called as a result of modifications you may make to the record inside this hook. If a message contains multiple mail addresses belonging to one BBDB record, this hook is run for each mail address. Use `bbdb-notice-record-hook' if you want to notice each record only once per message." :group 'bbdb-mua :type 'hook) (defcustom bbdb-notice-record-hook nil "Hook run each time a BBDB record is \"noticed\" in a message. This means that one of the mail addresses in a message belongs to an existing record or it is a record BBDB has created for the mail address. If a message contains multiple mail addresses belonging to one BBDB record, this hook is nonetheless run only once. Use `bbdb-notice-mail-hook' if you want to run a hook function for each mail address in a message. The record need not have been modified for this hook to be called; use `bbdb-change-hook' for that. `bbdb-change-hook' will NOT be called as a result of modifications you may make to the record inside this hook. Hook is run with one argument, the record." :group 'bbdb-mua :type 'hook) (define-widget 'bbdb-alist-with-header 'group "My group" :match 'bbdb-alist-with-header-match :value-to-internal (lambda (widget value) (if value (list (car value) (cdr value)))) :value-to-external (lambda (widget value) (if value (append (list (car value)) (cadr value))))) (defun bbdb-alist-with-header-match (widget value) (widget-group-match widget (widget-apply widget :value-to-internal value))) (defvar bbdb-auto-notes-rules-expanded nil "Expanded `bbdb-auto-notes-rules'.") ; Internal variable (defcustom bbdb-auto-notes-rules nil "List of rules for adding notes to records of mail addresses of messages. This automatically annotates the BBDB record of the sender or recipient of a message based on the value of a header such as the Subject header. This requires that `bbdb-notice-mail-hook' contains `bbdb-auto-notes' and that the record already exists or `bbdb-update-records-p' returns such that the record will be created. Messages matching `bbdb-auto-notes-ignore-messages' are ignored. The elements of this list are (MUA FROM-TO HEADER ANNOTATE ...) (FROM-TO HEADER ANNOTATE ...) (HEADER ANNOTATE ...) MUA is the active MUA or a list of MUAs (see `bbdb-mua'). If MUA is missing or t, use this rule for all MUAs. FROM-TO is a list of headers and/or header classes as in `bbdb-message-headers'. The record corresponding to a mail address of a message is considered for annotation if this mail address was found in a header matching FROM-TO. If FROM-TO is missing or t, records for each mail address are considered irrespective of where the mail address was found in a message. HEADER is a message header that is considered for generating the annotation. ANNOTATE may take the following values: (REGEXP . STRING) [this is equivalent to (REGEXP notes STRING)] (REGEXP FIELD STRING) (REGEXP FIELD STRING REPLACE) REGEXP must match the value of HEADER for generating an annotation. However, if the value of HEADER also matches an element of `bbdb-auto-notes-ignore-headers' no annotation is generated. The annotation will be added to FIELD of the respective record. FIELD defaults to `bbdb-default-xfield'. STRING defines a replacement for the match of REGEXP in the value of HEADER. It may contain \\& or \\N specials used by `replace-match'. The resulting string becomes the annotation. If STRING is an integer N, the Nth matching subexpression is used. If STRING is a function, it will be called with one arg, the value of HEADER. The return value (which must be a string) is then used. If REPLACE is t, the resulting string replaces the old contents of FIELD. If it is nil, the string is appended to the contents of FIELD (unless the annotation is already part of the content of field). For example, ((\"To\" (\"-vm@\" . \"VM mailing list\")) (\"Subject\" (\"sprocket\" . \"mail about sprockets\") (\"you bonehead\" . \"called me a bonehead\"))) will cause the text \"VM mailing list\" to be added to the notes field of the records corresponding to anyone you get mail from via one of the VM mailing lists. If multiple clauses match the message, all of the corresponding strings will be added. See also variables `bbdb-auto-notes-ignore-messages' and `bbdb-auto-notes-ignore-headers'. For speed-up, the function `bbdb-auto-notes' actually use expanded rules stored in the internal variable `bbdb-auto-notes-rules-expanded'. If you change the value of `bbdb-auto-notes-rules' outside of customize, set `bbdb-auto-notes-rules-expanded' to nil, so that the expanded rules will be re-evaluated." :group 'bbdb-mua :set (lambda (symbol value) (set-default symbol value) (setq bbdb-auto-notes-rules-expanded nil)) :type '(repeat (bbdb-alist-with-header (repeat (choice (const sender) (const recipients))) (string :tag "Header name") (repeat (choice (cons :tag "Value Pair" (regexp :tag "Regexp to match on header value") (string :tag "String for notes if regexp matches")) (list :tag "Replacement list" (regexp :tag "Regexp to match on header value") (choice :tag "Record field" (const notes :tag "xfields") (const organization :tag "Organization") (symbol :tag "Other")) (choice :tag "Regexp match" (string :tag "Replacement string") (integer :tag "Subexpression match") (function :tag "Callback Function")) (choice :tag "Replace previous contents" (const :tag "No" nil) (const :tag "Yes" t)))))))) (defcustom bbdb-auto-notes-ignore-messages nil "List of rules for ignoring entire messages in `bbdb-auto-notes'. The elements may have the following values: a function This function is called with one arg, the record that would be annotated. Ignore this message if the function returns non-nil. This function may use `bbdb-update-records-address'. MUA Ignore messages from MUA (see `bbdb-mua'). (HEADER . REGEXP) Ignore messages where HEADER matches REGEXP. For example, (\"From\" . bbdb-user-mail-address-re) disables any recording of notes for mail addresses found in messages coming from yourself, see `bbdb-user-mail-address-re'. (MUA HEADER REGEXP) Ignore messages from MUA where HEADER matches REGEXP. See also `bbdb-auto-notes-ignore-headers'." :group 'bbdb-mua :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regexp to match on header value")))) (defcustom bbdb-auto-notes-ignore-headers nil "Alist of headers and regexps to ignore in `bbdb-auto-notes'. Each element is of the form (HEADER . REGEXP) For example, (\"Organization\" . \"^Gatewayed from\\\\\|^Source only\") will exclude the phony `Organization:' headers in GNU mailing-lists gatewayed to gnu.* newsgroups. See also `bbdb-auto-notes-ignore-messages'." :group 'bbdb-mua :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regexp to match on header value")))) (defcustom bbdb-mua-pop-up t "If non-nil, display an auto-updated BBDB window while using a MUA. If 'horiz, stack the window horizontally if there is room. If this is nil, BBDB is updated silently. See also `bbdb-mua-pop-up-window-size' and `bbdb-horiz-pop-up-window-size'." :group 'bbdb-mua :type '(choice (const :tag "MUA BBDB window stacked vertically" t) (const :tag "MUA BBDB window stacked horizontally" 'horiz) (const :tag "No MUA BBDB window" nil))) (define-obsolete-variable-alias 'bbdb-message-pop-up 'bbdb-mua-pop-up) (defcustom bbdb-mua-pop-up-window-size bbdb-pop-up-window-size "Vertical size of MUA pop-up BBDB window (vertical split). If it is an integer number, it is the number of lines used by BBDB. If it is a fraction between 0.0 and 1.0 (inclusive), it is the fraction of the tallest existing window that BBDB will take over. If it is t use `pop-to-buffer' to create the BBDB window. See also `bbdb-pop-up-window-size'." :group 'bbdb-mua :type '(choice (number :tag "BBDB window size") (const :tag "Use `pop-to-buffer'" t))) (defcustom bbdb-horiz-pop-up-window-size '(112 . 0.3) "Horizontal size of a MUA pop-up BBDB window (horizontal split). It is a cons pair (TOTAL . BBDB-SIZE). The window that will be considered for horizontal splitting must have at least TOTAL columns. BBDB-SIZE is the horizontal size of the BBDB window. If it is an integer number, it is the number of columns used by BBDB. If it is a fraction between 0 and 1, it is the fraction of the window width that BBDB will take over." :group 'bbdb-mua :type '(cons (number) (number))) ;;; xfields processing (defcustom bbdb-xfields-sort-order '((notes . 0) (url . 1) (ftp . 2) (gopher . 3) (telnet . 4) (mail-alias . 5) (mail-folder . 6) (lpr . 7) (creation-date . 1000) (timestamp . 1001)) "The order for sorting the xfields. If an xfield is not in the alist, it is assigned weight 100, so all xfields with weights less then 100 will be in the beginning, and all xfields with weights more than 100 will be in the end." :group 'bbdb-mua :type 'list) (define-obsolete-variable-alias 'bbdb-notes-sort-order 'bbdb-xfields-sort-order) (defcustom bbdb-merge-xfield-function-alist '((creation-date . bbdb-merge-string-least) (timestamp . bbdb-merge-string-most)) "An alist defining specific merging function for xfields. Each element is of the form (LABEL . MERGE-FUN). For merging xfield LABEL, this will use MERGE-FUN." :group 'bbdb-mua :type '(repeat (cons (symbol :tag "xfield") (function :tag "merge function")))) (define-obsolete-variable-alias 'bbdb-merge-notes-function-alist 'bbdb-merge-xfield-function-alist) (defcustom bbdb-mua-summary-unification-list '(name mail message-name message-mail message-address) "List of FIELDs considered by `bbdb-mua-summary-unify'. For the RECORD matching the address of a message, `bbdb-mua-summary-unify' returns the first non-empty field value matching an element FIELD from this list. Each element FIELD may be a valid argument of `bbdb-record-field' for RECORD. In addition, this list may also include the following elements: message-name The name in the address of the message message-mail The mail in the address of the message message-address The complete address of the message These provide a fallback if a message does not have a matching RECORD or if some FIELD of RECORD is empty." :group 'bbdb-mua :type 'list) (defcustom bbdb-mua-summary-mark-field 'mark-char "BBDB xfield whose value is used to mark message addresses known to BBDB. This may also be a function, called with one arg, the record, which should return the mark. See `bbdb-mua-summary-mark' and `bbdb-mua-summary-unify'. See also `bbdb-mua-summary-mark'." :group 'bbdb-mua-gnus :type 'symbol) (defcustom bbdb-mua-summary-mark "+" "Default mark for message addresses known to BBDB. If nil do not mark message addresses known to BBDB. See `bbdb-mua-summary-mark' and `bbdb-mua-summary-unify'. See also `bbdb-mua-summary-mark-field'." :group 'bbdb-mua :type '(choice (string :tag "Mark used") (const :tag "Do not mark known posters" nil))) (defcustom bbdb-mua-summary-unify-format-letter "B" "Letter required for `bbdb-mua-summary-unify' in the MUA Summary format string. For Gnus, combine it with the %u specifier in `gnus-summary-line-format' \(see there), for example use \"%U%R%z%I%(%[%4L: %-23,23uB%]%) %s\\n\". For VM, combine it with the %U specifier in `vm-summary-format' (see there), for example, use \"%n %*%a %-17.17UB %-3.3m %2d %4l/%-5c %I\\\"%s\\\"\\n\". This customization of `gnus-summary-line-format' / `vm-summary-format' is required to use `bbdb-mua-summary-unify'. Currently no other MUAs support this BBDB feature." :group 'bbdb-mua :type 'string) (defcustom bbdb-mua-summary-mark-format-letter "b" "Letter required for `bbdb-mua-summary-mark' in the MUA Summary format string. For Gnus, combine it with the %u specifier in `gnus-summary-line-format' \(see there), for example, use \"%U%R%z%I%(%[%4L: %ub%-23,23f%]%) %s\\n\". For VM, combine it with the %U specifier in `vm-summary-format' (see there), for example, use \"%n %*%a %Ub%-17.17F %-3.3m %2d %4l/%-5c %I\\\"%s\\\"\\n\". This customization of `gnus-summary-line-format' / `vm-summary-format' is required to use `bbdb-mua-summary-mark'. Currently no other MUAs support this BBDB feature." :group 'bbdb-mua :type 'string) ;;; Sending mail (defcustom bbdb-mail-user-agent mail-user-agent "Mail user agent used by BBDB. Allowed values are those allowed for `mail-user-agent'." :group 'bbdb-sendmail :type '(radio (function-item :tag "Message package" :format "%t\n" message-user-agent) (function-item :tag "Mail package" :format "%t\n" sendmail-user-agent) (function-item :tag "Emacs interface to MH" :format "%t\n" mh-e-user-agent) (function-item :tag "Message with full Gnus features" :format "%t\n" gnus-user-agent) (function-item :tag "VM" :format "%t\n" vm-user-agent) (function :tag "Other") (const :tag "Default" nil))) (defcustom bbdb-mail-name-format 'first-last "Format for names when sending mail. If first-last format names as \"Firstname Lastname\". If last-first format names as \"Lastname, Firstname\". If `bbdb-mail-name' returns the full name as a single string, this takes precedence over `bbdb-mail-name-format'. Likewise, if the mail address itself includes a name, this is not reformatted." :group 'bbdb-sendmail :type '(choice (const :tag "Firstname Lastname" first-last) (const :tag "Lastname, Firstname" last-first))) (defcustom bbdb-mail-name 'mail-name "Xfield holding the full name for a record when sending mail. This may also be a function taking one argument, a record. If it returns the full mail name as a single string, this is used \"as is\". If it returns a cons pair (FIRST . LAST) with the first and last name for this record, these are formatted obeying `bbdb-mail-name-format'." :group 'bbdb-sendmail :type '(choice (symbol :tag "xfield") (function :tag "mail name function"))) (defcustom bbdb-mail-alias-field 'mail-alias "Xfield holding the mail alias for a record. Used by `bbdb-mail-aliases'. See also `bbdb-mail-alias'." :group 'bbdb-sendmail :type 'symbol) (defcustom bbdb-mail-alias 'first "Defines which mail aliases are generated for a BBDB record. first: Generate one alias \"\" that expands to the first mail address of a record. star: Generate a second alias \"*\" that expands to all mail addresses of a record. all: Generate the aliases \"\" and \"*\" (as for 'star) and aliases \"n\" for each mail address, where n is the position of the mail address of a record." :group 'bbdb-sendmail :type '(choice (symbol :tag "Only first" first) (symbol :tag "* for all mails" star) (symbol :tag "All aliases" all))) (defcustom bbdb-mail-avoid-redundancy nil "Mail address to use for BBDB records when sending mail. If non-nil do not use full name in mail address when same as mail. If value is mail-only never use full name." :group 'bbdb-sendmail :type '(choice (const :tag "Allow redundancy" nil) (const :tag "Never use full name" 'mail-only) (const :tag "Avoid redundancy" t))) (defcustom bbdb-complete-mail t "If t MUA insinuation provides key binding for command `bbdb-complete-mail'." :group 'bbdb-sendmail :type 'boolean) (defcustom bbdb-completion-list t "Controls the behaviour of `bbdb-complete-mail'. If a list of symbols, it specifies which fields to complete. Symbols include fl-name (= first and last name) lf-name (= last and first name) organization aka mail (= all email addresses of each record) primary (= first email address of each record) If t, completion is done for all of the above. If nil, no completion is offered." ;; These symbols match the fields for which BBDB provides entries in ;; `bbdb-hash-table'. :group 'bbdb-sendmail :type '(choice (const :tag "No Completion" nil) (const :tag "Complete across all fields" t) (repeat :tag "Field" (choice (const fl-name) (const lf-name) (const aka) (const organization) (const primary) (const mail))))) (defcustom bbdb-complete-mail-allow-cycling nil "If non-nil cycle mail addresses when calling `bbdb-complete-mail'." :group 'bbdb-sendmail :type 'boolean) (defcustom bbdb-complete-mail-hook nil "List of functions called after a sucessful completion." :group 'bbdb-sendmail :type 'hook) (defcustom bbdb-mail-abbrev-expand-hook nil ;; Replacement for function `mail-abbrev-expand-hook'. "Function (not hook) run each time an alias is expanded. The function is called with two args the alias and the list of corresponding mail addresses." :group 'bbdb-sendmail :type 'function) (defcustom bbdb-completion-display-record t "If non-nil `bbdb-complete-mail' displays the BBDB record after completion." :group 'bbdb-sendmail :type '(choice (const :tag "Update the BBDB buffer" t) (const :tag "Do not update the BBDB buffer" nil))) ;;;Dialing (defcustom bbdb-dial-local-prefix-alist '(((if (integerp bbdb-default-area-code) (format "(%03d)" bbdb-default-area-code) (or bbdb-default-area-code "")) . "")) "Mapping to remove local prefixes from numbers. If this is non-nil, it should be an alist of \(PREFIX . REPLACEMENT) elements. The first part of a phone number matching the regexp returned by evaluating PREFIX will be replaced by the corresponding REPLACEMENT when dialing." :group 'bbdb-utilities-dialing :type 'sexp) (defcustom bbdb-dial-local-prefix nil "Local prefix digits. If this is non-nil, it should be a string of digits which your phone system requires before making local calls (for example, if your phone system requires you to dial 9 before making outside calls.) In BBDB's opinion, you're dialing a local number if it starts with a 0 after processing `bbdb-dial-local-prefix-alist'." :group 'bbdb-utilities-dialing :type '(choice (const :tag "No digits required" nil) (string :tag "Dial this first" "9"))) (defcustom bbdb-dial-long-distance-prefix nil "Long distance prefix digits. If this is non-nil, it should be a string of digits which your phone system requires before making a long distance call (one not in your local area code). For example, in some areas you must dial 1 before an area code. Note that this is used to replace the + sign in phone numbers when dialling (international dialing prefix.)" :group 'bbdb-utilities-dialing :type '(choice (const :tag "No digits required" nil) (string :tag "Dial this first" "1"))) (defcustom bbdb-dial-function nil "If non-nil this should be a function used for dialing phone numbers. This function is used by `bbdb-dial-number'. It requires one argument which is a string for the number that is dialed. If nil then `bbdb-dial-number' uses the tel URI syntax passed to `browse-url' to make the call." :group 'bbdb-utilities-dialing :type 'function) ;; Faces for font-lock (defgroup bbdb-faces nil "Faces used by BBDB." :group 'bbdb :group 'faces) (defface bbdb-name '((t (:inherit font-lock-function-name-face))) "Face used for BBDB names." :group 'bbdb-faces) ;; KEY needs to match the value of the xfield name-face, which is a string. ;; To avoid confusion, we make KEY a string, too, though symbols might be ;; faster. (defcustom bbdb-name-face-alist nil "Alist used for font-locking the name of a record. Each element should be a cons cell (KEY . FACE) with string KEY and face FACE. To use FACE for font-locking the name of a record, the xfield name-face of this record should have the value KEY. The value of name-face may also be a face which is then used directly. If none of these schemes succeeds, the face `bbdb-name' is used." :group 'bbdb-faces :type '(repeat (cons (symbol :tag "Key") (face :tag "Face")))) (defface bbdb-organization '((t (:inherit font-lock-comment-face))) "Face used for BBDB names." :group 'bbdb-faces) (defface bbdb-field-name '((t (:inherit font-lock-variable-name-face))) "Face used for BBDB names." :group 'bbdb-faces) ;;; Internal variables (eval-and-compile (defvar bbdb-debug t "Enable debugging if non-nil during compile time. You really should not disable debugging. But it will speed things up.")) (defconst bbdb-file-format 7 "BBDB file format.") (defconst bbdb-record-type '(vector (or string (const nil)) ; first name (or string (const nil)) ; last name (repeat string) ; affix (repeat string) ; aka (repeat string) ; organization (repeat (or (vector string string) (vector string integer integer integer integer))) ; phone (repeat (vector string (repeat string) string string string string)) ; address (repeat string) ; mail (repeat (cons symbol string)) ; xfields sexp) ; cache "Pseudo-code for the structure of a record. Used by `bbdb-record-type'.") (defconst bbdb-file-coding-system 'utf-8 "Coding system used for reading and writing `bbdb-file'.") (defvar bbdb-mail-aliases-need-rebuilt nil "Non-nil if mail aliases need to be rebuilt.") (defvar bbdb-need-to-sort nil "Non-nil if records require sorting after editing.") (defvar bbdb-buffer nil "Buffer visiting `bbdb-file'.") (defvar bbdb-buffer-name "*BBDB*" "Name of the BBDB buffer.") (defvar bbdb-silent-internal nil "Bind this to t to quiet things down - do not set it. See also `bbdb-silent'.") (defvar bbdb-notice-hook-pending nil "Bound to t if inside `bbdb-notice-mail-hook' or `bbdb-notice-record-hook'. Calls of `bbdb-change-hook' are suppressed when this is non-nil.") (defvar bbdb-init-forms '((gnus ; gnus 3.15 or newer (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)) (mh-e ; MH-E (add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh)) (rmail ; RMAIL (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)) (vm ; newer versions of vm do not have `vm-load-hook' (eval-after-load "vm" '(bbdb-insinuate-vm))) (mail ; the standard mail user agent (add-hook 'mail-setup-hook 'bbdb-insinuate-mail)) (sendmail (progn (message "BBDB: sendmail insinuation deprecated. Use mail.") (add-hook 'mail-setup-hook 'bbdb-insinuate-mail))) (message ; the gnus mail user agent (add-hook 'message-setup-hook 'bbdb-insinuate-message)) (sc ; supercite (add-hook 'sc-load-hook 'bbdb-insinuate-sc)) (anniv ; anniversaries (add-hook 'diary-list-entries-hook 'bbdb-anniv-diary-entries)) (pgp ; pgp-mail (progn (add-hook 'message-send-hook 'bbdb-pgp) (add-hook 'mail-send-hook 'bbdb-pgp)))) "Alist mapping features to insinuation forms.") (defvar bbdb-search-invert nil "Bind this variable to t in order to invert the result of `bbdb-search'.") (defvar bbdb-append-display nil "Controls the behavior of the command `bbdb-append-display'.") (defvar bbdb-offer-to-create nil "For communication between `bbdb-update-records' and `bbdb-query-create'.") (defvar bbdb-update-records-address nil "For communication between `bbdb-update-records' and `bbdb-query-create'. It is a list with elements (NAME MAIL HEADER HEADER-CLASS MUA).") ;;; Buffer-local variables for the database. (defvar bbdb-records nil "BBDB records list. In buffer `bbdb-file' this list includes all records. In the *BBDB* buffers it includes the records that are actually displayed and its elements are (RECORD DISPLAY-FORMAT MARKER-POS).") (make-variable-buffer-local 'bbdb-records) (defvar bbdb-changed-records nil "List of records that has been changed since BBDB was last saved. Use `bbdb-search-changed' to display these records.") (defvar bbdb-end-marker nil "Marker holding the buffer position of the end of the last record.") ;; The value 127 is an arbitrary prime number. ;; see elisp:Creating Symbols (defvar bbdb-hashtable (make-vector 127 0) "Hash table for BBDB records. Hashes the fields first-last-name, last-first-name, organization, aka, and mail. In elisp lingo, this is really an obarray.") (defvar bbdb-xfield-label-list nil "List of labels for xfields.") (defvar bbdb-organization-list nil "List of organizations known to BBDB.") (defvar bbdb-street-list nil "List of streets known to BBDB.") (defvar bbdb-city-list nil "List of cities known to BBDB.") (defvar bbdb-state-list nil "List of states known to BBDB.") (defvar bbdb-postcode-list nil "List of post codes known to BBDB.") (defvar bbdb-country-list nil "List of countries known to BBDB.") (defvar bbdb-modeline-info (make-vector 4 nil) "Precalculated mode line info for BBDB commands. This is a vector [APPEND-M INVERT-M APPEND INVERT]. APPEND-M is the mode line info if `bbdb-append-display' is non-nil. INVERT-M is the mode line info if `bbdb-search-invert' is non-nil. APPEND and INVERT appear in the message area.") ;;; Keymap (defvar bbdb-mode-map (let ((km (make-sparse-keymap))) (define-key km "*" 'bbdb-do-all-records) (define-key km "+" 'bbdb-append-display) (define-key km "!" 'bbdb-search-invert) (define-key km "a" 'bbdb-add-mail-alias) (define-key km "A" 'bbdb-mail-aliases) (define-key km "c" 'bbdb-create) (define-key km "e" 'bbdb-edit-field) (define-key km ";" 'bbdb-edit-foo) (define-key km "n" 'bbdb-next-record) (define-key km "p" 'bbdb-prev-record) (define-key km "N" 'bbdb-next-field) (define-key km "\t" 'bbdb-next-field) ; TAB (define-key km "P" 'bbdb-prev-field) (define-key km "\d" 'bbdb-prev-field) ; DEL (define-key km "d" 'bbdb-delete-field-or-record) (define-key km "\C-k" 'bbdb-delete-field-or-record) (define-key km "i" 'bbdb-insert-field) (define-key km "s" 'bbdb-save) (define-key km "\C-x\C-s" 'bbdb-save) (define-key km "t" 'bbdb-toggle-records-layout) (define-key km "T" 'bbdb-display-records-completely) (define-key km "o" 'bbdb-omit-record) (define-key km "m" 'bbdb-mail) (define-key km "M" 'bbdb-mail-address) (define-key km "\M-d" 'bbdb-dial) (define-key km "h" 'bbdb-info) (define-key km "?" 'bbdb-help) ;; (define-key km "q" 'quit-window) ; part of `special-mode' bindings (define-key km "\C-x\C-t" 'bbdb-transpose-fields) (define-key km "C" 'bbdb-copy-records-as-kill) (define-key km "u" 'bbdb-browse-url) ;; (define-key km "P" 'bbdb-print) (define-key km "=" 'delete-other-windows) ;; Search keys (define-key km "b" 'bbdb) (define-key km "/1" 'bbdb-display-records) (define-key km "/n" 'bbdb-search-name) (define-key km "/o" 'bbdb-search-organization) (define-key km "/p" 'bbdb-search-phone) (define-key km "/a" 'bbdb-search-address) (define-key km "/m" 'bbdb-search-mail) (define-key km "/N" 'bbdb-search-xfields) (define-key km "/x" 'bbdb-search-xfields) (define-key km "/c" 'bbdb-search-changed) (define-key km "/d" 'bbdb-search-duplicates) (define-key km "\C-xnw" 'bbdb-display-all-records) (define-key km "\C-xnd" 'bbdb-display-current-record) (define-key km [delete] 'scroll-down) ; 24.1: part of `special-mode' (define-key km " " 'scroll-up) ; 24.1: part of `special-mode' (define-key km [mouse-3] 'bbdb-mouse-menu) (define-key km [mouse-2] (lambda (event) ;; Toggle record layout (interactive "e") (save-excursion (posn-set-point (event-end event)) (bbdb-toggle-records-layout (bbdb-do-records t) current-prefix-arg)))) km) "Keymap for Insidious Big Brother Database. This is a child of `special-mode-map'.") (easy-menu-define bbdb-menu bbdb-mode-map "BBDB Menu" '("BBDB" ("Display" ["Previous field" bbdb-prev-field t] ["Next field" bbdb-next-field t] ["Previous record" bbdb-prev-record t] ["Next record" bbdb-next-record t] "--" ["Show all records" bbdb-display-all-records t] ["Show current record" bbdb-display-current-record t] ["Omit record" bbdb-omit-record t] "--" ["Toggle layout" bbdb-toggle-records-layout t] ["Show all fields" bbdb-display-records-completely t]) ("Searching" ["General search" bbdb t] ["Search one record" bbdb-display-records t] ["Search name" bbdb-search-name t] ["Search organization" bbdb-search-organization t] ["Search phone" bbdb-search-phone t] ["Search address" bbdb-search-address t] ["Search mail" bbdb-search-mail t] ["Search xfields" bbdb-search-xfields t] ["Search changed records" bbdb-search-changed t] ["Search duplicates" bbdb-search-duplicates t] "--" ["Old time stamps" bbdb-timestamp-older t] ["New time stamps" bbdb-timestamp-newer t] ["Old creation date" bbdb-creation-older t] ["New creation date" bbdb-creation-newer t] ["Creation date = time stamp" bbdb-creation-no-change t] "--" ["Append search" bbdb-append-display t] ["Invert search" bbdb-search-invert t]) ("Mail" ["Send mail" bbdb-mail t] ["Save mail address" bbdb-mail-address t] "--" ["Add mail alias" bbdb-add-mail-alias t] ["(Re-)Build mail aliases" bbdb-mail-aliases t]) ("Use database" ["Prefix: do all records" bbdb-do-all-records t] "--" ["Send mail" bbdb-mail t] ["Dial phone number" bbdb-dial t] ["Browse URL" bbdb-browse-url t] ["Copy records as kill" bbdb-copy-records-as-kill t] "--" ["Print records" bbdb-print t]) ("Manipulate database" ["Prefix: do all records" bbdb-do-all-records t] "--" ["Create new record" bbdb-create t] ["Edit current field" bbdb-edit-field t] ["Insert new field" bbdb-insert-field t] ["Edit some field" bbdb-edit-foo t] ["Transpose fields" bbdb-transpose-fields t] ["Delete record or field" bbdb-delete-field-or-record t] "--" ["Sort addresses" bbdb-sort-addresses t] ["Sort phones" bbdb-sort-phones t] ["Sort xfields" bbdb-sort-xfields t] ["Merge records" bbdb-merge-records t] ["Sort database" bbdb-sort-records t] ["Delete duplicate mails" bbdb-delete-redundant-mails t] "--" ["Save BBDB" bbdb-save t] ["Revert BBDB" revert-buffer t]) ("Help" ["Brief help" bbdb-help t] ["BBDB Manual" bbdb-info t]) "--" ["Quit" quit-window t])) (defvar bbdb-completing-read-mails-map (let ((map (copy-keymap minibuffer-local-completion-map))) (define-key map " " 'self-insert-command) (define-key map "\t" 'bbdb-complete-mail) (define-key map "\M-\t" 'bbdb-complete-mail) map) "Keymap used by `bbdb-completing-read-mails'.") ;;; Helper functions (defun bbdb-warn (&rest args) "Display a message at the bottom of the screen. ARGS are passed to `message'." (ding t) (apply 'message args)) (defsubst bbdb-string-trim (string) "Remove leading and trailing whitespace and all properties from STRING. If STRING is nil return an empty string." (if (null string) "" (if (string-match "\\`[ \t\n]+" string) (setq string (substring string (match-end 0)))) (if (string-match "[ \t\n]+\\'" string) (setq string (substring string 0 (match-beginning 0)))) (substring-no-properties string))) (defsubst bbdb-string= (str1 str2) "Return t if strings STR1 and STR2 are equal, ignoring case." (and (stringp str1) (stringp str2) (eq t (compare-strings str1 0 nil str2 0 nil t)))) (defun bbdb-split (separator string) "Split STRING into list of substrings bounded by matches for SEPARATORS. SEPARATOR may be a regexp. SEPARATOR may also be a symbol \(a field name). Then look up the value in `bbdb-separator-alist' or use `bbdb-default-separator'. Whitespace around SEPARATOR is ignored unless SEPARATOR matches the string \" \\t\\n\". Almost the inverse function of `bbdb-concat'." (if (symbolp separator) (setq separator (car (or (cdr (assq separator bbdb-separator-alist)) bbdb-default-separator)))) (unless (string-match separator " \t\n") (setq separator (concat "[ \t\n]*" separator "[ \t\n]*"))) ;; `split-string' applied to an empty STRING gives nil. (split-string (bbdb-string-trim string) separator t)) (defun bbdb-concat (separator &rest strings) "Concatenate STRINGS to a string sticking in SEPARATOR. STRINGS may be strings or lists of strings. Empty strings are ignored. SEPARATOR may be a string. SEPARATOR may also be a symbol (a field name). Then look up the value of SEPARATOR in `bbdb-separator-alist' or use `bbdb-default-separator'. The inverse function of `bbdb-split'." (if (symbolp separator) (setq separator (nth 1 (or (cdr (assq separator bbdb-separator-alist)) bbdb-default-separator)))) (mapconcat 'identity (delete "" (apply 'append (mapcar (lambda (x) (if (stringp x) (list x) x)) strings))) separator)) (defun bbdb-list-strings (list) "Remove all elements from LIST which are not non-empty strings." (let (new-list) (dolist (elt list) (if (and (stringp elt) (not (string= "" elt))) (push elt new-list))) (nreverse new-list))) ;; A call of `indent-region' swallows any indentation ;; that might be part of the field itself. So we indent manually. (defsubst bbdb-indent-string (string column) "Indent nonempty lines in STRING to COLUMN (except first line). This happens in addition to any pre-defined indentation of STRING." (replace-regexp-in-string "\n\\([^\n]\\)" (concat "\n" (make-string column ?\s) "\\1") string)) (defun bbdb-read-string (prompt &optional init collection require-match) "Read a string, trimming whitespace and text properties. PROMPT is a string to prompt with. INIT appears as initial input which is useful for editing existing records. COLLECTION and REQUIRE-MATCH have the same meaning as in `completing-read'." (bbdb-string-trim (if collection ;; Hack: In `minibuffer-local-completion-map' remove ;; the binding of SPC to `minibuffer-complete-word' ;; and of ? to `minibuffer-completion-help'. (minibuffer-with-setup-hook (lambda () (use-local-map (let ((map (make-sparse-keymap))) (set-keymap-parent map (current-local-map)) (define-key map " " nil) (define-key map "?" nil) map))) (completing-read prompt collection nil require-match init)) (read-string prompt init)))) (defun bbdb-add-to-list (list-var element) "Add ELEMENT to the value of LIST-VAR if it isn't there yet and non-nil. The test for presence of ELEMENT is done with `equal'. The return value is the new value of LIST-VAR." (if (or (not element) (member element (symbol-value list-var))) (symbol-value list-var) (set list-var (cons element (symbol-value list-var))))) (defun bbdb-current-record (&optional full) "Return the record point is at. If FULL is non-nil record includes the display information." (unless (eq major-mode 'bbdb-mode) (error "This only works while in BBDB buffers.")) (let ((num (get-text-property (if (and (not (bobp)) (eobp)) (1- (point)) (point)) 'bbdb-record-number)) record) (unless num (error "Not a BBDB record")) (setq record (nth num bbdb-records)) (if full record (car record)))) (defun bbdb-current-field () "Return current field point is on." (unless (bbdb-current-record) (error "Not a BBDB record")) (get-text-property (point) 'bbdb-field)) (defmacro bbdb-debug (&rest body) "Excecute BODY just like `progn' with debugging capability. Debugging is enabled if variable `bbdb-debug' is non-nil during compile. You really should not disable debugging. But it will speed things up." (declare (indent 0)) (if bbdb-debug ; compile-time switch `(let ((debug-on-error t)) ,@body))) (defun bbdb-timestamp (record) "For use as an element of `bbdb-change-hook'. Maintains an xfield `timestamp' for RECORD which contains the time when it was last modified. If such a field already exists, it is changed, otherwise it is added." (bbdb-record-set-xfield record 'timestamp (format-time-string bbdb-time-stamp-format nil t))) (defun bbdb-creation-date (record) "For use as an element of `bbdb-create-hook'. Adds an xfield `creation-date' for RECORD which is the current time string." (bbdb-record-set-xfield record 'creation-date (format-time-string bbdb-time-stamp-format nil t))) (defun bbdb-multiple-buffers-default () "Default function for guessing a name for new *BBDB* buffers. May be used as value of variable `bbdb-multiple-buffers'." (save-current-buffer (cond ((memq major-mode '(vm-mode vm-summary-mode vm-presentation-mode vm-virtual-mode)) (vm-select-folder-buffer) (buffer-name)) ((memq major-mode '(gnus-summary-mode gnus-group-mode)) (set-buffer gnus-article-buffer) (buffer-name)) ((memq major-mode '(mail-mode vm-mail-mode message-mode)) "message composition")))) (defsubst bbdb-add-job (spec record string) "Internal function: Evaluate SPEC for RECORD and STRING. If SPEC is a function call it with args RECORD and STRING. Return value. If SPEC is a regexp, return 'query unless SPEC matches STRING. Otherwise return SPEC. Used with variable `bbdb-add-name' and friends." (cond ((functionp spec) (funcall spec record string)) ((stringp spec) (unless (string-match spec string) 'query)) ; be least aggressive (spec))) (defsubst bbdb-eval-spec (spec prompt) "Internal function: Evaluate SPEC using PROMPT. Return t if either SPEC equals t, or SPEC equals 'query and `bbdb-silent' is non-nil or `y-or-no-p' returns t using PROMPT. Used with return values of `bbdb-add-job'." (or (eq spec t) (and (eq spec 'query) (or bbdb-silent (y-or-n-p prompt))))) (defun bbdb-clean-address-components (components) "Clean mail address COMPONENTS. COMPONENTS is a list (FULL-NAME CANONICAL-ADDRESS) as returned by `mail-extract-address-components'. Pass FULL-NAME through `bbdb-message-clean-name-function' and CANONICAL-ADDRESS through `bbdb-canonicalize-mail-function'." (list (if (car components) (if bbdb-message-clean-name-function (funcall bbdb-message-clean-name-function (car components)) (car components))) (if (cadr components) (if bbdb-canonicalize-mail-function (funcall bbdb-canonicalize-mail-function (cadr components)) ;; Minimalistic clean-up (bbdb-string-trim (cadr components)))))) (defun bbdb-extract-address-components (address &optional all) "Given an RFC-822 address ADDRESS, extract full name and canonical address. This function behaves like `mail-extract-address-components', but it passes its return value through `bbdb-clean-address-components'. See also `bbdb-decompose-bbdb-address'." (if all (mapcar 'bbdb-clean-address-components (mail-extract-address-components address t)) (bbdb-clean-address-components (mail-extract-address-components address)))) ;; Inspired by `gnus-extract-address-components' from gnus-utils. (defun bbdb-decompose-bbdb-address (mail) "Given an RFC-822 address MAIL, extract full name and canonical address. In general, this function behaves like the more sophisticated function `mail-extract-address-components'. Yet for an address `' lacking a real name the latter function returns the name \"Joe Smith\". This is useful when analyzing the headers of email messages we receive from the outside world. Yet when analyzing the mail addresses stored in BBDB, this pollutes the mail-aka space. So we define here an intentionally much simpler function for decomposing the names and canonical addresses in the mail field of BBDB records." (let (name address) ;; First find the address - the thing with the @ in it. (cond (;; Check `' first in order to handle the quite common ;; form `"abc@xyz" ' (i.e. `@' as part of a comment) ;; correctly. (string-match "<\\([^@ \t<>]+[!@][^@ \t<>]+\\)>" mail) (setq address (match-string 1 mail))) ((string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" mail) (setq address (match-string 0 mail)))) ;; Then check whether the `name
' format is used. (and address ;; Linear white space is not required. (string-match (concat "[ \t]*<" (regexp-quote address) ">") mail) (setq name (substring mail 0 (match-beginning 0))) ;; Strip any quotes mail the name. (string-match "^\".*\"$" name) (setq name (substring name 1 (1- (match-end 0))))) ;; If not, then check whether the `address (name)' format is used. (or name (and (string-match "(\\([^)]+\\))" mail) (setq name (match-string 1 mail)))) (list (if (equal name "") nil name) (or address mail)))) ;;; Massage of mail addresses (defcustom bbdb-canonical-hosts ;; Example (regexp-opt '("cs.cmu.edu" "ri.cmu.edu")) "Regexp matching the canonical part of the domain part of a mail address. If the domain part of a mail address matches this regexp, the domain is replaced by the substring that actually matched this address. Used by `bbdb-canonicalize-mail-1'. See also `bbdb-ignore-redundant-mails'." :group 'bbdb-mua :type '(regexp :tag "Regexp matching sites")) (defun bbdb-canonicalize-mail-1 (address) "Example of `bbdb-canonicalize-mail-function'. However, this function is too specific to be useful for the general user. Take it as a source of inspiration for what can be done." (setq address (bbdb-string-trim address)) (cond ;; Rewrite mail-drop hosts. ;; RW: The following is now also handled by `bbdb-ignore-redundant-mails' ((string-match (concat "\\`\\([^@%!]+@\\).*\\.\\(" bbdb-canonical-hosts "\\)\\'") address) (concat (match-string 1 address) (match-string 2 address))) ;; ;; Here at Lucid, our workstation names sometimes get into our mail ;; addresses in the form "jwz%thalidomide@lucid.com" (instead of simply ;; "jwz@lucid.com"). This removes the workstation name. ((string-match "\\`\\([^@%!]+\\)%[^@%!.]+@\\(lucid\\.com\\)\\'" address) (concat (match-string 1 address) "@" (match-string 2 address))) ;; ;; Another way that our local mailer is misconfigured: sometimes addresses ;; which should look like "user@some.outside.host" end up looking like ;; "user%some.outside.host" or even "user%some.outside.host@lucid.com" ;; instead. This rule rewrites it into the original form. ((string-match "\\`\\([^@%]+\\)%\\([^@%!]+\\)\\(@lucid\\.com\\)?\\'" address) (concat (match-string 1 address) "@" (match-string 2 address))) ;; ;; Sometimes I see addresses like "foobar.com!user@foobar.com". ;; That's totally redundant, so this rewrites it as "user@foobar.com". ((string-match "\\`\\([^@%!]+\\)!\\([^@%!]+[@%]\\1\\)\\'" address) (match-string 2 address)) ;; ;; Sometimes I see addresses like "foobar.com!user". Turn it around. ((string-match "\\`\\([^@%!.]+\\.[^@%!]+\\)!\\([^@%]+\\)\\'" address) (concat (match-string 2 address) "@" (match-string 1 address))) ;; ;; The mailer at hplb.hpl.hp.com tends to puke all over addresses which ;; pass through mailing lists which are maintained there: it turns normal ;; addresses like "user@foo.com" into "user%foo.com@hplb.hpl.hp.com". ;; This reverses it. (I actually could have combined this rule with ;; the similar lucid.com rule above, but then the regexp would have been ;; more than 80 characters long...) ((string-match "\\`\\([^@!]+\\)%\\([^@%!]+\\)@hplb\\.hpl\\.hp\\.com\\'" address) (concat (match-string 1 address) "@" (match-string 2 address))) ;; ;; Another local mail-configuration botch: sometimes mail shows up ;; with addresses like "user@workstation", where "workstation" is a ;; local machine name. That should really be "user" or "user@netscape.com". ;; (I'm told this one is due to a bug in SunOS 4.1.1 sendmail.) ((string-match "\\`\\([^@%!]+\\)[@%][^@%!.]+\\'" address) (match-string 1 address)) ;; ;; Sometimes I see addresses like "foo%somewhere%uunet.uu.net@somewhere.else". ;; This is silly, because I know that I can send mail to uunet directly. ((string-match ".%uunet\\.uu\\.net@[^@%!]+\\'" address) (concat (substring address 0 (+ (match-beginning 0) 1)) "@UUNET.UU.NET")) ;; ;; Otherwise, leave it as it is. (t address))) (defun bbdb-message-clean-name-default (name) "Default function for `bbdb-message-clean-name-function'. This strips garbage from the user full NAME string." ;; Remove leading non-alpha chars (if (string-match "\\`[^[:alpha:]]+" name) (setq name (substring name (match-end 0)))) (if (string-match "^\\([^@]+\\)@" name) ;; The name is really a mail address and we use the part preceeding "@". ;; Everything following "@" is ignored. (setq name (match-string 1 name))) ;; Replace "firstname.surname" by "firstname surname". ;; Do not replace ". " with " " because that could be an initial. (setq name (replace-regexp-in-string "\\.\\([^ ]\\)" " \\1" name)) ;; Replace tabs, spaces, and underscores with a single space. (setq name (replace-regexp-in-string "[ \t\n_]+" " " name)) ;; Remove trailing comments separated by "(" or " [-#]" ;; This does not work all the time because some of our friends in ;; northern europe have brackets in their names... (if (string-match "[^ \t]\\([ \t]*\\((\\| [-#]\\)\\)" name) (setq name (substring name 0 (match-beginning 1)))) ;; Remove phone extensions (like "x1234" and "ext. 1234") (let ((case-fold-search t)) (setq name (replace-regexp-in-string "\\W+\\(x\\|ext\\.?\\)\\W*[-0-9]+" "" name))) ;; Remove trailing non-alpha chars (if (string-match "[^[:alpha:]]+\\'" name) (setq name (substring name 0 (match-beginning 0)))) ;; Remove text properties (substring-no-properties name)) ;; BBDB data structure (defmacro bbdb-defstruct (name &rest elts) "Define two functions to operate on vector NAME for each symbol ELT in ELTS. The function bbdb-NAME-ELT returns the element ELT in vector NAME. The function bbdb-NAME-set-ELT sets ELT. Also define a constant bbdb-NAME-length that holds the number of ELTS in vector NAME." (declare (indent 1)) (let* ((count 0) (sname (symbol-name name)) (uname (upcase sname)) (cname (concat "bbdb-" sname "-")) body) (dolist (elt elts) (let* ((selt (symbol-name elt)) (setname (intern (concat cname "set-" selt)))) (push (list 'defsubst (intern (concat cname selt)) `(,name) (format "For BBDB %s read element %i `%s'." uname count selt) ;; Use `elt' instead of `aref' so that these functions ;; also work for the `bbdb-record-type' pseudo-code. `(elt ,name ,count)) body) (push (list 'defsubst setname `(,name value) (format "For BBDB %s set element %i `%s' to VALUE. \ Return VALUE. Do not call this function directly. Call instead `bbdb-record-set-field' which ensures the integrity of the database. Also, this makes your code more robust with respect to possible future changes of BBDB's innermost internals." uname count selt) `(aset ,name ,count value)) body)) (setq count (1+ count))) (push (list 'defconst (intern (concat cname "length")) count (concat "Length of BBDB `" sname "'.")) body) (cons 'progn body))) ;; Define RECORD: (bbdb-defstruct record firstname lastname affix aka organization phone address mail xfields cache) ;; Define PHONE: (bbdb-defstruct phone label area exchange suffix extension) ;; Define ADDRESS: (bbdb-defstruct address label streets city state postcode country) ;; Define record CACHE: ;; - fl-name (first and last name of the person referred to by the record), ;; - lf-name (last and first name of the person referred to by the record), ;; - mail-aka (list of names associated with mail addresses) ;; - mail-canon (list of canonical mail addresses) ;; - sortkey (the concatenation of the elements used for sorting the record), ;; - marker (position of beginning of record in `bbdb-file') (bbdb-defstruct cache fl-name lf-name mail-aka mail-canon sortkey marker) (defsubst bbdb-record-mail-aka (record) "Record cache function: Return mail-aka for RECORD." (bbdb-cache-mail-aka (bbdb-record-cache record))) (defsubst bbdb-record-mail-canon (record) "Record cache function: Return mail-canon for RECORD." (bbdb-cache-mail-canon (bbdb-record-cache record))) (defun bbdb-empty-record () "Return a new empty record structure with a cache. It is the caller's responsibility to make the new record known to BBDB." (let ((record (make-vector bbdb-record-length nil))) (bbdb-record-set-cache record (make-vector bbdb-cache-length nil)) record)) ;; `bbdb-hashtable' associates with each KEY a list of matching records. ;; KEY includes fl-name, lf-name, organizations, AKAs and email addresses. ;; When loading the database the hash table is initialized by calling ;; `bbdb-hash-record' for each record. This function is also called ;; when new records are added to the database. ;; `bbdb-delete-record-internal' with arg REMHASH non-nil removes a record ;; from the hash table (besides deleting the record from the database). ;; When an existing record is modified, the code that modifies the record ;; needs to update the hash table, too. This includes removing the outdated ;; associations between KEYs and record as well as adding the new associations. ;; The hash table can be accessed via `bbdb-gethash' ;; and via functions like `completing-read'. (defun bbdb-puthash (key record) "Associate RECORD with KEY in `bbdb-hashtable'. KEY must be a string or nil. Empty strings and nil are ignored." (if (and key (not (string= "" key))) ; do not hash empty strings (let ((sym (intern (downcase key) bbdb-hashtable))) (if (boundp sym) (add-to-list sym record nil 'eq) (set sym (list record)))))) (defun bbdb-gethash (key &optional predicate) "Return list of records associated with KEY in `bbdb-hashtable'. KEY must be a string or nil. Empty strings and nil are ignored. PREDICATE may take the same values as `bbdb-completion-list'." (when (and key (not (string= "" key))) (let* ((key (downcase key)) (all-records (symbol-value (intern-soft key bbdb-hashtable))) records) (if (or (not predicate) (eq t predicate)) all-records (dolist (record all-records) (if (catch 'bbdb-hash-ok (bbdb-hash-p key record predicate)) (push record records))) records)))) (defun bbdb-hash-p (key record predicate) "Throw `bbdb-hash-ok' non-nil if KEY matches RECORD acording to PREDICATE. PREDICATE may take the same values as the elements of `bbdb-completion-list'." (if (and (memq 'fl-name predicate) (bbdb-string= key (or (bbdb-record-name record) ""))) (throw 'bbdb-hash-ok 'fl-name)) (if (and (memq 'lf-name predicate) (bbdb-string= key (or (bbdb-record-name-lf record) ""))) (throw 'bbdb-hash-ok 'lf-name)) (if (memq 'organization predicate) (mapc (lambda (organization) (if (bbdb-string= key organization) (throw 'bbdb-hash-ok 'organization))) (bbdb-record-organization record))) (if (memq 'aka predicate) (mapc (lambda (aka) (if (bbdb-string= key aka) (throw 'bbdb-hash-ok 'aka))) (bbdb-record-field record 'aka-all))) (if (and (memq 'primary predicate) (bbdb-string= key (car (bbdb-record-mail-canon record)))) (throw 'bbdb-hash-ok 'primary)) (if (memq 'mail predicate) (mapc (lambda (mail) (if (bbdb-string= key mail) (throw 'bbdb-hash-ok 'mail))) (bbdb-record-mail-canon record))) nil) (defun bbdb-remhash (key record) "Remove RECORD from list of records associated with KEY. KEY must be a string or nil. Empty strings and nil are ignored." (if (and key (not (string= "" key))) (let ((sym (intern-soft (downcase key) bbdb-hashtable))) (if sym (let ((val (delq record (symbol-value sym)))) (if val (set sym val) (unintern sym bbdb-hashtable))))))) (defun bbdb-hash-record (record) "Insert RECORD in `bbdb-hashtable'. This performs all initializations required for a new record. Do not call this for existing records that require updating." (bbdb-puthash (bbdb-record-name record) record) (bbdb-puthash (bbdb-record-name-lf record) record) (dolist (organization (bbdb-record-organization record)) (bbdb-puthash organization record)) (dolist (aka (bbdb-record-aka record)) (bbdb-puthash aka record)) (bbdb-puthash-mail record)) (defun bbdb-puthash-mail (record) "For RECORD put mail into `bbdb-hashtable'." (let (mail-aka mail-canon address) (dolist (mail (bbdb-record-mail record)) (setq address (bbdb-decompose-bbdb-address mail)) (when (car address) (push (car address) mail-aka) (bbdb-puthash (car address) record)) (push (nth 1 address) mail-canon) (bbdb-puthash (nth 1 address) record)) (bbdb-cache-set-mail-aka (bbdb-record-cache record) (nreverse mail-aka)) (bbdb-cache-set-mail-canon (bbdb-record-cache record) (nreverse mail-canon)))) (defun bbdb-hash-update (record old new) "Update hash for RECORD. Remove OLD, insert NEW. Both OLD and NEW are lists of values." (dolist (elt old) (bbdb-remhash elt record)) (dolist (elt new) (bbdb-puthash elt record))) (defun bbdb-check-name (first last &optional record) "Check whether the name FIRST LAST is a valid name. This throws an error if the name is already used by another record and `bbdb-allow-duplicates' is nil. If RECORD is non-nil, FIRST and LAST may correspond to RECORD without raising an error." ;; Are there more useful checks for names beyond checking for duplicates? (unless bbdb-allow-duplicates (let* ((name (bbdb-concat 'name-first-last first last)) (records (bbdb-gethash name '(fl-name lf-name aka)))) (if (or (and (not record) records) (remq record records)) (error "%s is already in BBDB" name))))) (defun bbdb-record-name (record) "Record cache function: Return the full name FIRST_LAST of RECORD. If the name is not available in the name cache, the name cache value is generated and stored." (or (bbdb-cache-fl-name (bbdb-record-cache record)) ;; Build the name cache for a record. (bbdb-record-set-name record t t))) (defun bbdb-record-name-lf (record) "Record cache function: Return the full name LAST_FIRST of RECORD. If the name is not available in the name cache, the name cache value is generated and stored." (or (bbdb-cache-lf-name (bbdb-record-cache record)) ;; Build the name cache for a record. (progn (bbdb-record-set-name record t t) (bbdb-cache-lf-name (bbdb-record-cache record))))) (defun bbdb-record-set-name (record first last) "Record cache function: For RECORD set full name based on FIRST and LAST. If FIRST or LAST are t use respective existing entries of RECORD. Set full name in cache and hash. Also set `bbdb-need-to-sort'. Return first-last name." (let* ((cache (bbdb-record-cache record)) (fl-name (bbdb-cache-fl-name cache)) (lf-name (bbdb-cache-lf-name cache))) (if fl-name (bbdb-remhash fl-name record)) (if lf-name (bbdb-remhash lf-name record))) (if (eq t first) (setq first (bbdb-record-firstname record)) (setq bbdb-need-to-sort (or bbdb-need-to-sort (not (equal first (bbdb-record-firstname record))))) (bbdb-record-set-firstname record first)) (if (eq t last) (setq last (bbdb-record-lastname record)) (setq bbdb-need-to-sort (or bbdb-need-to-sort (not (equal last (bbdb-record-lastname record))))) (bbdb-record-set-lastname record last)) (let ((fl-name (bbdb-concat 'name-first-last first last)) (lf-name (bbdb-concat 'name-last-first last first)) (cache (bbdb-record-cache record))) ;; Set cache of RECORD (bbdb-cache-set-fl-name cache fl-name) (bbdb-cache-set-lf-name cache lf-name) ;; Set hash. For convenience, the hash contains the full name ;; as first-last and last-fist. (bbdb-puthash fl-name record) (bbdb-puthash lf-name record) fl-name)) (defun bbdb-record-sortkey (record) "Record cache function: Return the sortkey for RECORD. Build and store it if necessary." (or (bbdb-cache-sortkey (bbdb-record-cache record)) (bbdb-cache-set-sortkey (bbdb-record-cache record) (downcase (bbdb-concat "" (bbdb-record-lastname record) (bbdb-record-firstname record) (bbdb-record-organization record)))))) (defsubst bbdb-record-set-sortkey (record sortkey) "Record cache function: Set and return RECORD's SORTKEY." (bbdb-cache-set-sortkey (bbdb-record-cache record) sortkey)) (defsubst bbdb-record-marker (record) "Record cache function: Return the marker for RECORD." (bbdb-cache-marker (bbdb-record-cache record))) (defsubst bbdb-record-set-marker (record marker) "Record cache function: Set and return RECORD's MARKER." (bbdb-cache-set-marker (bbdb-record-cache record) marker)) (defsubst bbdb-record-xfield (record label) "For RECORD return value of xfield LABEL. Return nil if xfield LABEL is undefined." (cdr (assq label (bbdb-record-xfields record)))) ;; The values of xfields are always strings. The following function ;; comes handy if we want to treat these values as symbols. (defun bbdb-record-xfield-intern (record label) "For RECORD return interned value of xfield LABEL. Return nil if xfield LABEL does not exist." (let ((value (bbdb-record-xfield record label))) (if value (intern value)))) (defsubst bbdb-record-xfield-split (record label) "For RECORD return value of xfield LABEL split as a list. Splitting is based on `bbdb-separator-alist'." (let ((val (bbdb-record-xfield record label))) (if val (bbdb-split label val)))) (defun bbdb-record-set-xfield (record label value) "For RECORD set xfield LABEL to VALUE. If VALUE is nil or an empty string, remove xfield LABEL from RECORD. Return VALUE." ;; In principle we can also have xfield labels `name' or `mail', etc. ;; Yet the actual code would get rather confused. So we throw an error. (if (memq label '(name firstname lastname affix organization mail aka phone address xfields)) (error "xfield label `%s' illegal" label)) (if (eq label 'mail-alias) (setq bbdb-mail-aliases-need-rebuilt 'edit)) (if (and value (string= "" value)) (setq value nil)) (let ((old-xfield (assq label (bbdb-record-xfields record)))) ;; Do nothing if both OLD-XFIELD and VALUE are nil. (cond ((and old-xfield value) ; update (setcdr old-xfield value)) (value ; new xfield (add-to-list 'bbdb-xfield-label-list label nil 'eq) (bbdb-record-set-xfields record (append (bbdb-record-xfields record) (list (cons label value))))) (old-xfield ; remove (bbdb-record-set-xfields record (delq old-xfield (bbdb-record-xfields record)))))) value) (defun bbdb-check-type (object type &optional abort extended) "Return non-nil if OBJECT is of type TYPE. TYPE is a pseudo-code as in `bbdb-record-type'. If ABORT is non-nil, abort with error message if type checking fails. If EXTENDED is non-nil, consider extended atomic types which may include symbols, numbers, markers, and strings." (let (tmp) ;; Add more predicates? Compare info node `(elisp.info)Type Predicates'. (or (cond ((eq type 'symbol) (symbolp object)) ((eq type 'integer) (integerp object)) ((eq type 'marker) (markerp object)) ((eq type 'number) (numberp object)) ((eq type 'string) (stringp object)) ((eq type 'sexp) t) ; matches always ((eq type 'face) (facep object)) ;; not quite a type ((eq type 'bound) (and (symbolp object) (boundp object))) ((eq type 'function) (functionp object)) ((eq type 'vector) (vectorp object)) ((and extended (cond ((symbolp type) (setq tmp (eq type object)) t) ((or (numberp type) (markerp type)) (setq tmp (= type object)) t) ((stringp type) (setq tmp (and (stringp object) (string= type object))) t))) tmp) ((not (consp type)) (error "Atomic type `%s' undefined" type)) ((eq 'const (setq tmp (car type))) (equal (nth 1 type) object)) ((eq tmp 'cons) (and (consp object) (bbdb-check-type (car object) (nth 1 type) abort extended) (bbdb-check-type (cdr object) (nth 2 type) abort extended))) ((eq tmp 'list) (and (listp object) (eq (length (cdr type)) (length object)) (let ((type (cdr type)) (object object) (ok t)) (while type (unless (bbdb-check-type (pop object) (pop type) abort extended) (setq ok nil type nil))) ok))) ((eq tmp 'repeat) (and (listp object) (let ((tp (nth 1 type)) (object object) (ok t)) (while object (unless (bbdb-check-type (pop object) tp abort extended) (setq ok nil object nil))) ok))) ((eq tmp 'vector) (and (vectorp object) (let* ((i 0) (type (cdr type)) (ok (eq (length object) (length type)))) (when ok (while type (if (bbdb-check-type (aref object i) (pop type) abort extended) (setq i (1+ i)) (setq ok nil type nil))) ok)))) ((eq tmp 'or) ; like customize `choice' type (let ((type (cdr type)) ok) (while type (if (bbdb-check-type object (pop type) nil extended) (setq ok t type nil))) ok)) ;; User-defined predicate ((eq tmp 'user-p) (funcall (nth 1 type) object)) (t (error "Compound type `%s' undefined" tmp))) (and abort (error "Type mismatch: expect %s, got `%s'" type object))))) ;; (bbdb-check-type 'bar 'symbol) ;; (bbdb-check-type 'bar 'bar) ;; (bbdb-check-type "foo" 'symbol t) ;; (bbdb-check-type "foo" '(or symbol string)) ;; (bbdb-check-type nil '(const nil)) ;; (bbdb-check-type '(bar . "foo") '(cons symbol string)) ;; (bbdb-check-type '(bar "foo") '(list symbol string)) ;; (bbdb-check-type '("bar" "foo") '(repeat string)) ;; (bbdb-check-type (vector 'bar "foo") '(vector symbol string)) ;; (bbdb-check-type (vector 'bar "foo") 'vector) ;; (bbdb-check-type '(bar (bar . "foo")) '(list symbol (cons symbol string))) ;; (bbdb-check-type '("aa" . "bb") '(or (const nil) (cons string string)) t) ;; (bbdb-check-type nil '(or nil (cons string string)) t t) ;; (bbdb-check-type "foo" '(user-p (lambda (a) (stringp a)))) ;; (bbdb-check-type 'set 'function) (defun bbdb-record-field (record field) "For RECORD return the value of FIELD. FIELD may take the following values firstname Return the first name of RECORD lastname Return the last name of RECORD name Return the full name of RECORD (first name first) name-lf Return the full name of RECORD (last name first) affix Return the list of affixes organization Return the list of organizations aka Return the list of AKAs aka-all Return the list of AKAs plus mail-akas. mail Return the list of email addresses mail-aka Return the list of name parts in mail addresses mail-canon Return the list of canonical mail addresses. phone Return the list of phone numbers address Return the list of addresses xfields Return the list of all xfields Any other symbol is interpreted as the label for an xfield. Then return the value of this xfield. See also `bbdb-record-set-field'." (cond ((eq field 'firstname) (bbdb-record-firstname record)) ((eq field 'lastname) (bbdb-record-lastname record)) ((eq field 'name) (bbdb-record-name record)) ((eq field 'name-lf) (bbdb-record-name-lf record)) ((eq field 'affix) (bbdb-record-affix record)) ((eq field 'organization) (bbdb-record-organization record)) ((eq field 'mail) (bbdb-record-mail record)) ((eq field 'mail-canon) (bbdb-record-mail-canon record)) ; derived (cached) field ((eq field 'mail-aka) (bbdb-record-mail-aka record)) ; derived (cached) field ((eq field 'aka) (bbdb-record-aka record)) ((eq field 'aka-all) (append (bbdb-record-aka record) ; derived field (bbdb-record-mail-aka record))) ((eq field 'phone) (bbdb-record-phone record)) ((eq field 'address) (bbdb-record-address record)) ;; Return all xfields ((eq field 'xfields) (bbdb-record-xfields record)) ;; Return xfield FIELD (e.g., `notes') or nil if FIELD is not defined. ((symbolp field) (bbdb-record-xfield record field)) (t (error "Unknown field type `%s'" field)))) (define-obsolete-function-alias 'bbdb-record-get-field 'bbdb-record-field) (defun bbdb-record-set-field (record field value &optional merge check) "For RECORD set FIELD to VALUE. Return VALUE. If MERGE is non-nil, merge VALUE with the current value of FIELD. If CHECK is non-nil, check syntactically whether FIELD may take VALUE. This function also updates the hash table. However, it does not update RECORD in the database. Use `bbdb-change-record' for that. FIELD may take the following values firstname VALUE is the first name of RECORD lastname VALUE is the last name of RECORD name VALUE is the full name of RECORD either as one string or as a cons pair (FIRST . LAST) affix VALUE is the list of affixes organization VALUE is the list of organizations aka VALUE is the list of AKAs mail VALUE is the list of email addresses phone VALUE is the list of phone numbers address VALUE is the list of addresses xfields VALUE is the list of all xfields Any other symbol is interpreted as the label for an xfield. Then VALUE is the value of this xfield. See also `bbdb-record-field'." (bbdb-editable) (if (memq field '(name-lf mail-aka mail-canon aka-all)) (error "`%s' is not allowed as the name of a field" field)) (let ((record-type (cdr bbdb-record-type))) (cond ((eq field 'firstname) ; First name (if merge (error "Does not merge names")) (if check (bbdb-check-type value (bbdb-record-firstname record-type) t)) (bbdb-check-name value (bbdb-record-lastname record) record) (bbdb-record-set-name record value t)) ;; Last name ((eq field 'lastname) (if merge (error "Does not merge names")) (if check (bbdb-check-type value (bbdb-record-lastname record-type) t)) (bbdb-check-name (bbdb-record-firstname record) value record) (bbdb-record-set-name record t value)) ;; Name ((eq field 'name) (if merge (error "Does not merge names")) (if (stringp value) (setq value (bbdb-divide-name value)) (if check (bbdb-check-type value '(cons string string) t))) (let ((fn (car value)) (ln (cdr value))) (bbdb-check-name fn ln record) (bbdb-record-set-name record fn ln))) ;; Affix ((eq field 'affix) (if merge (setq value (bbdb-merge-lists (bbdb-record-affix record) value 'bbdb-string=))) (if check (bbdb-check-type value (bbdb-record-affix record-type) t)) (setq value (bbdb-list-strings value)) (bbdb-record-set-affix record value)) ;; Organization ((eq field 'organization) (if merge (setq value (bbdb-merge-lists (bbdb-record-organization record) value 'bbdb-string=))) (if check (bbdb-check-type value (bbdb-record-organization record-type) t)) (setq value (bbdb-list-strings value)) (bbdb-hash-update record (bbdb-record-organization record) value) (dolist (organization value) (add-to-list 'bbdb-organization-list organization)) (bbdb-record-set-organization record value)) ;; AKA ((eq field 'aka) (if merge (setq value (bbdb-merge-lists (bbdb-record-aka record) value 'bbdb-string=))) (if check (bbdb-check-type value (bbdb-record-aka record-type) t)) (setq value (bbdb-list-strings value)) (unless bbdb-allow-duplicates (dolist (aka value) (let ((old (remq record (bbdb-gethash aka '(fl-name lf-name aka))))) (if old (error "Alternate name address \"%s\" is used by \"%s\"" aka (mapconcat 'bbdb-record-name old ", ")))))) (bbdb-hash-update record (bbdb-record-aka record) value) (bbdb-record-set-aka record value)) ;; Mail ((eq field 'mail) (if merge (setq value (bbdb-merge-lists (bbdb-record-mail record) value 'bbdb-string=))) (if check (bbdb-check-type value (bbdb-record-mail record-type) t)) (setq value (bbdb-list-strings value)) (unless bbdb-allow-duplicates (dolist (mail value) (let ((old (remq record (bbdb-gethash mail '(mail))))) (if old (error "Mail address \"%s\" is used by \"%s\"" mail (mapconcat 'bbdb-record-name old ", ")))))) (dolist (aka (bbdb-record-mail-aka record)) (bbdb-remhash aka record)) (dolist (mail (bbdb-record-mail-canon record)) (bbdb-remhash mail record)) (bbdb-record-set-mail record value) (bbdb-puthash-mail record)) ;; Phone ((eq field 'phone) (if merge (setq value (bbdb-merge-lists (bbdb-record-phone record) value 'equal))) (if check (bbdb-check-type value (bbdb-record-phone record-type) t)) (dolist (phone value) (add-to-list 'bbdb-phone-label-list (bbdb-phone-label phone) nil 'eq)) (bbdb-record-set-phone record value)) ;; Address ((eq field 'address) (if merge (setq value (bbdb-merge-lists (bbdb-record-address record) value 'equal))) (if check (bbdb-check-type value (bbdb-record-address record-type) t)) (dolist (address value) (add-to-list 'bbdb-address-label-list (bbdb-address-label address) nil 'eq) (mapc (lambda (street) (bbdb-add-to-list 'bbdb-street-list street)) (bbdb-address-streets address)) (bbdb-add-to-list 'bbdb-city-list (bbdb-address-city address)) (bbdb-add-to-list 'bbdb-state-list (bbdb-address-state address)) (bbdb-add-to-list 'bbdb-postcode-list (bbdb-address-postcode address)) (bbdb-add-to-list 'bbdb-country-list (bbdb-address-country address))) (bbdb-record-set-address record value)) ;; all xfields ((eq field 'xfields) (let (xfield new-xfields) (if merge (dolist (ov (bbdb-record-xfields record)) (if (setq xfield (assq (car ov) value)) (setcdr xfield (bbdb-merge-xfield (car ov) (cdr xfield) (cdr ov))) (setq value (append value (list ov)))))) (if check (bbdb-check-type new-xfields (bbdb-record-xfields record-type) t)) (dolist (xfield (nreverse value)) ;; Ignore junk (when (and (cdr xfield) (not (string= "" (cdr xfield)))) (push xfield new-xfields) (add-to-list 'bbdb-xfield-label-list (car xfield) nil 'eq))) (bbdb-record-set-xfields record new-xfields))) ;; Single xfield ((symbolp field) (if merge (setq value (bbdb-merge-xfield field (bbdb-record-xfield record field) value))) (if check (bbdb-check-type value 'string t)) ;; This removes xfield FIELD if its value is nil. (bbdb-record-set-xfield record field value)) (t (error "Unknown field type `%s'" field))))) ;; Currently unused (but possible entry for `bbdb-merge-xfield-function-alist') (defun bbdb-merge-concat (string1 string2 &optional separator) "Return the concatenation of STRING1 and STRING2. SEPARATOR defaults to \"\\n\"." (concat string1 (or separator "\n") string2)) ;; Currently unused (but possible entry for `bbdb-merge-xfield-function-alist') (defun bbdb-merge-concat-remove-duplicates (string1 string2) "Concatenate STRING1 and STRING2, but remove duplicate lines." (let ((lines (split-string string1 "\n"))) (dolist (line (split-string string2 "\n")) (add-to-list 'lines line)) (bbdb-concat "\n" lines))) (defun bbdb-merge-string-least (string1 string2) "Return the string out of STRING1 and STRING2 that is `string-lessp'." (if (string-lessp string1 string2) string1 string2)) (defun bbdb-merge-string-most (string1 string2) "Return the string out of STRING1 and STRING2 that is not `string-lessp'." (if (string-lessp string1 string2) string2 string1)) (defun bbdb-merge-lists (l1 l2 cmp) "Merge two lists L1 and L2 based on comparison CMP. An element from L2 is added to L1 if CMP returns nil for all elements of L1. If L1 or L2 are not lists, they are replaced by (list L1) and (list L2)." (let (merge) (unless (listp l1) (setq l1 (list l1))) (dolist (e2 (if (listp l2) l2 (list l2))) (let ((ll1 l1) e1 fail) (while (setq e1 (pop ll1)) (if (funcall cmp e1 e2) (setq ll1 nil fail t))) (unless fail (push e2 merge)))) (append l1 (nreverse merge)))) (defun bbdb-merge-xfield (label value1 value2) "For LABEL merge VALUE1 with VALUE2. If LABEL has an entry in `bbdb-merge-xfield-function-alist', use it. If VALUE1 or VALUE2 is a substring of the other, return the longer one. Otherwise use `bbdb-concat'. Return nil if we have nothing to merge." (setq value1 (bbdb-string-trim value1)) ; converts nil to "" (setq value2 (bbdb-string-trim value2)) ; converts nil to "" (let ((b1 (not (string= "" value1))) (b2 (not (string= "" value2)))) (cond ((and b1 b2) (let ((fun (cdr (assq label bbdb-merge-xfield-function-alist)))) (cond (fun (funcall fun value1 value2)) ((string-match (regexp-quote value1) value2) value2) ((string-match (regexp-quote value2) value1) value1) (t (bbdb-concat label value1 value2))))) (b1 value1) (b2 value2)))) ;;; Parsing other things (defun bbdb-divide-name (string) "Divide STRING into a first name and a last name. Case is ignored. Return name as (FIRST . LAST). LAST is always a string (possibly empty). FIRST may be nil." (let ((case-fold-search t) first suffix) ;; Separate a suffix. (if (string-match bbdb-lastname-suffix-re string) (setq suffix (concat " " (match-string 1 string)) string (substring string 0 (match-beginning 0)))) (cond ((string-match "\\`\\(.+\\),[ \t\n]*\\(.+\\)\\'" string) ;; If STRING contains a comma, this probably means that STRING ;; is of the form "Last, First". (setq first (match-string 2 string) string (match-string 1 string))) ((string-match bbdb-lastname-re string) (setq first (and (not (zerop (match-beginning 0))) (substring string 0 (match-beginning 0))) string (match-string 1 string)))) (cons (and first (bbdb-string-trim first)) (bbdb-string-trim (concat string suffix))))) (defun bbdb-parse-postcode (string) "Check whether STRING is a legal postcode. Do this only if `bbdb-check-postcode' is non-nil." (if (and bbdb-check-postcode (not (memq t (mapcar (lambda (regexp) ;; if it matches, (not (not index-of-match)) returns t (not (not (string-match regexp string)))) bbdb-legal-postcodes)))) (error "not a valid postcode.") string)) (defun bbdb-phone-string (phone) "Massage string PHONE into a standard format." ;; Phone numbers should come in two forms: (if (= 2 (length phone)) ;; (1) ["where" "the number"] (if (stringp (aref phone 1)) (aref phone 1) (error "Not a valid phone number: %s" (aref phone 1))) ;; (2) ["where" 415 555 1212 99] (unless (and (integerp (aref phone 2)) (integerp (aref phone 3))) (error "Not an NANP number: %s %s" (aref phone 2) (aref phone 3))) (concat (if (/= 0 (bbdb-phone-area phone)) (format "(%03d) " (bbdb-phone-area phone)) "") (if (/= 0 (bbdb-phone-exchange phone)) (format "%03d-%04d" (bbdb-phone-exchange phone) (bbdb-phone-suffix phone)) "") (if (and (bbdb-phone-extension phone) (/= 0 (bbdb-phone-extension phone))) (format " x%d" (bbdb-phone-extension phone)) "")))) (defsubst bbdb-record-lessp (record1 record2) (string< (bbdb-record-sortkey record1) (bbdb-record-sortkey record2))) (defmacro bbdb-error-retry (&rest body) "Repeatedly execute BODY ignoring errors till no error occurs." `(catch '--bbdb-error-retry-- (while t (condition-case --c-- (throw '--bbdb-error-retry-- (progn ,@body)) (error (ding) (message "Error: %s" (nth 1 --c--)) (sit-for 2)))))) ;;; Reading and Writing the BBDB (defun bbdb-buffer () "Return buffer that visits the BBDB file `bbdb-file'. Ensure that this buffer is in sync with `bbdb-file'. Revert the buffer if necessary. If `bbdb-file-remote' is non-nil and it is newer than `bbdb-file', copy it to `bbdb-file'." (unless (buffer-live-p bbdb-buffer) (if (and bbdb-file-remote (file-newer-than-file-p bbdb-file-remote bbdb-file)) (copy-file bbdb-file-remote bbdb-file t t)) (with-current-buffer (setq bbdb-buffer (find-file-noselect bbdb-file)) ;; Check whether auto-save file is newer than `bbdb-file' ;; Do this only when reading `bbdb-file'. (let ((auto-save-file (make-auto-save-file-name))) (when (and bbdb-check-auto-save-file (file-newer-than-file-p auto-save-file buffer-file-name)) (recover-file buffer-file-name) ; this queries (bury-buffer) ; `recover-file' selects `bbdb-buffer' (auto-save-mode 1) ; turn auto-save back on ;; Delete auto-save file even if the user rejected to recover it, ;; so we do not keep asking. (condition-case nil (delete-file auto-save-file) (file-error nil)))))) ;; Make sure `bbdb-buffer' is not out of sync with disk. (with-current-buffer bbdb-buffer (cond ((verify-visited-file-modtime bbdb-buffer)) ; arg for Emacs 23 ((bbdb-revert-buffer)) ;; This is the case where `bbdb-file' has changed; the buffer ;; has changed as well; and the user has answered "no" to the ;; "flush your changes and revert" question. The only other ;; alternative is to save the file right now. If they answer ;; no to the following question, they will be asked the ;; preceeding question again and again some large (but finite) ;; number of times. `bbdb-buffer' is called a lot, you see... ((buffer-modified-p) ;; this queries (bbdb-save t t)) (t ; Buffer and file are inconsistent, but we let them stay that way (message "Continuing with inconsistent BBDB buffers"))) ;; `bbdb-revert-buffer' kills all local variables. (unless (assq 'bbdb-records (buffer-local-variables)) ;; We are reading / reverting `bbdb-buffer'. (set (make-local-variable 'revert-buffer-function) 'bbdb-revert-buffer) (setq buffer-file-coding-system bbdb-file-coding-system buffer-read-only bbdb-read-only bbdb-mail-aliases-need-rebuilt 'parse bbdb-changed-records nil) ;; `bbdb-before-save-hook' and `bbdb-after-save-hook' are user variables. ;; To avoid confusion, we hide the hook functions `bbdb-before-save' ;; and `bbdb-after-save' from the user as these are essential for BBDB. (dolist (hook (cons 'bbdb-before-save bbdb-before-save-hook)) (add-hook 'before-save-hook hook nil t)) (dolist (hook (cons 'bbdb-after-save bbdb-after-save-hook)) (add-hook 'after-save-hook hook nil t)) (fillarray bbdb-hashtable 0) (if (/= (point-min) (point-max)) (bbdb-parse-records) ; normal case: nonempty db ;; Empty db: the following does not require `insert-before-markers' ;; because there are no db-markers in this buffer. (insert (format (concat ";; -*- mode: Emacs-Lisp; coding: %s; -*-" "\n;;; file-format: %d\n") bbdb-file-coding-system bbdb-file-format)) ;; We pretend that `bbdb-buffer' is still unmodified, ;; so that we will (auto-)save it only if we also add records to it. (set-buffer-modified-p nil) (setq bbdb-end-marker (point-marker) ;; Setting `bbdb-records' makes it buffer-local, ;; so that we can use it as a test whether we have ;; initialized BBDB. bbdb-records nil)) (run-hooks 'bbdb-after-read-db-hook))) ;; return `bbdb-buffer' bbdb-buffer) (defmacro bbdb-with-db-buffer (&rest body) "Execute the forms in BODY with `bbdb-buffer' temporarily current. If `bbdb-debug' was non-nil at compile-time, and `bbdb-buffer' is visible in a window, temporarilly switch to that window. So when we come out, that window has been scrolled to the record we have just modified." (declare (indent 0)) (if bbdb-debug `(let* ((buffer (bbdb-buffer)) (window (get-buffer-window buffer))) (if window (with-selected-window window ,@body) (with-current-buffer buffer ,@body))) `(with-current-buffer (bbdb-buffer) ,@body))) (defun bbdb-editable () "Ensure that BBDB is editable, otherwise throw an error. If BBDB is out of sync try to revert. BBDB is not editable if it is read-only." (if bbdb-read-only (error "BBDB is read-only")) (let ((buffer (bbdb-buffer))) ; this reverts if necessary / possible ;; Is the following possible? Superfluous tests do not hurt. ;; It is relevant only for editing commands in a BBDB buffer, ;; but not for MUA-related editing functions. (if (and (eq major-mode 'bbdb-mode) bbdb-records (not (memq (caar bbdb-records) (with-current-buffer buffer bbdb-records)))) (error "BBDB is out of sync"))) t) ;;;###autoload (defsubst bbdb-records () "Return a list of all BBDB records; read in and parse the db if necessary. This function also notices if the corresponding file on disk has been modified." (with-current-buffer (bbdb-buffer) bbdb-records)) (defun bbdb-revert-buffer (&optional ignore-auto noconfirm) "The `revert-buffer-function' for `bbdb-buffer' visiting `bbdb-file'. IGNORE-AUTO and NOCONFIRM have same meaning as in `revert-buffer'. See also variable `bbdb-auto-revert'. Return t if the reversion was successful (or not needed). Return nil otherwise." (interactive (list (not current-prefix-arg))) ; as in `revert-buffer' (unless (buffer-live-p bbdb-buffer) (error "No live BBDB buffer to revert")) (with-current-buffer bbdb-buffer (cond ((not buffer-file-number) ;; We have not yet created `bbdb-file' (when (or noconfirm (yes-or-no-p "Flush your changes? ")) (erase-buffer) (kill-all-local-variables) ; clear database (bbdb-buffer) ; re-initialize (set-buffer-modified-p nil) (bbdb-undisplay-records t))) ;; If nothing has changed do nothing, return t. ((and (verify-visited-file-modtime bbdb-buffer) ; arg for Emacs 23 (not (buffer-modified-p)))) ((or (and (not (verify-visited-file-modtime bbdb-buffer)) ;; File changed on disk (or noconfirm (and bbdb-auto-revert (not (buffer-modified-p))) (yes-or-no-p (if (buffer-modified-p) "BBDB changed on disk; flush your changes and revert? " "BBDB changed on disk; revert? ")))) (and (verify-visited-file-modtime bbdb-buffer) ;; File not changed on disk, but buffer modified (buffer-modified-p) (or noconfirm (yes-or-no-p "Flush your changes and revert BBDB? ")))) (unless (file-exists-p bbdb-file) (error "BBDB: file %s no longer exists" bbdb-file)) (kill-all-local-variables) ; clear database ;; `revert-buffer-function' has the permanent-local property ;; So to avoid looping, we need to bind it to nil explicitly. (let (revert-buffer-function) (revert-buffer ignore-auto t)) (bbdb-buffer) ; re-initialize (bbdb-undisplay-records t) t)))) ; return nil if the user rejected to revert (defun bbdb-goto-first-record () "Go to where first record begins, Move to end of file if no records." (goto-char (point-min)) (if (search-forward "\n[" nil 'move) (forward-char -1))) (defun bbdb-parse-records () "Parse BBDB records and initialize various internal variables. If `bbdb-file' uses an outdated format, it is migrated to `bbdb-file-format'." (unless bbdb-silent (message "Parsing BBDB...")) (save-excursion (save-restriction (widen) (bbdb-goto-first-record) ;; look backwards for file-format, and convert if necessary. (let ((file-format (save-excursion (if (re-search-backward "^;+[ \t]*file-\\(format\\|version\\):[ \t]*\\([0-9]+\\)[ \t]*$" nil t) (string-to-number (match-string 2))))) migrate records) (unless file-format ; current file-format, but no file-format: line. (error "BBDB corrupted: no file-format line")) (if (> file-format bbdb-file-format) (error "BBDB version %s understands file format %s but not %s." bbdb-version bbdb-file-format file-format) (setq migrate (< file-format bbdb-file-format))) (or (eobp) (looking-at "\\[") (error "BBDB corrupted: no following bracket")) ;; narrow the buffer to skip over the rubbish before the first record. (narrow-to-region (point) (point-max)) (let ((modp (buffer-modified-p)) ;; Make sure those parens get cleaned up. ;; This code had better stay simple! (inhibit-quit t) (buffer-undo-list t) buffer-read-only) (goto-char (point-min)) (insert "(\n") (goto-char (point-max)) (insert "\n)") (goto-char (point-min)) (unwind-protect (setq records (read (current-buffer))) (goto-char (point-min)) (delete-char 2) (goto-char (point-max)) (delete-char -2) (set-buffer-modified-p modp))) (widen) ;; Migrate if `bbdb-file' is outdated. (if migrate (setq records (bbdb-migrate records file-format))) ;; We could first set `bbdb-phone-label-list' and ;; `bbdb-address-label-list' to their customized values. Bother? (setq bbdb-records records bbdb-xfield-label-list nil bbdb-organization-list nil bbdb-street-list nil bbdb-city-list nil bbdb-state-list nil bbdb-postcode-list nil bbdb-country-list nil) (bbdb-goto-first-record) (dolist (record records) ;; We assume that the markers for each record need to go at each ;; newline. If this is not the case, things can go *very* wrong. (bbdb-debug (unless (looking-at "\\[") (error "BBDB corrupted: junk between records at %s" (point)))) (bbdb-cache-set-marker (bbdb-record-set-cache record (make-vector bbdb-cache-length nil)) (point-marker)) (forward-line 1) ;; Set the completion lists (dolist (phone (bbdb-record-phone record)) (add-to-list 'bbdb-phone-label-list (bbdb-phone-label phone) nil 'eq)) (dolist (address (bbdb-record-address record)) (add-to-list 'bbdb-address-label-list (bbdb-address-label address) nil 'eq) (mapc (lambda (street) (bbdb-add-to-list 'bbdb-street-list street)) (bbdb-address-streets address)) (bbdb-add-to-list 'bbdb-city-list (bbdb-address-city address)) (bbdb-add-to-list 'bbdb-state-list (bbdb-address-state address)) (bbdb-add-to-list 'bbdb-postcode-list (bbdb-address-postcode address)) (bbdb-add-to-list 'bbdb-country-list (bbdb-address-country address))) (dolist (xfield (bbdb-record-xfields record)) (add-to-list 'bbdb-xfield-label-list (car xfield) nil 'eq)) (dolist (organization (bbdb-record-organization record)) (add-to-list 'bbdb-organization-list organization)) (let ((name (bbdb-concat 'name-first-last (bbdb-record-firstname record) (bbdb-record-lastname record)))) (when (and (not bbdb-allow-duplicates) (bbdb-gethash name '(fl-name aka))) ;; This does not check for duplicate mail fields. ;; Yet under normal circumstances, this should really ;; not be necessary each time BBDB is loaded as BBDB checks ;; whether creating a new record or modifying an existing one ;; results in duplicates. ;; Alternatively, you can use `bbdb-search-duplicates'. (message "Duplicate BBDB record encountered: %s" name) (sit-for 1))) ;; We hash every record even if it is a duplicate and ;; `bbdb-allow-duplicates' is nil. Otherwise, an unhashed ;; record would not be available for things like completion ;; (and we would not know which record to keeep and which one ;; to hide). We trust the user she knows what she wants ;; if she keeps duplicate records in the database though ;; `bbdb-allow-duplicates' is nil. (bbdb-hash-record record)) ;; Note that `bbdb-xfield-label-list' serves two purposes: ;; - check whether an xfield is new to BBDB ;; - list of known xfields for minibuffer completion ;; Only in the latter case, we might want to exclude ;; those xfields that are handled automatically. ;; So the following is not a satisfactory solution. ;; (dolist (label (bbdb-layout-get-option 'multi-line 'omit)) ;; (setq bbdb-xfield-label-list (delq label bbdb-xfield-label-list))) ;; `bbdb-end-marker' allows to put comments at the end of `bbdb-file' ;; that are ignored. (setq bbdb-end-marker (point-marker)) (when migrate (dolist (record bbdb-records) (bbdb-overwrite-record-internal record)) ;; update file format (goto-char (point-min)) (if (re-search-forward (format "^;;; file-\\(version\\|format\\): %d$" file-format) nil t) (replace-match (format ";;; file-format: %d" bbdb-file-format))))))) (unless bbdb-silent (message "Parsing BBDB...done"))) (defun bbdb-before-save () "Run before saving `bbdb-file' as buffer-local part of `before-save-hook'." (when (and bbdb-file-remote (or bbdb-file-remote-save-always (y-or-n-p (format "Save the remote BBDB file %s too? " bbdb-file-remote)))) ;; Write the current buffer `bbdb-file' into `bbdb-file-remote'. (let ((coding-system-for-write bbdb-file-coding-system)) (write-region (point-min) (point-max) bbdb-file-remote)))) (defun bbdb-after-save () "Run after saving `bbdb-file' as buffer-local part of `after-save-hook'." (setq bbdb-changed-records nil) (dolist (buffer (buffer-list)) (with-current-buffer buffer (if (eq major-mode 'bbdb-mode) (set-buffer-modified-p nil))))) (defun bbdb-change-record (record &optional need-to-sort new) "Update the database after a change of RECORD. Return RECORD. NEED-TO-SORT is t when the name has changed. If NEW is t treat RECORD as new. New records are hashed. If RECORD is not new, it is redisplayed. Yet it is then the caller's responsibility to update the hash-table for RECORD." (if bbdb-read-only (error "The Insidious Big Brother Database is read-only.")) ;; Do the changing. ;; The call of `bbdb-records' checks file synchronization. ;; If RECORD refers to an existing record that has been changed, ;; yet in the meanwhile we reverted the BBDB file, then RECORD ;; no longer refers to a record in `bbdb-records'. So we are stuck! ;; All changes will be lost. ;; To avoid this problem we would have to inhibit that `bbdb-file' ;; may change on disc. (cond ((memq record (bbdb-records)) (unless bbdb-notice-hook-pending (run-hook-with-args 'bbdb-change-hook record)) (if (not need-to-sort) ;; If we do not need to sort, overwrite RECORD. (bbdb-overwrite-record-internal record) ;; Since we need to sort, delete then insert RECORD. ;; Do not mess with the hash table here. ;; We assume it got updated by the caller. (bbdb-delete-record-internal record) (bbdb-insert-record-internal record)) ;; If RECORD is currently displayed update display. (bbdb-maybe-update-display record)) (new ;; Record is new and not yet in database, so add it. (run-hook-with-args 'bbdb-create-hook record) (unless bbdb-notice-hook-pending (run-hook-with-args 'bbdb-change-hook record)) (bbdb-insert-record-internal record) (bbdb-hash-record record)) (t (error "Changes are lost."))) (add-to-list 'bbdb-changed-records record nil 'eq) (run-hook-with-args 'bbdb-after-change-hook record) record) (defun bbdb-delete-record-internal (record &optional completely) "Delete RECORD in the database file. With COMPLETELY non-nil, also undisplay RECORD and remove it from the hash table." (unless (bbdb-record-marker record) (error "BBDB: marker absent")) (if completely (bbdb-maybe-update-display record t)) (bbdb-with-db-buffer (let ((tail (memq record bbdb-records)) (inhibit-quit t)) (unless tail (error "BBDB record absent: %s" record)) (delete-region (bbdb-record-marker record) (if (cdr tail) (bbdb-record-marker (car (cdr tail))) bbdb-end-marker)) (setq bbdb-records (delq record bbdb-records)) (when completely (bbdb-remhash (bbdb-record-name record) record) (bbdb-remhash (bbdb-record-name-lf record) record) (dolist (organization (bbdb-record-organization record)) (bbdb-remhash organization record)) (dolist (mail (bbdb-record-mail-canon record)) (bbdb-remhash mail record)) (dolist (aka (bbdb-record-field record 'aka-all)) (bbdb-remhash aka record)))) (bbdb-record-set-sortkey record nil))) ;; inspired by `gnus-bind-print-variables' (defmacro bbdb-with-print-loadably (&rest body) "Bind print-* variables for BBDB and evaluate BODY. This macro is used with `prin1', `prin1-to-string', etc. in order to ensure printed Lisp objects are loadable by BBDB." (declare (indent 0)) `(let ((print-escape-newlines t) ;; BBDB needs this! print-escape-nonascii print-escape-multibyte print-quoted print-length print-level) ;; print-circle print-gensym ;; print-continuous-numbering ;; print-number-table ;; float-output-format ,@body)) (defun bbdb-insert-record-internal (record) "Insert RECORD into the database file. Return RECORD. Do not call this function directly, call instead `bbdb-change-record' that calls the hooks, too." (unless (bbdb-record-marker record) (bbdb-record-set-marker record (make-marker))) (bbdb-with-db-buffer ;; Set the sortkey to nil so that it will automatically be recalculated ;; up-to-date for sorting (bbdb-record-set-sortkey record nil) ;; splice record into `bbdb-records' (bbdb-debug (if (memq record bbdb-records) (error "BBDB record not unique: - %s" record))) (if (or (not bbdb-records) ; first record in new database (bbdb-record-lessp record (car bbdb-records))) (push record bbdb-records) (let ((records bbdb-records)) (while (and (cdr records) (bbdb-record-lessp (nth 1 records) record)) (setq records (cdr records))) (setcdr records (cons record (cdr records))))) (let ((next (car (cdr (memq record bbdb-records))))) (goto-char (if next (bbdb-record-marker next) bbdb-end-marker))) ;; Before writing the record, remove the cache (we do not want that ;; written to the file.) After writing, put the cache back and update ;; the cache's marker. (let ((cache (bbdb-record-cache record)) (point (point)) (inhibit-quit t)) (bbdb-debug (if (= point (point-min)) (error "Inserting at point-min (%s)" point)) (if (and (/= point bbdb-end-marker) (not (looking-at "^\\["))) (error "Not inserting before a record (%s)" point))) (bbdb-record-set-cache record nil) (insert-before-markers (bbdb-with-print-loadably (prin1-to-string record)) "\n") (set-marker (bbdb-cache-marker cache) point) (bbdb-record-set-cache record cache)) record)) (defun bbdb-overwrite-record-internal (record) "Overwrite RECORD in the database file. Return RECORD. Do not call this function directly, call instead `bbdb-change-record' that calls the hooks, too." (bbdb-with-db-buffer (let* ((tail (memq record bbdb-records)) (_ (unless tail (error "BBDB record absent: %s" record))) (cache (bbdb-record-cache record)) (inhibit-quit t)) (bbdb-debug (if (<= (bbdb-cache-marker cache) (point-min)) (error "Cache marker is %s" (bbdb-cache-marker cache)))) (goto-char (bbdb-cache-marker cache)) (bbdb-debug (if (and (/= (point) bbdb-end-marker) (not (looking-at "\\["))) (error "Not inserting before a record (%s)" (point)))) (bbdb-record-set-cache record nil) (insert (bbdb-with-print-loadably (prin1-to-string record)) "\n") (delete-region (point) (if (cdr tail) (bbdb-record-marker (car (cdr tail))) bbdb-end-marker)) (bbdb-record-set-cache record cache) (bbdb-debug (if (<= (if (cdr tail) (bbdb-record-marker (car (cdr tail))) bbdb-end-marker) (bbdb-record-marker record)) (error "Overwrite failed"))) record))) ;; Record formatting: ;; This does not insert anything into the *BBDB* buffer, ;; which is handled in a second step by the display functions. (defun bbdb-layout-get-option (layout option) "For LAYOUT return value of OPTION according to `bbdb-layout-alist'." (let ((layout-spec (if (listp layout) layout (assq layout bbdb-layout-alist))) option-value) (and layout-spec (setq option-value (assq option layout-spec)) (cdr option-value)))) (defun bbdb-address-continental-p (address) "Return non-nil if ADDRESS is a continental address. This is done by comparing the postcode to `bbdb-continental-postcode-regexp'. This is a possible identifying function for `bbdb-address-format-list' and `bbdb-print-address-format-list'." (string-match bbdb-continental-postcode-regexp (bbdb-address-postcode address))) ;; This function can provide some guidance for writing ;; your own address formatting function (defun bbdb-format-address-default (address) "Return formatted ADDRESS as a string. This is the default format; it is used in the US, for example. The result looks like this: label: street street ... city, state postcode country. This function is a possible formatting function for `bbdb-address-format-list'." (let ((country (bbdb-address-country address)) (streets (bbdb-address-streets address))) (concat (if streets (concat (mapconcat 'identity streets "\n") "\n")) (bbdb-concat ", " (bbdb-address-city address) (bbdb-concat " " (bbdb-address-state address) (bbdb-address-postcode address))) (unless (or (not country) (string= "" country)) (concat "\n" country))))) (defun bbdb-format-address (address layout) "Format ADDRESS using LAYOUT. Return result as a string. The formatting rules are defined in `bbdb-address-format-list'." (let ((list bbdb-address-format-list) (country (bbdb-address-country address)) elt string) (while (and (not string) (setq elt (pop list))) (let ((identifier (car elt)) (format (nth layout elt)) ;; recognize case for format identifiers case-fold-search str) (when (or (eq t identifier) ; default (and (functionp identifier) (funcall identifier address)) (and country (listp identifier) ;; ignore case for countries (member-ignore-case country identifier))) (cond ((functionp format) (setq string (funcall format address))) ((stringp format) (setq string "") (dolist (form (split-string (substring format 1 -1) (substring format 0 1) t)) (cond ((string-match "%s" form) ; street (mapc (lambda (s) (setq string (concat string (format form s)))) (bbdb-address-streets address))) ((string-match "%c" form) ; city (unless (or (not (setq str (bbdb-address-city address))) (string= "" str)) (setq string (concat string (format (replace-regexp-in-string "%c" "%s" form) str))))) ((string-match "%p" form) ; postcode (unless (or (not (setq str (bbdb-address-postcode address))) (string= "" str)) (setq string (concat string (format (replace-regexp-in-string "%p" "%s" form) str))))) ((string-match "%S" form) ; state (unless (or (not (setq str (bbdb-address-state address))) (string= "" str)) (setq string (concat string (format (replace-regexp-in-string "%S" "%s" form t) str))))) ((string-match "%C" form) ; country (unless (or (not country) (string= "" country)) (setq string (concat string (format (replace-regexp-in-string "%C" "%s" form t) country))))) (t (error "Malformed address format element %s" form))))) (t (error "Malformed address format %s" format)))))) (unless string (error "No match of `bbdb-address-format-list'")) string)) ;;; Record display: ;;; This inserts formatted (pieces of) records into the BBDB buffer. (defsubst bbdb-field-property (start field) "Set text property bbdb-field of text between START and point to FIELD." (put-text-property start (point) 'bbdb-field field)) (defsubst bbdb-display-text (text field &optional face) "Insert TEXT at point. Set its text property bbdb-field to FIELD. If FACE is non-nil, also add face FACE." (let ((start (point))) (insert text) (bbdb-field-property start field) (if face (put-text-property start (point) 'face face)))) (defun bbdb-display-list (list field &optional terminator face indent) "Insert elements of LIST at point. For inserted text, set text property bbdb-field to FIELD. If TERMINATOR is non-nil use it to terminate the inserted text. If FACE is non-nil use it as FACE for inserted text. If INDENT and `bbdb-wrap-column' are integers, insert line breaks in between elements of LIST if otherwise inserted text exceeds `bbdb-wrap-column'." ;; `truncate-lines' is fine for one-line layout. But it is annyoing ;; for records that are displayed with multi-line layout. ;; Non-nil `word-wrap' would be much nicer. How can we switch between ;; non-nil `truncate-lines' and non-nil `word-wrap' on a per-record basis? ;; The following code is an alternative solution using `bbdb-wrap-column'. (let* ((separator (nth 1 (or (cdr (assq field bbdb-separator-alist)) bbdb-default-separator))) (indent-flag (and (integerp bbdb-wrap-column) (integerp indent))) (prefix (if indent-flag (concat separator "\n" (make-string indent ?\s)))) elt) (while (setq elt (pop list)) (bbdb-display-text elt (list field elt) face) (cond ((and list indent-flag (> (+ (current-column) (length (car list))) bbdb-wrap-column)) (bbdb-display-text prefix (list field) face)) (list (bbdb-display-text separator (list field) face)) (terminator (bbdb-display-text terminator (list field) face)))))) (defun bbdb-display-name-organization (record) "Insert name, affix, and organization of RECORD. If RECORD has an xfield name-face, its value is used for font-locking name. The value of name-face may be a face that is used directly. The value may also be a key in `bbdb-name-face-alist'. Then the corresponding cdr is used. If none of these schemes succeeds the face `bbdb-face' is used." ;; Should this be further customizable? We could build the following ;; from a customizable list containing function calls and strings. ;; Name (let ((name (if (eq 'last-first (or (bbdb-record-xfield-intern record 'name-format) bbdb-name-format)) (bbdb-record-name-lf record) ;; default: Firstname Lastname (bbdb-record-name record))) (name-face (bbdb-record-xfield record 'name-face))) (if (string= "" name) (setq name "???")) (bbdb-display-text name (list 'name name) (if name-face (cond ((facep name-face) name-face) ((cdr (assoc name-face bbdb-name-face-alist))) (t 'bbdb-name)) 'bbdb-name))) ;; Affix (let ((affix (bbdb-record-affix record))) (when affix (insert ", ") (bbdb-display-list affix 'affix))) ;; Organization (let ((organization (bbdb-record-organization record))) (when organization (insert " - ") (bbdb-display-list organization 'organization nil 'bbdb-organization))) ;; Image (if (and bbdb-image (display-images-p)) (let ((image (cond ((functionp bbdb-image) (funcall bbdb-image record)) ((memq bbdb-image '(name fl-name)) (bbdb-record-name record)) ((eq bbdb-image 'lf-name) (bbdb-record-name-lf record)) (t (bbdb-record-xfield record bbdb-image))))) (when (and image (setq image (locate-file image bbdb-image-path bbdb-image-suffixes)) (setq image (create-image image))) (insert " ") (insert-image image))))) (defun bbdb-display-record-one-line (record layout field-list) "Format RECORD for the one-line FORMAT using LAYOUT. See `bbdb-layout-alist' for more info on layouts. FIELD-LIST is the list of actually displayed FIELDS." ;; Name, affix, and organizations (bbdb-display-name-organization record) (let ((name-end (or (bbdb-layout-get-option layout 'name-end) 40)) (start (line-beginning-position))) (when (> (- (point) start -1) name-end) (put-text-property (+ start name-end -4) (point) 'invisible t) (insert "...")) (indent-to name-end)) ;; rest of the fields (let (formatfun start) (dolist (field field-list) (cond (;; customized formatting (setq formatfun (intern-soft (format "bbdb-display-%s-one-line" field))) (funcall formatfun record)) ;; phone ((eq field 'phone) (let ((phones (bbdb-record-phone record)) phone) (if phones (while (setq phone (pop phones)) (bbdb-display-text (format "%s " (aref phone 0)) `(phone ,phone field-label) 'bbdb-field-name) (bbdb-display-text (format "%s%s" (aref phone 1) (if phones " " "; ")) `(phone ,phone)))))) ;; address ((eq field 'address) (dolist (address (bbdb-record-address record)) (setq start (point)) (insert (bbdb-format-address address 3)) (bbdb-field-property start `(address ,address)) (insert "; "))) ;; mail ((eq field 'mail) (let ((mail (bbdb-record-mail record))) (if mail (bbdb-display-list (if (bbdb-layout-get-option layout 'primary) (list (car mail)) mail) 'mail "; ")))) ;; AKA ((eq field 'aka) (let ((aka (bbdb-record-aka record))) (if aka (bbdb-display-list aka 'aka "; ")))) ;; xfields (t (let ((xfield (assq field (bbdb-record-xfields record)))) (if xfield (bbdb-display-text (concat (replace-regexp-in-string "\n" "; " (cdr xfield)) "; ") `(xfields ,xfield))))))) ;; delete the trailing "; " (if (looking-back "; ") (backward-delete-char 2)) (insert "\n"))) (defun bbdb-display-record-multi-line (record layout field-list) "Format RECORD for the multi-line FORMAT using LAYOUT. See `bbdb-layout-alist' for more info on layouts. FIELD-LIST is the list of actually displayed FIELDS." (bbdb-display-name-organization record) (insert "\n") (let* ((indent (or (bbdb-layout-get-option layout 'indentation) 21)) ;; The format string FMT adds three extra characters. ;; So we subtract those from the value of INDENT. (fmt (format " %%%ds: " (- indent 3))) start field formatfun) (dolist (field field-list) (setq start (point)) (cond (;; customized formatting (setq formatfun (intern-soft (format "bbdb-display-%s-multi-line" field))) (funcall formatfun record)) ;; phone ((eq field 'phone) (dolist (phone (bbdb-record-phone record)) (bbdb-display-text (format fmt (concat "phone (" (bbdb-phone-label phone) ")")) `(phone ,phone field-label) 'bbdb-field-name) (bbdb-display-text (concat (bbdb-phone-string phone) "\n") `(phone ,phone)))) ;; address ((eq field 'address) (dolist (address (bbdb-record-address record)) (bbdb-display-text (format fmt (concat "address (" (bbdb-address-label address) ")")) `(address ,address field-label) 'bbdb-field-name) (setq start (point)) (insert (bbdb-indent-string (bbdb-format-address address 2) indent) "\n") (bbdb-field-property start `(address ,address)))) ;; mail ((eq field 'mail) (let ((mail (bbdb-record-mail record))) (when mail (bbdb-display-text (format fmt "mail") '(mail nil field-label) 'bbdb-field-name) (bbdb-display-list (if (bbdb-layout-get-option layout 'primary) (list (car mail)) mail) 'mail "\n" nil indent)))) ;; AKA ((eq field 'aka) (let ((aka (bbdb-record-aka record))) (when aka (bbdb-display-text (format fmt "AKA") '(aka nil field-label) 'bbdb-field-name) (bbdb-display-list aka 'aka "\n")))) ;; xfields (t (let ((xfield (assq field (bbdb-record-xfields record)))) (when xfield (bbdb-display-text (format fmt field) `(xfields ,xfield field-label) 'bbdb-field-name) (setq start (point)) (insert (bbdb-indent-string (cdr xfield) indent) "\n") (bbdb-field-property start `(xfields ,xfield))))))) (insert "\n"))) (defalias 'bbdb-display-record-full-multi-line 'bbdb-display-record-multi-line) (defalias 'bbdb-display-record-pop-up-multi-line 'bbdb-display-record-multi-line) (defun bbdb-display-record (record layout number) "Insert a formatted RECORD into the current buffer at point. LAYOUT can be a symbol describing a layout in `bbdb-layout-alist'. If it is nil, use `bbdb-layout'. NUMBER is the number of RECORD among the displayed records. Move point to the end of the inserted record." (unless layout (setq layout bbdb-layout)) (unless (assq layout bbdb-layout-alist) (error "Unknown layout `%s'" layout)) (let ((display-p (bbdb-layout-get-option layout 'display-p)) (omit-list (bbdb-layout-get-option layout 'omit)) ; omitted fields (order-list (bbdb-layout-get-option layout 'order)); requested field order (all-fields (append '(phone address mail aka) ; default field order (mapcar 'car (bbdb-record-xfields record)))) (beg (point)) format-function field-list) (when (or (not display-p) (and display-p (funcall display-p))) (if (functionp omit-list) (setq omit-list (funcall omit-list record layout))) (if (functionp order-list) (setq order-list (funcall order-list record layout))) ;; first omit unwanted fields (when (and omit-list (or (not order-list) (memq t order-list))) (if (listp omit-list) ;; show all fields except those listed here (dolist (omit omit-list) (setq all-fields (delq omit all-fields))) (setq all-fields nil))) ; show nothing ;; then order them (cond ((not order-list) (setq field-list all-fields)) ((not (memq t order-list)) (setq field-list order-list)) (t (setq order-list (reverse order-list) all-fields (delq nil (mapcar (lambda (f) (unless (memq f order-list) f)) all-fields))) (dolist (order order-list) (if (eq t order) (setq field-list (append all-fields field-list)) (push order field-list))))) ;; call the actual format function (setq format-function (intern-soft (format "bbdb-display-record-%s" layout))) (if (functionp format-function) (funcall format-function record layout field-list) (bbdb-display-record-multi-line record layout field-list)) (put-text-property beg (point) 'bbdb-record-number number)))) (defun bbdb-display-records (records &optional layout append select horiz-p) "Display RECORDS using LAYOUT. If APPEND is non-nil append RECORDS to the already displayed records. Otherwise RECORDS overwrite the displayed records. SELECT and HORIZ-P have the same meaning as in `bbdb-pop-up-window'." (interactive (list (bbdb-completing-read-records "Display records: ") (bbdb-layout-prefix))) (if (bbdb-append-display-p) (setq append t)) ;; `bbdb-redisplay-records' calls `bbdb-display-records' ;; with display information already amended to RECORDS. (unless (or (null records) (consp (car records))) ;; add layout and a marker to the local list of records (setq layout (or layout bbdb-layout) records (mapcar (lambda (record) (list record layout (make-marker))) records))) (let ((first-new (caar records)) ; first new record new-name) ;; If `bbdb-multiple-buffers' is non-nil we create a new BBDB buffer ;; when not already within one. The new buffer name starts with a space, ;; i.e. it does not clutter the buffer list. (when (and bbdb-multiple-buffers (not (assq 'bbdb-buffer-name (buffer-local-variables)))) (setq new-name (concat " *BBDB " (if (functionp bbdb-multiple-buffers) (funcall bbdb-multiple-buffers) (buffer-name)) "*")) ;; `bbdb-buffer-name' becomes buffer-local in the current buffer ;; as well as in the buffer `bbdb-buffer-name' (set (make-local-variable 'bbdb-buffer-name) new-name)) (with-current-buffer (get-buffer-create bbdb-buffer-name) ; *BBDB* ;; If we are appending RECORDS to the ones already displayed, ;; then first remove any duplicates, and then sort them. (if append (let ((old-rec (mapcar 'car bbdb-records))) (dolist (record records) (unless (memq (car record) old-rec) (push record bbdb-records))) (setq records (sort bbdb-records (lambda (x y) (bbdb-record-lessp (car x) (car y))))))) (bbdb-mode) ;; Normally `bbdb-records' is the only BBDB-specific buffer-local variable ;; in the *BBDB* buffer. It is intentionally not permanent-local. ;; A value of nil indicates that we need to (re)process the records. (setq bbdb-records records) (if new-name (set (make-local-variable 'bbdb-buffer-name) new-name)) (unless (or bbdb-silent-internal bbdb-silent) (message "Formatting BBDB...")) (let ((record-number 0) buffer-read-only all-records start) (erase-buffer) (bbdb-debug (setq all-records (bbdb-records))) (dolist (record records) (bbdb-debug (unless (memq (car record) all-records) (error "Record %s does not exist" (car record)))) (setq start (set-marker (nth 2 record) (point))) (bbdb-display-record (nth 0 record) (nth 1 record) record-number) (setq record-number (1+ record-number))) (run-hooks 'bbdb-display-hook)) (unless (or bbdb-silent-internal bbdb-silent) (message "Formatting BBDB...done.")) (set-buffer-modified-p nil) (bbdb-pop-up-window select horiz-p) ;; Put point on first new record in *BBDB* buffer. (when first-new (goto-char (nth 2 (assq first-new bbdb-records))) (set-window-start (get-buffer-window (current-buffer)) (point)))))) (defun bbdb-undisplay-records (&optional all-buffers) "Undisplay records in *BBDB* buffer, leaving this buffer empty. If ALL-BUFFERS is non-nil undisplay records in all BBDB buffers." (dolist (buffer (cond (all-buffers (buffer-list)) ((let ((buffer (get-buffer bbdb-buffer-name))) (and (buffer-live-p buffer) (list buffer)))))) (with-current-buffer buffer (when (eq major-mode 'bbdb-mode) (let (buffer-read-only) (erase-buffer)) (setq bbdb-records nil) (set-buffer-modified-p nil))))) (defun bbdb-redisplay-record (record &optional delete-p) "Redisplay RECORD. If DELETE-P is non-nil RECORD is removed from the BBDB buffer. The BBDB buffer must be current when this is called." ;; For deletion in the *BBDB* buffer we use the full information ;; about the record in the database. Therefore, we need to delete ;; the record in the *BBDB* buffer before deleting the record in ;; the database. ;; FIXME: If point is initially inside RECORD, `bbdb-redisplay-record' ;; puts point at the beginning of the redisplayed RECORD. ;; Ideally, `bbdb-redisplay-record' should put the point such that it ;; matches the previous value `bbdb-ident-point'. (let ((full-record (assq record bbdb-records))) (if (null full-record) ; new record (bbdb-display-records (list record) nil t) (let ((marker (nth 2 full-record)) (end-marker (nth 2 (car (cdr (memq full-record bbdb-records))))) buffer-read-only record-number) ;; If point is inside record, put it at the beginning of the record. (if (and (<= marker (point)) (< (point) (or end-marker (point-max)))) (goto-char marker)) (save-excursion (goto-char marker) (setq record-number (get-text-property (point) 'bbdb-record-number)) (unless delete-p ;; First insert the reformatted record, then delete the old one, ;; so that the marker of this record cannot collapse with the ;; marker of the subsequent record (bbdb-display-record (car full-record) (nth 1 full-record) record-number)) (delete-region (point) (or end-marker (point-max))) ;; If we deleted a record we need to update the subsequent ;; record numbers. (if delete-p (let* ((markers (append (mapcar (lambda (x) (nth 2 x)) (cdr (memq full-record bbdb-records))) (list (point-max)))) (start (pop markers))) (dolist (end markers) (put-text-property start end 'bbdb-record-number record-number) (setq start end record-number (1+ record-number))))) (run-hooks 'bbdb-display-hook)))))) (defun bbdb-maybe-update-display (record &optional delete-p) "If RECORD is currently displayed update display. If DELETE-P is nil RECORD is removed from the BBDB buffers." (dolist (buffer (buffer-list)) (with-current-buffer buffer (if (and (eq major-mode 'bbdb-mode) (memq record (bbdb-records))) (let ((window (get-buffer-window bbdb-buffer-name))) (if window (with-selected-window window (bbdb-redisplay-record record delete-p)) (bbdb-redisplay-record record delete-p))))))) ;;; window configuration hackery (defun bbdb-pop-up-window (&optional select horiz-p) "Display *BBDB* buffer by popping up a new window. Finds the largest window on the screen, splits it, displaying the *BBDB* buffer in the bottom `bbdb-pop-up-window-size' lines (unless the *BBDB* buffer is already visible, in which case do nothing.) Select this window if SELECT is non-nil. If `bbdb-mua-pop-up' is 'horiz, and the first window matching the predicate HORIZ-P is wider than the car of `bbdb-horiz-pop-up-window-size' then the window will be split horizontally rather than vertically." (let ((buffer (get-buffer bbdb-buffer-name))) (unless buffer (error "No %s buffer to display" bbdb-buffer-name)) (cond ((let ((window (get-buffer-window buffer t))) ;; We already have a BBDB window so that at most we select it (and window (or (not select) (select-window window))))) ;; try horizontal split ((and (eq bbdb-mua-pop-up 'horiz) horiz-p (>= (frame-width) (car bbdb-horiz-pop-up-window-size)) (let ((window-list (window-list)) (b-width (cdr bbdb-horiz-pop-up-window-size)) (search t) s-window) (while (and (setq s-window (pop window-list)) (setq search (not (funcall horiz-p s-window))))) (unless (or search (<= (window-width s-window) (car bbdb-horiz-pop-up-window-size))) (condition-case nil ; `split-window' might fail (let ((window (split-window s-window (if (integerp b-width) (- (window-width s-window) b-width) (round (* (- 1 b-width) (window-width s-window)))) t))) ; horizontal split (set-window-buffer window buffer) (cond (bbdb-dedicated-window (set-window-dedicated-p window bbdb-dedicated-window)) ((fboundp 'display-buffer-record-window) ; GNU Emacs >= 24.1 (set-window-prev-buffers window nil) (display-buffer-record-window 'window window buffer))) (if select (select-window window)) t) (error nil)))))) ((eq t bbdb-pop-up-window-size) (bbdb-pop-up-window-simple buffer select)) (t ;; vertical split (let* ((window (selected-window)) (window-height (window-height window))) ;; find the tallest window... (mapc (lambda (w) (let ((w-height (window-height w))) (if (> w-height window-height) (setq window w window-height w-height)))) (window-list)) (condition-case nil (progn (unless (eql bbdb-pop-up-window-size 1.0) (setq window (split-window ; might fail window (if (integerp bbdb-pop-up-window-size) (- window-height 1 ; for mode line (max window-min-height bbdb-pop-up-window-size)) (round (* (- 1 bbdb-pop-up-window-size) window-height)))))) (set-window-buffer window buffer) ; might fail (cond (bbdb-dedicated-window (set-window-dedicated-p window bbdb-dedicated-window)) ((and (fboundp 'display-buffer-record-window) ; GNU Emacs >= 24.1 (not (eql bbdb-pop-up-window-size 1.0))) (set-window-prev-buffers window nil) (display-buffer-record-window 'window window buffer))) (if select (select-window window))) (error (bbdb-pop-up-window-simple buffer select)))))))) (defun bbdb-pop-up-window-simple (buffer select) "Display BUFFER in some window, selecting it if SELECT is non-nil. If `bbdb-dedicated-window' is non-nil, mark the window as dedicated." (let ((window (if select (progn (pop-to-buffer buffer) (get-buffer-window)) (display-buffer buffer)))) (if bbdb-dedicated-window (set-window-dedicated-p window bbdb-dedicated-window)))) ;;; BBDB mode ;;;###autoload (define-derived-mode bbdb-mode special-mode "BBDB" "Major mode for viewing and editing the Insidious Big Brother Database. Letters no longer insert themselves. Numbers are prefix arguments. You can move around using the usual cursor motion commands. \\ \\[bbdb-add-mail-alias]\t Add new mail alias to visible records or \ remove it. \\[bbdb-edit-field]\t Edit the field on the current line. \\[bbdb-delete-field-or-record]\t Delete the field on the \ current line. If the current line is the\n\t first line of a record, then \ delete the entire record. \\[bbdb-insert-field]\t Insert a new field into the current record. \ Note that this\n\t will let you add new fields of your own as well. \\[bbdb-transpose-fields]\t Swap the field on the current line with the \ previous field. \\[bbdb-dial]\t Dial the current phone field. \\[bbdb-next-record], \\[bbdb-prev-record]\t Move to the next or the previous \ displayed record, respectively. \\[bbdb-create]\t Create a new record. \\[bbdb-toggle-records-layout]\t Toggle whether the current record is displayed in a \ one-line\n\t listing, or a full multi-line listing. \\[bbdb-do-all-records]\\[bbdb-toggle-records-layout]\t Do that \ for all displayed records. \\[bbdb-merge-records]\t Merge the contents of the current record with \ some other, and then\n\t delete the current record. \\[bbdb-omit-record]\t Remove the current record from the display without \ deleting it from\n\t the database. This is often a useful thing to do \ before using one\n\t of the `*' commands. \\[bbdb]\t Search for records in the database (on all fields). \\[bbdb-search-mail]\t Search for records by mail address. \\[bbdb-search-organization]\t Search for records by organization. \\[bbdb-search-xfields]\t Search for records by xfields. \\[bbdb-search-name]\t Search for records by name. \\[bbdb-search-changed]\t Display records that have changed since the database \ was saved. \\[bbdb-mail]\t Compose mail to the person represented by the \ current record. \\[bbdb-do-all-records]\\[bbdb-mail]\t Compose mail \ to everyone whose record is displayed. \\[bbdb-save]\t Save the BBDB file to disk. \\[bbdb-print]\t Create a TeX file containing a pretty-printed version \ of all the\n\t records in the database. \\[bbdb-do-all-records]\\[bbdb-print]\t Do that for the \ displayed records only. \\[other-window]\t Move to another window. \\[bbdb-info]\t Read the Info documentation for BBDB. \\[bbdb-help]\t Display a one line command summary in the echo area. \\[bbdb-browse-url]\t Visit Web sites listed in the `url' field(s) of the current \ record. For address completion using the names and mail addresses in the database: \t in Sendmail mode, type \\\\[bbdb-complete-mail]. \t in Message mode, type \\\\[bbdb-complete-mail]. Important variables: \t `bbdb-auto-revert' \t `bbdb-ignore-redundant-mails' \t `bbdb-case-fold-search' \t `bbdb-completion-list' \t `bbdb-default-area-code' \t `bbdb-default-domain' \t `bbdb-layout' \t `bbdb-file' \t `bbdb-phone-style' \t `bbdb-check-auto-save-file' \t `bbdb-pop-up-layout' \t `bbdb-pop-up-window-size' \t `bbdb-add-name' \t `bbdb-add-aka' \t `bbdb-add-mails' \t `bbdb-new-mails-primary' \t `bbdb-read-only' \t `bbdb-mua-pop-up' \t `bbdb-user-mail-address-re' There are numerous hooks. M-x apropos ^bbdb.*hook RET \\{bbdb-mode-map}" (setq truncate-lines t default-directory (file-name-directory bbdb-file) mode-line-buffer-identification (list 24 (buffer-name) " " '(:eval (format "%d/%d/%d" (1+ (or (get-text-property (point) 'bbdb-record-number) -1)) (length bbdb-records) ;; This code gets called a lot. ;; So we keep it as simple as possible. (with-current-buffer bbdb-buffer (length bbdb-records)))) '(:eval (concat " " (bbdb-concat " " (elt bbdb-modeline-info 0) (elt bbdb-modeline-info 1))))) mode-line-modified ;; For the mode-line we want to be fast. So we skip the checks ;; performed by `bbdb-with-db-buffer'. '(:eval (if (buffer-modified-p bbdb-buffer) (if bbdb-read-only "%*" "**") (if bbdb-read-only "%%" "--")))) ;; `bbdb-revert-buffer' acts on `bbdb-buffer'. Yet this command is usually ;; called from the *BBDB* buffer. (set (make-local-variable 'revert-buffer-function) 'bbdb-revert-buffer) (add-hook 'post-command-hook 'force-mode-line-update nil t)) (defun bbdb-sendmail-menu (record) "Menu items for email addresses of RECORD." (let ((mails (bbdb-record-mail record))) (list (if (cdr mails) ;; Submenu for multiple mail addresses (cons "Send mail to..." (mapcar (lambda (address) (vector address `(bbdb-compose-mail ,(bbdb-dwim-mail record address)) t)) mails)) ;; Single entry for single mail address (vector (concat "Send mail to " (car mails)) `(bbdb-compose-mail ,(bbdb-dwim-mail record (car mails))) t))))) (defun bbdb-field-menu (record field) "Menu items specifically for FIELD of RECORD." (let ((type (car field))) (append (list (format "Commands for %s Field:" (cond ((eq type 'xfields) (format "\"%s\"" (symbol-name (car (nth 1 field))))) ((eq type 'name) "Name") ((eq type 'affix) "Affix") ((eq type 'organization) "Organization") ((eq type 'aka) "Alternate Names") ((eq type 'mail) "Mail Addresses") ((memq type '(address phone)) (format "\"%s\" %s" (aref (nth 1 field) 0) (capitalize (symbol-name type))))))) (cond ((eq type 'phone) (list (vector (concat "Dial " (bbdb-phone-string (nth 1 field))) `(bbdb-dial ',field nil) t))) ((eq type 'xfields) (let* ((field (cadr field)) (type (car field))) (cond ((eq type 'url ) (list (vector (format "Browse \"%s\"" (cdr field)) `(bbdb-browse-url ,record) t))))))) '(["Edit Field" bbdb-edit-field t]) (unless (eq type 'name) '(["Delete Field" bbdb-delete-field-or-record t]))))) (defun bbdb-insert-field-menu (record) "Submenu for inserting a new field for RECORD." (cons "Insert New Field..." (mapcar (lambda (field) (if (stringp field) field (vector (symbol-name field) `(bbdb-insert-field ,record ',field (bbdb-read-field ,record ',field ,current-prefix-arg)) (not (or (and (eq field 'affix) (bbdb-record-affix record)) (and (eq field 'organization) (bbdb-record-organization record)) (and (eq field 'mail) (bbdb-record-mail record)) (and (eq field 'aka) (bbdb-record-aka record)) (assq field (bbdb-record-xfields record))))))) (append '(affix organization aka phone address mail) '("--") bbdb-xfield-label-list)))) (defun bbdb-mouse-menu (event) "BBDB mouse menu for EVENT," (interactive "e") (mouse-set-point event) (let* ((record (bbdb-current-record)) (field (bbdb-current-field)) (menu (if (and record field (functionp bbdb-user-menu-commands)) (funcall bbdb-user-menu-commands record field) bbdb-user-menu-commands))) (if record (popup-menu (append (list (format "Commands for record \"%s\":" (bbdb-record-name record)) ["Delete Record" bbdb-delete-records t] ["Toggle Record Display Layout" bbdb-toggle-records-layout t] (if (and (not (eq 'full-multi-line (nth 1 (assq record bbdb-records)))) (bbdb-layout-get-option 'multi-line 'omit)) ["Fully Display Record" bbdb-display-records-completely t]) ["Omit Record" bbdb-omit-record t] ["Merge Record" bbdb-merge-records t]) (if (bbdb-record-mail record) (bbdb-sendmail-menu record)) (list "--" (bbdb-insert-field-menu record)) (if field (cons "--" (bbdb-field-menu record field))) (if menu (append '("--" "User Defined Commands") menu))))))) (defun bbdb-scan-property (property predicate n) "Scan for change of PROPERTY matching PREDICATE for N times. Return position of beginning of matching interval." (let ((fun (if (< 0 n) 'next-single-property-change 'previous-single-property-change)) (limit (if (< 0 n) (point-max) (point-min))) (nn (abs n)) (i 0) (opoint (point)) npoint) ;; For backward search, move point to beginning of interval with PROPERTY. (if (and (<= n 0) (< (point-min) opoint) (let ((prop (get-text-property opoint property))) (and (eq prop (get-text-property (1- opoint) property)) (funcall predicate prop)))) (setq opoint (previous-single-property-change opoint property nil limit))) (if (zerop n) opoint ; Return beginning of interval point is in (while (and (< i nn) (let (done) (while (and (not done) (setq npoint (funcall fun opoint property nil limit))) (cond ((and (/= opoint npoint) (funcall predicate (get-text-property npoint property))) (setq opoint npoint done t)) ((= opoint npoint) ;; Search reached beg or end of buffer: abort. (setq done t i nn npoint nil)) (t (setq opoint npoint)))) done)) (setq i (1+ i))) npoint))) (defun bbdb-next-record (n) "Move point to the beginning of the next BBDB record. With prefix N move forward N records." (interactive "p") (let ((npoint (bbdb-scan-property 'bbdb-record-number 'integerp n))) (if npoint (goto-char npoint) (error "No %s record" (if (< 0 n) "next" "previous"))))) (defun bbdb-prev-record (n) "Move point to the beginning of the previous BBDB record. With prefix N move backwards N records." (interactive "p") (bbdb-next-record (- n))) (defun bbdb-next-field (n) "Move point to next (sub)field. With prefix N move forward N (sub)fields." (interactive "p") (let ((npoint (bbdb-scan-property 'bbdb-field (lambda (p) (and (nth 1 p) (not (eq (nth 2 p) 'field-label)))) n))) (if npoint (goto-char npoint) (error "No %s field" (if (< 0 n) "next" "previous"))))) (defun bbdb-prev-field (n) "Move point to previous (sub)field. With prefix N move backwards N (sub)fields." (interactive "p") (bbdb-next-field (- n))) (defun bbdb-save (&optional prompt noisy) "Save the BBDB if it is modified. If PROMPT is non-nil prompt before saving. If NOISY is non-nil as in interactive calls issue status messages." (interactive (list nil t)) (bbdb-with-db-buffer (if (buffer-modified-p) (if (or (not prompt) (y-or-n-p (if bbdb-read-only "Save the BBDB, even though it is supposedly read-only? " "Save the BBDB now? "))) (save-buffer)) (if noisy (message "(No BBDB changes need to be saved)"))))) ;;;###autoload (defun bbdb-version (&optional arg) "Return string describing the version of BBDB. With prefix ARG, insert string at point." (interactive (list (or (and current-prefix-arg 1) t))) (let ((version-string (format "BBDB version %s (%s)" bbdb-version bbdb-version-date))) (cond ((numberp arg) (insert (message version-string))) ((eq t arg) (message version-string)) (t version-string)))) (defun bbdb-sort-records () "Sort BBDB database. This is not needed when using BBDB itself. It might be necessary, however, after having used other programs to add records to the BBDB." (interactive) (let* ((records (copy-sequence (bbdb-records)))) (bbdb-with-db-buffer (setq bbdb-records (sort bbdb-records 'bbdb-record-lessp)) (if (equal records bbdb-records) (message "BBDB need not be sorted") (message "BBDB was mis-sorted; fixing...") (bbdb-goto-first-record) (delete-region (point) bbdb-end-marker) (let ((buf (current-buffer)) (inhibit-quit t) ; really, don't mess with this cache) (dolist (record bbdb-records) ;; Before printing the record, remove cache (we do not want that ;; written to the file.) Ater writing, put the cache back ;; and update the cache's marker. (setq cache (bbdb-record-cache record)) (set-marker (bbdb-cache-marker cache) (point)) (bbdb-record-set-cache record nil) (bbdb-with-print-loadably (prin1 record buf)) (bbdb-record-set-cache record cache) (insert ?\n))) (message "BBDB was mis-sorted; fixing...done"))))) ;;;###autoload (defun bbdb-initialize (&rest muas) "Initialize BBDB for MUAS and miscellaneous packages. List MUAS may include the following symbols to initialize the respective mail/news readers, composers, and miscellaneous packages: gnus Gnus mail/news reader. mh-e MH-E mail reader. rmail Rmail mail reader. vm VM mail reader. mail Mail (M-x mail). message Message mode. anniv Anniversaries in Emacs diary. sc Supercite. However, this is not the full story. See bbdb-sc.el for how to fully hook BBDB into Supercite. pgp PGP support: this adds `bbdb-pgp' to `message-send-hook' and `mail-send-hook' so that `bbdb-pgp' runs automatically when a message is sent. Yet see info node `(message)Signing and encryption' why you might not want to rely for encryption on a hook function which runs just before the message is sent, that is, you might want to call the command `bbdb-pgp' manually, then call `mml-preview'. See also `bbdb-mua-auto-update-init'. The latter is a separate function as this allows one to initialize the auto update feature for some MUAs only, for example only for outgoing messages." (dolist (mua muas) (let ((init (assq mua bbdb-init-forms))) (if init ;; Should we make sure that each insinuation happens only once? (eval (cadr init)) (bbdb-warn "Do not know how to insinuate `%s'" mua)))) (run-hooks 'bbdb-initialize-hook)) (provide 'bbdb) bbdb-3.1.2/lisp/bbdb-mua.el0000644000175000017500000014165412300262037012277 00000000000000;;; bbdb-mua.el --- various MUA functionality for BBDB ;; Copyright (C) 1991, 1992, 1993 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file provides various additional functionality for BBDB ;;; See the BBDB info manual for documentation. ;;; This file lets you do stuff like ;;; ;;; o automatically add some string to some field(s) based on the ;;; contents of header fields of the current message ;;; o only automatically create records when certain header fields ;;; are matched ;;; o do not automatically create records when certain header fields ;;; are matched ;;; ;;; Read the docstrings; read the texinfo file. (require 'bbdb) (require 'bbdb-com) (eval-and-compile (autoload 'gnus-fetch-original-field "gnus-utils") (autoload 'gnus-summary-select-article "gnus-sum") (defvar gnus-article-buffer) (autoload 'bbdb/vm-header "bbdb-vm") (autoload 'vm-follow-summary-cursor "vm-motion") (autoload 'vm-select-folder-buffer "vm-macro") (autoload 'vm-check-for-killed-summary "vm-misc") (autoload 'vm-error-if-folder-empty "vm-misc") (autoload 'bbdb/rmail-header "bbdb-rmail") (defvar rmail-buffer) (autoload 'bbdb/mh-header "bbdb-mhe") (autoload 'mh-show "mh-show") (defvar mh-show-buffer) (autoload 'message-field-value "message") (autoload 'mail-decode-encoded-word-string "mail-parse")) (defconst bbdb-mua-mode-alist '((vm vm-mode vm-virtual-mode vm-summary-mode vm-presentation-mode) (gnus gnus-summary-mode gnus-article-mode gnus-tree-mode) (rmail rmail-mode rmail-summary-mode) (mh mhe-mode mhe-summary-mode mh-folder-mode) (message message-mode) (mail mail-mode)) "Alist of MUA modes supported by BBDB. Each element is of the form (MUA MODE MODE ...), where MODEs are used by MUA.") (defun bbdb-mua () "For the current message return the MUA. Return values include gnus Newsreader Gnus rmail Reading Mail in Emacs vm Viewmail mh Emacs interface to the MH mail system (aka MH-E) message Mail and News composition mode that goes with Gnus mail Emacs Mail Mode." (let ((mm-alist bbdb-mua-mode-alist) elt mua) (while (setq elt (pop mm-alist)) (if (memq major-mode (cdr elt)) (setq mua (car elt) mm-alist nil))) (or mua (error "BBDB: MUA `%s' not supported" major-mode)))) ;;;###autoload (defun bbdb-message-header (header) "For the current message return the value of HEADER. MIME encoded headers are decoded. Return nil if HEADER does not exist." ;; RW: If HEADER was allowed to be a regexp and the content of multiple ;; matching headers was concatenated as in `message-field-value', ;; this would simplify the usage of `bbdb-accept-message-alist' and ;; `bbdb-ignore-message-alist'. ;; RW: If this function had a remember table, it could look up the value ;; of a header if we request the value of the same header multiple times. ;; (We would reset the remember table each time we move on to a new message.) (let* ((mua (bbdb-mua)) (val (cond (;; It seems that `gnus-fetch-field' fetches decoded content of ;; `gnus-visible-headers', ignoring `gnus-ignored-headers'. ;; Here we use instead `gnus-fetch-original-field' that fetches ;; the encoded content of `gnus-original-article-buffer'. ;; Decoding makes this possibly a bit slower, but something like ;; `bbdb-select-message' does not get fooled by an apparent ;; absence of some headers. ;; See http://permalink.gmane.org/gmane.emacs.gnus.general/78741 (eq mua 'gnus) (gnus-fetch-original-field header)) ((eq mua 'vm) (bbdb/vm-header header)) ((eq mua 'rmail) (bbdb/rmail-header header)) ((eq mua 'mh) (bbdb/mh-header header)) ((memq mua '(message mail)) (message-field-value header)) (t (error "BBDB/%s: header function undefined" mua))))) (if val (mail-decode-encoded-word-string val)))) (defsubst bbdb-message-header-re (header regexp) "Return non-nil if REGEXP matches value of HEADER." (let ((val (bbdb-message-header header)) (case-fold-search t)) ; RW: Is this what we want? (and val (string-match regexp val)))) ;;; Update database ;;;###autoload (defun bbdb-accept-message (&optional invert) "For use with variable `bbdb-mua-update-interactive-p' and friends. Return the value of variable `bbdb-update-records-p' for messages matching `bbdb-accept-message-alist'. If INVERT is non-nil, accept messages not matching `bbdb-ignore-message-alist'." (let ((rest (if invert bbdb-ignore-message-alist bbdb-accept-message-alist)) done elt) (if (eq rest t) (setq done t) (while (and (setq elt (pop rest)) (not done)) (dolist (header (if (stringp (car elt)) (list (car elt)) (car elt))) (if (bbdb-message-header-re header (cdr elt)) (setq done t))))) (if invert (setq done (not done))) (if done bbdb-update-records-p))) ;;;###autoload (defun bbdb-ignore-message (&optional invert) "For use with variable `bbdb-mua-update-interactive-p' and friends. Return the value of variable `bbdb-update-records-p' for messages not matching `bbdb-ignore-message-alist'. If INVERT is non-nil, accept messages matching `bbdb-accept-message-alist'." (bbdb-accept-message (not invert))) ;;;###autoload (defun bbdb-select-message () "For use with variable `bbdb-mua-update-interactive-p' and friends. Return the value of variable `bbdb-update-records-p' for messages both matching `bbdb-accept-message-alist' and not matching `bbdb-ignore-message-alist'." (and (bbdb-accept-message) (bbdb-ignore-message))) (defun bbdb-get-address-components (&optional header-class ignore-address) "Extract mail addresses from a message. Return list with elements (NAME EMAIL HEADER HEADER-CLASS MUA). HEADER-CLASS is defined in `bbdb-message-headers'. If HEADER-CLASS is nil, use all classes in `bbdb-message-headers'. If regexp IGNORE-ADDRESS matches NAME or EMAIL of an address, this address is ignored. If IGNORE-ADDRESS is nil, use value of `bbdb-user-mail-address-re'." ;; We do not use `bbdb-message-all-addresses' here because only when we ;; have compared the addresses with the records in BBDB do we know which ;; address(es) are relevant for us. (let ((message-headers (if header-class (list (assoc header-class bbdb-message-headers)) bbdb-message-headers)) (mua (bbdb-mua)) (ignore-address (or ignore-address bbdb-user-mail-address-re)) address-list address name mail mail-list content) (dolist (headers message-headers) (dolist (header (cdr headers)) (when (setq content (bbdb-message-header header)) ;; Always extract all addresses because we do not know yet which ;; address might match IGNORE-ADDRESS. (dolist (address (bbdb-extract-address-components content t)) ;; We canonicalize name and mail as early as possible. (setq name (car address) mail (cadr address)) ;; ignore uninteresting addresses (unless (or (and (stringp ignore-address) (or (and name (string-match ignore-address name)) (and mail (string-match ignore-address mail)))) (and mail (member-ignore-case mail mail-list))) ;; Add each address only once. (Use MAIL-LIST for book keeping.) ;; Thus if we care about whether an address gets associated with ;; one or another header, the order of elements in ;; `bbdb-message-headers' is relevant. The "most important" ;; headers should be first in `bbdb-message-headers'. (if mail (push mail mail-list)) (push (list name mail header (car headers) mua) address-list)))))) (or (nreverse address-list) (and header-class bbdb-message-try-all-headers ;; Try again the remaining header classes (let ((bbdb-message-headers (remove (assoc header-class bbdb-message-headers) bbdb-message-headers))) (bbdb-get-address-components nil ignore-address)))))) ;;;###autoload (defun bbdb-update-records (address-list &optional update-p sort) "Return the list of BBDB records matching ADDRESS-LIST. ADDRESS-LIST is a list of mail addresses. (It can be extracted from a mail message using `bbdb-get-address-components'.) UPDATE-P may take the following values: search Search for existing records matching ADDRESS. update Search for existing records matching ADDRESS; update name and mail field if necessary. query Search for existing records matching ADDRESS; query for creation of a new record if the record does not exist. create or t Search for existing records matching ADDRESS; create a new record if it does not yet exist. a function This functions will be called with no arguments. It should return one of the above values. nil Take the MUA-specific variable `bbdb/MUA-update-records-p' which may take one of the above values. If this still gives nil, `bbdb-update-records' returns nil. If SORT is non-nil, sort records according to `bbdb-record-lessp'. Ottherwise, the records are ordered according to ADDRESS-LIST. Usually this function is called by the wrapper `bbdb-mua-update-records'." ;; UPDATE-P allows filtering of complete messages. ;; Filtering of individual addresses within an accepted message ;; is done by `bbdb-get-address-components' using `bbdb-user-mail-address-re'. ;; We resolve UPDATE-P repeatedly. This is needed, for example, ;; with the chain `bbdb-mua-auto-update-p' -> `bbdb-select-message' ;; -> `bbdb-update-records-p'. (let (done fallback) (while (not done) (cond ((and (functionp update-p) ;; Bad! `search' is a function in `cl-seq.el'. (not (eq update-p 'search))) (setq update-p (funcall update-p))) ((not (or update-p fallback)) ;; The fallback is applied at most once. (setq update-p (symbol-value (intern-soft (format "bbdb/%s-update-records-p" (bbdb-mua)))) fallback t)) ((setq done t))))) (cond ((eq t update-p) (setq update-p 'create)) ((not (memq update-p '(search update query create nil))) (error "Illegal value of arg update-p: %s" update-p))) (let (;; `bbdb-update-records-p' and `bbdb-offer-to-create' are used here ;; as internal variables for communication with `bbdb-query-create'. ;; This does not affect the value of the global user variable ;; `bbdb-update-records-p'. (bbdb-offer-to-create 'start) (bbdb-update-records-p update-p) address records) (when update-p (while (setq address (pop address-list)) (let* ((bbdb-update-records-address address) hits (task (catch 'done (setq hits ;; We put the call of `bbdb-notice-mail-hook' ;; into `bbdb-annotate-message' so that this hook ;; runs only if the user agreed to change a record. (cond ((or bbdb-read-only (eq bbdb-update-records-p 'search)) ;; Search for records having this mail address ;; but do not modify an existing record. ;; This does not run `bbdb-notice-mail-hook'. (bbdb-message-search (car address) (cadr address))) ((eq bbdb-update-records-p 'update) (bbdb-annotate-message address 'update)) ((eq bbdb-update-records-p 'query) (bbdb-annotate-message address 'bbdb-query-create)) ((eq bbdb-update-records-p 'create) (bbdb-annotate-message address 'create)))) nil))) (cond ((eq task 'quit) (setq address-list nil)) ((not (eq task 'next)) (dolist (hit (delq nil (nreverse hits))) ;; people should be listed only once so we use `add-to-list' (add-to-list 'records hit)))) (if (and records (not bbdb-message-all-addresses)) (setq address-list nil)))) (setq records (if sort (sort records 'bbdb-record-lessp) ;; Make RECORDS a list ordered like ADDRESS-LIST. (nreverse records)))) ;; `bbdb-message-search' might yield multiple records (if (and records (not bbdb-message-all-addresses)) (setq records (list (car records)))) (unless bbdb-read-only (bbdb-editable) (let ((bbdb-notice-hook-pending t)) (dolist (record records) (run-hook-with-args 'bbdb-notice-record-hook record)))) records)) (defun bbdb-query-create () "Interactive query used by `bbdb-update-records'. Return t if the record should be created or `nil' otherwise. Honor previous answers such as `!'." (let ((task bbdb-offer-to-create)) ;; If we have remembered what the user typed previously, ;; `bbdb-offer-to-create' holds a character, i.e., a number. ;; -- Right now, we only remember "!". (when (not (integerp task)) (let ((prompt (format "%s is not in BBDB; add? (y,!,n,s,q,?) " (or (nth 0 bbdb-update-records-address) (nth 1 bbdb-update-records-address)))) event) (while (not event) (setq event (read-key-sequence prompt)) (setq event (if (stringp event) (aref event 0)))) (setq task event) (message ""))) ; clear the message buffer (cond ((eq task ?y) t) ((eq task ?!) (setq bbdb-offer-to-create task) t) ((or (eq task ?n) (eq task ?\s)) (throw 'done 'next)) ((or (eq task ?q) (eq task ?\a)) ; ?\a = C-g (throw 'done 'quit)) ((eq task ?s) (setq bbdb-update-records-p 'search) (throw 'done 'next)) (t ; any other key sequence (save-window-excursion (let* ((buffer (get-buffer-create " *BBDB Help*")) (window (or (get-buffer-window buffer) (split-window (get-lru-window))))) (with-current-buffer buffer (special-mode) (let (buffer-read-only) (erase-buffer) (insert "Your answer controls how BBDB updates/searches for records. Type ? for this help. Type y to add the current record. Type ! to add all remaining records. Type n to skip the current record. (You might also type space) Type s to switch from annotate to search mode. Type q to quit updating records. No more search or annotation is done.") (set-buffer-modified-p nil) (goto-char (point-min))) (set-window-buffer window buffer) (fit-window-to-buffer window))) ;; Try again! (bbdb-query-create)))))) (defun bbdb-annotate-message (address &optional update-p) "Fill the records for message ADDRESS with as much info as possible. If a record for ADDRESS does not yet exist, UPDATE-P controls whether a new record is created for ADDRESS. UPDATE-P may take the values: update or nil Update existing records, never create a new record. query Query interactively whether to create a new record. create or t Create a new record. a function This functions will be called with no arguments. It should return one of the above values. Return the records matching ADDRESS or nil." (let* ((mail (nth 1 address)) ; possibly nil (name (unless (equal mail (car address)) (car address))) (records (bbdb-message-search name mail)) created-p new-records) (if (and (not records) (functionp update-p)) (setq update-p (funcall update-p))) (cond ((eq t update-p) (setq update-p 'create)) ((not update-p) (setq update-p 'update))) ;; Create a new record if nothing else fits. ;; In this way, we can fill the slots of the new record with ;; the same code that updates the slots of existing records. (unless (or records (eq update-p 'update) (not (or name mail))) ;; If there is no name, try to use the mail address as name (if (and bbdb-message-mail-as-name mail (or (null name) (string= "" name))) (setq name (funcall bbdb-message-clean-name-function mail))) (if (or (eq update-p 'create) (and (eq update-p 'query) (y-or-n-p (format "%s is not in the BBDB. Add? " (or name mail))))) (setq records (list (bbdb-empty-record)) created-p t))) (dolist (record records) (let* ((old-name (bbdb-record-name record)) (fullname (bbdb-divide-name (or name ""))) (fname (car fullname)) (lname (cdr fullname)) (mail mail) ;; possibly changed below (created-p created-p) (update-p update-p) change-p add-mails add-name ignore-redundant) ;; Analyze the name part of the record. (cond ((or (not name) ;; The following tests can differ for more complicated names (bbdb-string= name old-name) (and (equal fname (bbdb-record-firstname record)) ; possibly (equal lname (bbdb-record-lastname record))) ; nil (member-ignore-case name (bbdb-record-aka record)))) ; do nothing (created-p ; new record (bbdb-record-set-field record 'name (cons fname lname))) ((not (setq add-name (bbdb-add-job bbdb-add-name record name)))) ; do nothing ((numberp add-name) (unless bbdb-silent (message "name mismatch: \"%s\" changed to \"%s\"" old-name name) (sit-for add-name))) ((bbdb-eval-spec add-name (if old-name (format "Change name \"%s\" to \"%s\"? " old-name name) (format "Assign name \"%s\" to address \"%s\"? " name (car (bbdb-record-mail record))))) ;; Keep old-name as AKA? (when (and old-name (not (member-ignore-case old-name (bbdb-record-aka record)))) (if (bbdb-eval-spec (bbdb-add-job bbdb-add-aka record old-name) (format "Keep name \"%s\" as an AKA? " old-name)) (bbdb-record-set-field record 'aka (cons old-name (bbdb-record-aka record))) (bbdb-remhash old-name record))) (bbdb-record-set-field record 'name (cons fname lname)) (setq change-p 'sort)) ;; make new name an AKA? ((and old-name (not (member-ignore-case name (bbdb-record-aka record))) (bbdb-eval-spec (bbdb-add-job bbdb-add-aka record name) (format "Make \"%s\" an alternate for \"%s\"? " name old-name))) (bbdb-record-set-field record 'aka (cons name (bbdb-record-aka record))) (setq change-p 'sort))) ;; Is MAIL redundant compared with the mail addresses ;; that are already known for RECORD? (if (and mail (setq ignore-redundant (bbdb-add-job bbdb-ignore-redundant-mails record mail))) (let ((mails (bbdb-record-mail-canon record)) (case-fold-search t) redundant ml re) (while (setq ml (pop mails)) (if (and (setq re (bbdb-mail-redundant-re ml)) (string-match re mail)) (setq redundant ml mails nil))) (if redundant (cond ((numberp ignore-redundant) (unless bbdb-silent (message "%s: redundant mail `%s'" (bbdb-record-name record) mail) (sit-for ignore-redundant))) ((or (eq t ignore-redundant) bbdb-silent (y-or-n-p (format "Ignore redundant mail %s?" mail))) (setq mail redundant)))))) ;; Analyze the mail part of the new records (cond ((or (not mail) (equal mail "???") (member-ignore-case mail (bbdb-record-mail-canon record)))) ; do nothing (created-p ; new record (bbdb-record-set-field record 'mail (list mail))) ((not (setq add-mails (bbdb-add-job bbdb-add-mails record mail)))) ; do nothing ((numberp add-mails) (unless bbdb-silent (message "%s: new address `%s'" (bbdb-record-name record) mail) (sit-for add-mails))) ((or (eq add-mails t) ; add it automatically bbdb-silent (y-or-n-p (format "Add address \"%s\" to %s? " mail (bbdb-record-name record))) (and (or (and (functionp update-p) (progn (setq update-p (funcall update-p)) nil)) (memq update-p '(t create)) (and (eq update-p 'query) (y-or-n-p (format "Create a new record for %s? " (bbdb-record-name record))))) (progn (setq record (bbdb-empty-record)) (bbdb-record-set-name record fname lname) (setq created-p t)))) (let ((mails (bbdb-record-mail record))) (if ignore-redundant ;; Does the new address MAIL make an old address redundant? (let ((mail-re (bbdb-mail-redundant-re mail)) (case-fold-search t) okay redundant) (dolist (ml mails) (if (string-match mail-re ml) ; redundant mail address (push ml redundant) (push ml okay))) (let ((form (format "redundant mail%s %s" (if (< 1 (length redundant)) "s" "") (bbdb-concat 'mail (nreverse redundant)))) (name (bbdb-record-name record))) (if redundant (cond ((numberp ignore-redundant) (unless bbdb-silent (message "%s: %s" name form) (sit-for ignore-redundant))) ((or (eq t ignore-redundant) bbdb-silent (y-or-n-p (format "Delete %s: " form))) (if (eq t ignore-redundant) (message "%s: deleting %s" name form)) (setq mails okay))))))) ;; then modify RECORD (bbdb-record-set-field record 'mail (if (and mails (bbdb-eval-spec (bbdb-add-job bbdb-new-mails-primary record mail) (format "Make \"%s\" the primary address? " mail))) (cons mail mails) (nconc mails (list mail)))) (unless change-p (setq change-p t))))) (cond (created-p (unless bbdb-silent (if (bbdb-record-name record) (message "created %s's record with address \"%s\"" (bbdb-record-name record) mail) (message "created record with naked address \"%s\"" mail))) (bbdb-change-record record t t)) (change-p (unless bbdb-silent (cond ((eq change-p 'sort) (message "noticed \"%s\"" (bbdb-record-name record))) ((bbdb-record-name record) (message "noticed %s's address \"%s\"" (bbdb-record-name record) mail)) (t (message "noticed naked address \"%s\"" mail)))) (bbdb-change-record record (eq change-p 'sort)))) (let ((bbdb-notice-hook-pending t)) (run-hook-with-args 'bbdb-notice-mail-hook record)) (push record new-records))) (nreverse new-records))) (defun bbdb-mua-update-records (&optional header-class update-p sort) "Wrapper for `bbdb-update-records'. HEADER-CLASS is defined in `bbdb-message-headers'. If it is nil, use all classes in `bbdb-message-headers'. UPDATE-P is defined in `bbdb-update-records'. If SORT is non-nil, sort records according to `bbdb-record-lessp'." (let ((mua (bbdb-mua))) (save-current-buffer (cond ;; VM ((eq mua 'vm) (vm-select-folder-buffer) (vm-check-for-killed-summary) (vm-error-if-folder-empty) (let ((enable-local-variables t)) ; ...or vm bind this to nil. (bbdb-update-records (bbdb-get-address-components header-class) update-p sort))) ;; Gnus ((eq mua 'gnus) (set-buffer gnus-article-buffer) (bbdb-update-records (bbdb-get-address-components header-class) update-p sort)) ;; MH-E ((eq mua 'mh) (if mh-show-buffer (set-buffer mh-show-buffer)) (bbdb-update-records (bbdb-get-address-components header-class) update-p sort)) ;; Rmail ((eq mua 'rmail) (set-buffer rmail-buffer) (bbdb-update-records (bbdb-get-address-components header-class) update-p sort)) ;; Message and Mail ((memq mua '(message mail)) (bbdb-update-records (bbdb-get-address-components header-class) update-p sort)))))) (defmacro bbdb-mua-wrapper (&rest body) "Perform BODY in a MUA buffer." (declare (debug t)) `(let ((mua (bbdb-mua))) ;; Here we replicate BODY multiple times which gets clumsy ;; for a larger BODY! (cond ((eq mua 'gnus) ;; This fails in *Article* buffers, where ;; `gnus-article-read-summary-keys' provides an additional wrapper (save-current-buffer (gnus-summary-select-article) ; sets buffer `gnus-summary-buffer' ,@body)) ((memq mua '(mail message rmail mh vm)) (cond ((eq mua 'vm) (vm-follow-summary-cursor)) ((eq mua 'mh) (mh-show))) ;; rmail, mail and message do not require any wrapper ,@body)))) (defun bbdb-mua-update-interactive-p () "Interactive spec for arg UPDATE-P of `bbdb-mua-display-records' and friends. If these commands are called without a prefix, the value of their arg UPDATE-P is the car of the variable `bbdb-mua-update-interactive-p'. Called with a prefix, the value of UPDATE-P is the cdr of this variable." (let ((update-p (if current-prefix-arg (cdr bbdb-mua-update-interactive-p) (car bbdb-mua-update-interactive-p)))) (if (eq update-p 'read) (let ((str (completing-read "Action: " '((query) (search) (create)) nil t))) (unless (string= "" str) (intern str))) ; nil otherwise update-p))) (defun bbdb-mua-window-p () "Return lambda function matching the MUA window. This return value can be used as arg HORIZ-P of `bbdb-display-records'." (let ((mm-alist bbdb-mua-mode-alist) elt fun) (while (setq elt (cdr (pop mm-alist))) (if (memq major-mode elt) (setq fun `(lambda (window) (with-current-buffer (window-buffer window) (memq major-mode ',elt))) mm-alist nil))) fun)) ;;;###autoload (defun bbdb-mua-display-records (&optional header-class update-p all) "Display the BBDB record(s) for the addresses in this message. This looks into the headers of a message according to HEADER-CLASS. Then for the mail addresses found the corresponding BBDB records are displayed. UPDATE-P determines whether only existing BBDB records are displayed or whether also new records are created for these mail addresses. HEADER-CLASS is defined in `bbdb-message-headers'. If it is nil, use all classes in `bbdb-message-headers'. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'. If ALL is non-nil, bind `bbdb-message-all-addresses' to ALL." (interactive (list nil (bbdb-mua-update-interactive-p))) (let ((bbdb-pop-up-window-size bbdb-mua-pop-up-window-size) (bbdb-message-all-addresses (or all bbdb-message-all-addresses)) records) (bbdb-mua-wrapper (setq records (bbdb-mua-update-records header-class update-p t))) (if records (bbdb-display-records records nil nil nil (bbdb-mua-window-p))) records)) ;; The following commands are some frontends for `bbdb-mua-display-records', ;; which is always doing the real work. In your init file, you can further ;; modify or adapt these simple commands to your liking. ;;;###autoload (defun bbdb-mua-display-sender (&optional update-p) "Display the BBDB record(s) for the sender of this message. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'." (interactive (list (bbdb-mua-update-interactive-p))) (bbdb-mua-display-records 'sender update-p)) ;;;###autoload (defun bbdb-mua-display-recipients (&optional update-p) "Display the BBDB record(s) for the recipients of this message. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'." (interactive (list (bbdb-mua-update-interactive-p))) (bbdb-mua-display-records 'recipients update-p)) ;;;###autoload (defun bbdb-mua-display-all-records (&optional update-p) "Display the BBDB record(s) for all addresses in this message. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'." (interactive (list (bbdb-mua-update-interactive-p))) (bbdb-mua-display-records nil update-p t)) ;;;###autoload (defun bbdb-mua-display-all-recipients (&optional update-p) "Display BBDB records for all recipients of this message. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'." (interactive (list (bbdb-mua-update-interactive-p))) (bbdb-mua-display-records 'recipients update-p t)) ;; The commands `bbdb-annotate-record' and `bbdb-mua-edit-field' ;; have kind of similar goals, yet they use rather different strategies. ;; `bbdb-annotate-record' is less obtrusive. It does not display ;; the records it operates on, nor does it display the content ;; of the field before or after adding or replacing the annotation. ;; Hence the user needs to know what she is doing. ;; `bbdb-mua-edit-field' is more explicit: It displays the records ;; as well as the current content of the field that gets edited. ;; In principle, this function can be used not only with MUAs. (defun bbdb-annotate-record (record annotation &optional field replace) "In RECORD add an ANNOTATION to field FIELD. FIELD defaults to `bbdb-annotate-field'. If REPLACE is non-nil, ANNOTATION replaces the content of FIELD. If ANNOTATION is an empty string and REPLACE is non-nil, delete FIELD." (if (memq field '(name firstname lastname phone address xfields)) (error "Field `%s' illegal" field)) (setq annotation (bbdb-string-trim annotation)) (cond ((memq field '(affix organization mail aka)) (setq annotation (list annotation))) ((not field) (setq field bbdb-annotate-field))) (bbdb-record-set-field record field annotation (not replace)) (bbdb-change-record record)) ;; FIXME: For interactive calls of the following commands, the arg UPDATE-P ;; should have the same meaning as for `bbdb-mua-display-records', ;; that is, it should use `bbdb-mua-update-interactive-p'. ;; But here the prefix arg is already used in a different way. ;; We could possibly solve this problem if all `bbdb-mua-*' commands ;; used another prefix arg that is consistently used only for ;; `bbdb-mua-update-interactive-p'. ;; Yet this prefix arg must be defined within the key space of the MUA(s). ;; This results in lots of conflicts... ;; ;; Current workaround: ;; These commands use merely the car of `bbdb-mua-update-interactive-p'. ;; If one day someone proposes a smart solution to this problem (suggestions ;; welcome!), this solution will hopefully include the current workaround ;; as a subset of all its features. (defun bbdb-mua-annotate-field-interactive () "Interactive specification for `bbdb-mua-annotate-sender' and friends." (bbdb-editable) (let ((field (if (eq 'all-fields bbdb-annotate-field) (intern (completing-read "Field: " (mapcar 'symbol-name (append '(affix organization mail aka) bbdb-xfield-label-list)))) bbdb-annotate-field))) (list (read-string (format "Annotate `%s': " field)) field current-prefix-arg (car bbdb-mua-update-interactive-p)))) ;;;###autoload (defun bbdb-mua-annotate-sender (annotation &optional field replace update-p) "Add ANNOTATION to field FIELD of the BBDB record(s) of message sender(s). FIELD defaults to `bbdb-annotate-field'. If REPLACE is non-nil, ANNOTATION replaces the content of FIELD. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, use car of `bbdb-mua-update-interactive-p'." (interactive (bbdb-mua-annotate-field-interactive)) (bbdb-mua-wrapper (dolist (record (bbdb-mua-update-records 'sender update-p)) (bbdb-annotate-record record annotation field replace)))) ;;;###autoload (defun bbdb-mua-annotate-recipients (annotation &optional field replace update-p) "Add ANNOTATION to field FIELD of the BBDB records of message recipients. FIELD defaults to `bbdb-annotate-field'. If REPLACE is non-nil, ANNOTATION replaces the content of FIELD. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, use car of `bbdb-mua-update-interactive-p'." (interactive (bbdb-mua-annotate-field-interactive)) (bbdb-mua-wrapper (dolist (record (bbdb-mua-update-records 'recipients update-p)) (bbdb-annotate-record record annotation field replace)))) (defun bbdb-mua-edit-field-interactive () "Interactive specification for command `bbdb-mua-edit-field' and friends." (bbdb-editable) (list (if (eq 'all-fields bbdb-mua-edit-field) (intern (completing-read "Field: " (mapcar 'symbol-name (append '(name affix organization aka mail) bbdb-xfield-label-list)))) bbdb-mua-edit-field) (bbdb-mua-update-interactive-p))) ;;;###autoload (defun bbdb-mua-edit-field (&optional field update-p header-class) "Edit FIELD of the BBDB record(s) of message sender(s) or recipients. FIELD defaults to value of variable `bbdb-mua-edit-field'. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'. HEADER-CLASS is defined in `bbdb-message-headers'. If it is nil, use all classes in `bbdb-message-headers'." (interactive (bbdb-mua-edit-field-interactive)) (cond ((memq field '(firstname lastname address phone xfields)) (error "Field `%s' not editable this way" field)) ((not field) (setq field bbdb-mua-edit-field))) (bbdb-mua-wrapper (let ((records (bbdb-mua-update-records header-class update-p)) (bbdb-pop-up-window-size bbdb-mua-pop-up-window-size)) (when records (bbdb-display-records records nil nil nil (bbdb-mua-window-p)) (dolist (record records) (bbdb-edit-field record field)))))) ;;;###autoload (defun bbdb-mua-edit-field-sender (&optional field update-p) "Edit FIELD of record corresponding to sender of this message. FIELD defaults to value of variable `bbdb-mua-edit-field'. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'." (interactive (bbdb-mua-edit-field-interactive)) (bbdb-mua-edit-field field update-p 'sender)) ;;;###autoload (defun bbdb-mua-edit-field-recipients (&optional field update-p) "Edit FIELD of record corresponding to recipient of this message. FIELD defaults to value of variable `bbdb-mua-edit-field'. UPDATE-P may take the same values as `bbdb-update-records-p'. For interactive calls, see function `bbdb-mua-update-interactive-p'." (interactive (bbdb-mua-edit-field-interactive)) (bbdb-mua-edit-field field update-p 'recipients)) ;; Functions for noninteractive use in MUA hooks ;;;###autoload (defun bbdb-mua-auto-update (&optional header-class update-p) "Update BBDB automatically based on incoming and outgoing messages. This looks into the headers of a message according to HEADER-CLASS. Then for the mail addresses found the corresponding BBDB records are updated. UPDATE-P determines whether only existing BBDB records are taken or whether also new records are created for these mail addresses. Return matching records. HEADER-CLASS is defined in `bbdb-message-headers'. If it is nil, use all classes in `bbdb-message-headers'. UPDATE-P may take the same values as `bbdb-mua-auto-update-p'. If UPDATE-P is nil, use `bbdb-mua-auto-update-p' (which see). If `bbdb-mua-pop-up' is non-nil, BBDB pops up the *BBDB* buffer along with the MUA window(s), displaying the matching records using `bbdb-pop-up-layout'. If this is nil, BBDB is updated silently. This function is intended for noninteractive use via appropriate MUA hooks. Call `bbdb-mua-auto-update-init' in your init file to put this function into the respective MUA hooks. See `bbdb-mua-display-records' and friends for interactive commands." (let* ((bbdb-silent-internal t) (records (bbdb-mua-update-records header-class (or update-p bbdb-mua-auto-update-p))) (bbdb-pop-up-window-size bbdb-mua-pop-up-window-size)) (if bbdb-mua-pop-up (if records (bbdb-display-records records bbdb-pop-up-layout nil nil (bbdb-mua-window-p)) ;; If there are no records, empty the BBDB window. (bbdb-undisplay-records))) records)) ;; Should the following be replaced by a minor mode?? ;; Or should we make this function interactive in some other way? ;;;###autoload (defun bbdb-mua-auto-update-init (&rest muas) "For MUAS add `bbdb-mua-auto-update' to their presentation hook. If a MUA is not an element of MUAS, `bbdb-mua-auto-update' is removed from the respective presentation hook. Call this function in your init file to use the auto update feature with MUAS. This function is separate from the general function `bbdb-initialize' as this allows one to initialize the auto update feature for some MUAs only, for example only for outgoing messages. See `bbdb-mua-auto-update' for details about the auto update feature." (dolist (mua '((message . message-send-hook) (mail . mail-send-hook) (rmail . rmail-show-message-hook) (gnus . gnus-article-prepare-hook) (mh . mh-show-hook) (vm . vm-select-message-hook))) (if (memq (car mua) muas) (add-hook (cdr mua) 'bbdb-mua-auto-update) (remove-hook (cdr mua) 'bbdb-mua-auto-update)))) ;;;###autoload (defun bbdb-auto-notes (record) "Automatically annotate RECORD based on the headers of the current message. See the variables `bbdb-auto-notes-rules', `bbdb-auto-notes-ignore-messages' and `bbdb-auto-notes-ignore-headers'. For use as an element of `bbdb-notice-record-hook'." ;; This code re-evaluates the annotations each time a message is viewed. ;; It would be faster if we could somehow store (permanently?) that we ;; have already annotated a message. (let ((case-fold-search t)) (unless (or bbdb-read-only ;; check the ignore-messages pattern (let ((ignore-messages bbdb-auto-notes-ignore-messages) ignore rule) (while (and (not ignore) (setq rule (pop ignore-messages))) (if (cond ((functionp rule) ;; RULE may use `bbdb-update-records-address' (funcall rule record)) ((symbolp rule) (eq rule (nth 4 bbdb-update-records-address))) ((eq 1 (safe-length rule)) (bbdb-message-header-re (car rule) (cdr rule))) ((eq 2 (safe-length rule)) (and (eq (car rule) (nth 4 bbdb-update-records-address)) (bbdb-message-header-re (nth 1 rule) (nth 2 rule))))) (setq ignore t))) ignore)) (bbdb-editable) ;; For speed-up expanded rules are stored in `bbdb-auto-notes-rules-expanded'. (when (and bbdb-auto-notes-rules (not bbdb-auto-notes-rules-expanded)) (let (expanded mua from-to header) (dolist (rule bbdb-auto-notes-rules) ;; Which MUA do we want? (if (or (stringp (car rule)) (stringp (nth 1 rule))) (setq mua t) (setq mua (if (symbolp (car rule)) (listp (car rule)) (car rule)) rule (cdr rule))) ;; Which FROM-TO headers do we want? (if (stringp (car rule)) (setq from-to t) (setq from-to (car rule) rule (cdr rule))) (setq header (car rule)) (let (string field replace elt-e) (dolist (elt (cdr rule)) (if (consp (setq string (cdr elt))) (setq field (car string) ; (REGEXP FIELD-NAME STRING REPLACE) replace (nth 2 string) ; perhaps nil string (nth 1 string)) ;; else it's simple (REGEXP . STRING) (setq field bbdb-default-xfield replace nil)) (push (list (car elt) field string replace) elt-e)) (push (append (list mua from-to header) (nreverse elt-e)) expanded))) (setq bbdb-auto-notes-rules-expanded (nreverse expanded)))) (dolist (rule bbdb-auto-notes-rules-expanded) (let ((mua (car rule)) (from-to (nth 1 rule)) (header (nth 2 rule)) hd-val string annotation) (when (and (or (eq mua t) (memq (nth 4 bbdb-update-records-address) mua)) (or (eq from-to t) (member-ignore-case (nth 2 bbdb-update-records-address) from-to) (memq (nth 3 bbdb-update-records-address) from-to)) (setq hd-val (bbdb-message-header header))) (dolist (elt (nthcdr 3 rule)) (when (and (string-match (car elt) hd-val) (let ((ignore (cdr (assoc-string header bbdb-auto-notes-ignore-headers t)))) (not (and ignore (string-match ignore hd-val))))) (setq string (nth 2 elt) annotation (cond ((integerp string) (match-string string hd-val)) ((stringp string) (replace-match string nil nil hd-val)) ((functionp string) (funcall string hd-val)) (t (error "Illegal value: %s" string)))) (bbdb-annotate-record record annotation (nth 1 elt) (nth 3 elt)))))))))) ;;; Mark BBDB records in the MUA summary buffer (defun bbdb-mua-summary-unify (address) "Unify mail ADDRESS displayed for a message in the MUA Summary buffer. Typically ADDRESS refers to the value of the From header of a message. If ADDRESS matches a record in BBDB display a unified name instead of ADDRESS in the MUA Summary buffer. Unification uses `bbdb-mua-summary-unification-list' (see there). The first match in this list becomes the text string displayed for a message in the MUA Summary buffer instead of ADDRESS. If variable `bbdb-mua-summary-mark' is non-nil use it to precede known addresses. Return the unified mail address. Currently this works with Gnus and VM. It requires the BBDB insinuation of these MUAs. Also, the MUA Summary format string must use `bbdb-mua-summary-unify-format-letter' (see there)." ;; ADDRESS is analyzed as in `bbdb-get-address-components'. (let* ((data (bbdb-extract-address-components address)) (name (car data)) (mail (cadr data)) (record (car (bbdb-message-search name mail))) (u-list bbdb-mua-summary-unification-list) elt val) (while (setq elt (pop u-list)) (setq val (cond ((eq elt 'message-name) name) ((eq elt 'message-mail) mail) ((eq elt 'message-address) address) (record (let ((result (bbdb-record-field record elt))) (if (stringp result) result (car result)))))) ; RESULT is list. (if val (setq u-list nil))) (format "%s%s" (cond ((not bbdb-mua-summary-mark) "") ((not record) " ") ((functionp bbdb-mua-summary-mark-field) (funcall bbdb-mua-summary-mark-field record)) ((bbdb-record-xfield record bbdb-mua-summary-mark-field)) (t bbdb-mua-summary-mark)) (or val name mail address "**UNKNOWN**")))) (defun bbdb-mua-summary-mark (address) "In the MUA Summary buffer mark messages matching a BBDB record. ADDRESS typically refers to the value of the From header of a message. If ADDRESS matches a record in BBDB return a mark, \" \" otherwise. The mark itself is the value of the xfield `bbdb-mua-summary-mark-field' if this xfield is in the poster's record, and `bbdb-mua-summary-mark' otherwise." (if (not bbdb-mua-summary-mark) "" ; for consistency ;; ADDRESS is analyzed as in `bbdb-get-address-components'. (let* ((data (bbdb-extract-address-components address)) (record (car (bbdb-message-search (car data) (cadr data))))) (if record (or (when (functionp bbdb-mua-summary-mark-field) (funcall bbdb-mua-summary-mark-field record) t) (bbdb-record-xfield record bbdb-mua-summary-mark-field) bbdb-mua-summary-mark) " ")))) (provide 'bbdb-mua) bbdb-3.1.2/lisp/Makefile.in0000644000175000017500000005133212327261573012357 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # lisp/Makefile.am for BBDB # # Copyright (C) 2010-2014 Roland Winkler # Author: Roland Winkler # Christian Egli # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @VM_TRUE@am__append_1 = bbdb-vm.el subdir = lisp DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/bbdb-pkg.el.in $(am__dist_lisp_LISP_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/emacs_vm.m4 \ $(top_srcdir)/m4/package_date.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = bbdb-pkg.el CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_lisp_LISP_DIST = bbdb.el bbdb-anniv.el bbdb-com.el \ bbdb-gnus.el bbdb-ispell.el bbdb-message.el bbdb-mhe.el \ bbdb-migrate.el bbdb-mua.el bbdb-pgp.el bbdb-print.el \ bbdb-rmail.el bbdb-sc.el bbdb-snarf.el bbdb-site.el bbdb-vm.el am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(lispdir)" "$(DESTDIR)$(lispdir)" dist_lispLISP_INSTALL = $(INSTALL_DATA) LISP = $(dist_lisp_LISP) am__ELFILES = bbdb-anniv.el bbdb-com.el bbdb-gnus.el bbdb-ispell.el \ bbdb-message.el bbdb-mhe.el bbdb-migrate.el bbdb-mua.el \ bbdb-pgp.el bbdb-print.el bbdb-rmail.el bbdb-sc.el \ bbdb-site.el bbdb-snarf.el bbdb-vm.el bbdb.el am__ELCFILES = $(am__ELFILES:.el=.elc) ELCFILES = $(LISP:.el=.elc) DATA = $(lisp_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_ELCFLAGS = @AM_ELCFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EMACS = @EMACS@ EMACSLOADPATH = @EMACSLOADPATH@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_DATE = @PACKAGE_DATE@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ dist_lisp_LISP = bbdb.el bbdb-anniv.el bbdb-com.el bbdb-gnus.el \ bbdb-ispell.el bbdb-message.el bbdb-mhe.el bbdb-migrate.el \ bbdb-mua.el bbdb-pgp.el bbdb-print.el bbdb-rmail.el bbdb-sc.el \ bbdb-snarf.el bbdb-site.el $(am__append_1) # We use the Automake variable AM_ELCFLAGS to include the VM lisp directory # in the Emacs load path when compiling BBDB with VM support. lisp_DATA = bbdb-loaddefs.el MOSTLYCLEANFILES = bbdb-loaddefs.el CLEANFILES = bbdb-site.el bbdb-pkg.el # The Emacs function define-package is not autoloaded. # So we assume we need not compile bbdb-pkg.el (which otherwise # results in a compiler warning that define-package is not defined). EXTRA_DIST = bbdb-site.el.in bbdb-pkg.el makefile-temp # Be sure bbdb-site.el exists early for "(require 'bbdb-site)" BUILT_SOURCES = bbdb-site.el all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .el .elc $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lisp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lisp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): bbdb-pkg.el: $(top_builddir)/config.status $(srcdir)/bbdb-pkg.el.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ .el.elc: if test "$(EMACS)" != "no"; then \ am__dir=. am__subdir_includes=''; \ case $@ in */*) \ am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \ am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \ esac; \ test -d "$$am__dir" || $(MKDIR_P) "$$am__dir" || exit 1; \ $(EMACS) --batch \ $(AM_ELCFLAGS) $(ELCFLAGS) \ $$am__subdir_includes -L $(builddir) -L $(srcdir) \ --eval "(defun byte-compile-dest-file (f) \"$@\")" \ --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \ else :; fi install-dist_lispLISP: $(dist_lisp_LISP) $(ELCFILES) @$(NORMAL_INSTALL) @if test "$(EMACS)" != no && test -n "$(lispdir)"; then \ list='$(dist_lisp_LISP)'; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(lispdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(lispdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ echo " $(dist_lispLISP_INSTALL) '$$d$$p' '$(DESTDIR)$(lispdir)/$$f'"; \ $(dist_lispLISP_INSTALL) "$$d$$p" "$(DESTDIR)$(lispdir)/$$f" || exit $$?; \ if test -f $${p}c; then \ echo " $(dist_lispLISP_INSTALL) '$${p}c' '$(DESTDIR)$(lispdir)/$${f}c'"; \ $(dist_lispLISP_INSTALL) "$${p}c" "$(DESTDIR)$(lispdir)/$${f}c" || exit $$?; \ else : ; fi; \ done; \ else : ; fi uninstall-dist_lispLISP: @$(NORMAL_UNINSTALL) @test "$(EMACS)" != no && test -n "$(lispdir)" || exit 0; \ list='$(dist_lisp_LISP)'; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ files="$$files "`echo "$$files" | sed 's|$$|c|'`; \ dir='$(DESTDIR)$(lispdir)'; $(am__uninstall_files_from_dir) clean-lisp: -rm -f $(ELCFILES) install-lispDATA: $(lisp_DATA) @$(NORMAL_INSTALL) @list='$(lisp_DATA)'; test -n "$(lispdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(lispdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(lispdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(lispdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(lispdir)" || exit $$?; \ done uninstall-lispDATA: @$(NORMAL_UNINSTALL) @list='$(lisp_DATA)'; test -n "$(lispdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(lispdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LISP) $(ELCFILES) $(DATA) installdirs: for dir in "$(DESTDIR)$(lispdir)" "$(DESTDIR)$(lispdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-lisp mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_lispLISP install-lispDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_lispLISP uninstall-lispDATA .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-lisp cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_lispLISP install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-lispDATA \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am uninstall-dist_lispLISP \ uninstall-lispDATA bbdb-loaddefs.el: $(dist_lisp_LISP) # 2011-12-11: We switched from bbdb-autoloads.el to bbdb-loaddefs.el. # If the user still has an old bbdb-autoloads.el in the BBDB # lisp directory (and keeps loading it from the emacs init file), # we might get strange error messages that things fail. # So we throw an error if these old files are found. @if test -f bbdb-autoloads.el -o -f bbdb-autoloads.elc; then \ (echo "*** ERROR: Old file(s) \`bbdb-autoloads.el(c)' found ***" ; \ echo "*** Delete these files; do not load them from your init file ***") && \ false ; \ fi @echo "(provide 'bbdb-loaddefs)" > $@; @echo "(if (and load-file-name (file-name-directory load-file-name))" >> $@; @echo " (add-to-list 'load-path (file-name-directory load-file-name)))" >> $@; @echo " " >> $@; # Generated autoload-file must have an absolute path, # $srcdir can be relative. $(EMACS) -batch -l autoload \ --eval '(setq generated-autoload-file "'$(abs_builddir)/$@'")' \ --eval '(setq make-backup-files nil)' \ -f batch-update-autoloads $(srcdir) # Generate bbdb-site.el here as pkgdatadir is only known at "make" time. # We protect the autoconf variables in the sed regular expressions # so as not to substitute them when processing Makefile.am. # Warning: the sed expressions will break if PACKAGE_VERSION, PACKAGE_DATE, # or pkgdatadir contain '='. bbdb-site.el: $(top_builddir)/config.status bbdb-site.el.in sed -e "s=[@]pkgdatadir[@]=$(pkgdatadir)=" \ -e "s=[@]PACKAGE_VERSION[@]=$(PACKAGE_VERSION)=" \ -e "s=[@]PACKAGE_DATE[@]=$(PACKAGE_DATE)=" \ < $@.in > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bbdb-3.1.2/lisp/bbdb-pkg.el0000644000175000017500000000012312327261575012276 00000000000000(define-package "bbdb" "3.1.2" "The Insidious Big Brother Database for GNU Emacs") bbdb-3.1.2/lisp/bbdb-print.el0000644000175000017500000006171312261714073012656 00000000000000;;; bbdb-print.el -- for printing BBDB databases using TeX. ;; Copyright (C) 1993 Boris Goldowsky ;; Copyright (C) 2010-2014 Roland Winkler ;; Authors: Boris Goldowsky ;; Dirk Grunwald ;; Luigi Semenzato ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file lets you print the BBDB using TeX. ;;; See the BBDB info manual for documentation. ;;; ;;; In the *BBDB* buffer, type P to convert the listing to TeX ;;; format. It will prompt you for a filename. Then run TeX on that ;;; file and print it out. ;;; ;;; `bbdb-print' understands one new bbdb field: tex-name. If it ;;; exists, this will be used for the printed listing instead of the ;;; name field of that record. This is designed for entering names ;;; with lots of accents that would mess up mailers, or when for any ;;; reason you want the printed version of the name to be different ;;; from the version that appears on outgoing mail and in the *BBDB* ;;; buffer. You may want to add tex-name to a omit list of the variable ;;; `bbdb-layout-alist' so you only see it in the printout. ;;; tex-name is exempted from the usual special-character quoting done by ;;; `bbdb-print'; it is used verbatim. ;;; ;;; Not all fields or records need to be printed. To not print a certain ;;; field, add it to `bbdb-print-omit-fields'. If after eliding fields ;;; a record contains no interesting information, it will not be printed ;;; at all; the variable `bbdb-print-require' determines what is meant ;;; by "interesting" information. You can also restrict printing to just ;;; the records currently in the *BBDB* buffer by using *P instead of P. ;;; ;;; There are various options for the way the formatting is done; most ;;; are controlled by the variable `bbdb-print-alist'. See its ;;; documentation for the allowed options. ;;; This program was adapted for BBDB by Boris Goldowsky ;;; and Dirk Grunwald ;;; using a TeX format designed by Luigi ;;; Semenzato . ;;; We are also grateful to numerous people on the bbdb-info ;;; mailing list for suggestions and bug reports. ;;; Code: (require 'bbdb) (require 'bbdb-com) ;;; Variables: (defcustom bbdb-print-file "~/bbdb.tex" "Default file name for printouts of BBDB database." :group 'bbdb-utilities-print :type 'file) (defcustom bbdb-print-omit-fields '(tex-name aka mail-alias creation-date timestamp vm-folder) "List of fields NOT to print in address list. See also `bbdb-print-require'." :group 'bbdb-utilities-print :type '(repeat (symbol :tag "Field to exclude"))) (defcustom bbdb-print-require '(or address phone) "What fields are required for printing a record. This is evaluated for each record, and the record will be printed only if it returns non-nil. The symbols name, organization, mail, phone, address, and notes will be set to appropriate values when this is evaluated; 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 examples: Print only people whose phone numbers are known: (setq bbdb-print-require 'phone) Print people whose names and organizations are known: (setq bbdb-print-require '(and name organization)) Print people whose names, and either addresses or phone numbers are known: (setq bbdb-print-require '(and name (or address phone)))." :group 'bbdb-utilities-print :type '(choice (const :tag "Print all records" t) (symbol :tag "Print all records with this field" phone) (sexp :tag "Print only when this evaluates to non-nil" '(or phone address phone)))) (define-widget 'bbdb-print-alist-widget 'repeat "For use in Customize" :args `((choice (cons :tag "Column specification" :value (column . 1) (const :tag "Column mode" column) (radio-button-choice (const :tag "One column" 1) (const :tag "Two columns" 2) (const :tag "Three columns" 3) (const :tag "Four columns" 4) (const :tag "Quad" quad) (const :tag "Grid" grid))) (cons :tag "Separator specification" :value (separator . 0) (const :tag "Separator" separator) (radio-button-choice (const :tag "None" 0) (const :tag "Line" 1) (const :tag "Boxed letters" 2) (const :tag "Large boxed letters" 3) (const :tag "Large letters" 4) (const :tag "Letters with lines" 5) (const :tag "Letters with suits" 6) (const :tag "Boxed letters with suits" 7))) (cons :tag "Omit certain area codes" :value (omit-area-code . ,(concat "^(" (if (integerp bbdb-default-area-code) (int-to-string bbdb-default-area-code) "000") ") ")) (const :tag "Omit certain area codes" omit-area-code) (regexp :tag "Regexp to omit")) (cons :tag "Phone number label" :value (phone-on-first-line . t) (const :tag "Phone number label" phone-on-first-line) (choice (const :tag "First home number on same line as name" t) (const :tag "Do not put the phone number on the name line" nil) (regexp :tag "Use phone number whose label matches" "^work$"))) (cons :tag "Limit included phone numbers" :value (n-phones . 3) (const :tag "Limit included phone numbers" n-phones) (integer :tag "Maximum number to include" 3)) (cons :tag "Limit included addresses" :value (n-addresses . 3) (const :tag "Limit included addresses" n-addresses) (integer :tag "Maximum number to include" 3)) (cons :tag "Include additional TeX input files" :value (include-files . nil) (const :tag "Additional TeX input files to include" include-files) (repeat (file :tag "TeX file to include"))) (cons :tag "Font type selection" :value (ps-fonts . nil) (const :tag "Select font type" ps-fonts) (choice (const :tag "Use standard TeX fonts" nil) (const :tag "Use Postscript fonts" t))) (cons :tag "Font size selection" :value (font-size . 10) (const :tag "Select font size" font-size) (integer :tag "Font size in points" 10)) (cons :tag "Page height selection" :value (v-size . nil) (const :tag "Select page height" v-size) (choice (const :tag "Use TeX default" nil) (string :tag "Height (must be valid TeX dimension)" "9in"))) (cons :tag "Page width selection" :value (h-size . nil) (const :tag "Select page width" h-size) (choice (const :tag "Use TeX default" nil) (string :tag "Width (must be valid TeX dimension)" "6in"))) (cons :tag "Vertical offset (top margin)" :value (voffset . nil) (const :tag "Select vertical offset (top margin)" voffset) (choice (const :tag "Use TeX default" nil) (string :tag "Vertical offset (must be valid TeX dimension)" "1in"))) (cons :tag "Horizontal offset (left margin)" :value (hoffset . nil) (const :tag "Select horizontal offset (left margin)" hoffset) (choice (const :tag "Use TeX default" nil) (string :tag "Horizontal offset (must be valid TeX dimension)" "1in"))) (cons :tag "Quad format height" :value (quad-vsize . "") (const :tag "Select height for quad format pages" quad-vsize) (string :tag "Height (must be valid TeX dimension)")) (cons :tag "Quad format width" :value (quad-hsize . "") (const :tag "Select width for quad format pages" quad-hsize) (string :tag "Width (must be valid TeX dimension)"))))) (defcustom bbdb-print-alist `((omit-area-code . ,(concat "^(" (if (integerp bbdb-default-area-code) (int-to-string bbdb-default-area-code) "000") ") ")) (phone-on-first-line . "^[ \t]*$") (ps-fonts . nil) (font-size . 6) (quad-hsize . "3.15in") (quad-vsize . "4.5in")) "Formatting options for `bbdb-print', all formats. This is an alist of the form ((option1 . value1) (option2 . value2) ...) You can have separate settings for brief and non-brief printouts; see the variables `bbdb-print-brief-alist' and `bbdb-print-full-alist'. Settings there will override the common settings in this variable. The possible options and legal values are: - columns: 1, 2, 3, 4 or 'quad (4 little 2-column pages per sheet) or 'grid (12 credit-card-sized pages per sheet). - separator: 0-7, the style of heading for each letter. 0=none, 1=line, 2=boxed letters, 3=large boxed letters, 4=large letters, 5=letters with lines, 6=letters with suits, 7=boxed letters with suits. - omit-area-code: a regular expression matching area codes to omit. - phone-on-first-line: t means to put first phone number on the same line with the name, nil means just the name. A string means to use the first phone number whose \"label\" matches that string, which should be a valid regular expression. - n-phones: maximum number of phone numbers to include. - n-addresses: maximum number of addresses to include. - include-files: list of TeX files to \\input. If these filenames are not absolute, the files must be located somewhere that TeX will find them. - ps-fonts: nonnil means to use them, nil to use standard TeX fonts. - font-size: in points, any integer (assuming fonts in that size exist). - hsize, vsize: horizontal dimension of pages. String value can be any valid TeX dimension, or nil to use TeX's default. - hoffset, voffset: shift TeX's output rightward (downward) by this distance (any TeX dimension). Nil or 0 uses TeX's default positioning. - quad-hsize, quad-vsize: for the quad format, horizontal and vertical size of the little pages. These must be strings which are valid TeX dimensions, eg \"10cm\"." :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget) (defcustom bbdb-print-full-alist '((columns . 3) (separator . 2) (include-files "bbdb-print" "bbdb-cols")) "Extra options for `bbdb-print' non-brief format. These supplement or override entries in `bbdb-print-alist'; see description of possible contents there." :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget) (defcustom bbdb-print-brief-alist '((columns . 1) (separator . 1) (n-phones . 2) (n-addresses . 1) (include-files "bbdb-print-brief" "bbdb-cols")) "Extra Options for `bbdb-print', brief format. These supplement or override entries in `bbdb-print-alist'; see description of possible contents there." :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget) (defcustom bbdb-print-prolog (concat "%%%% ====== Phone/Address list in -*-TeX-*- Format =====\n" "%%%% produced by bbdb-print, version 3.0\n\n") "TeX statements to include at the beginning of the `bbdb-print' file." :group 'bbdb-utilities-print :type '(text :format "%t:\n%v")) (defcustom bbdb-print-epilog "\\endaddresses\n\\bye\n" "TeX statements to include at the end of the `bbdb-print' file." :group 'bbdb-utilities-print :type '(text :format "%t:\n%v")) (defcustom bbdb-print-mail 'primary "Whether only the primary or all mail addresses are printed. Value `primary' means print the primary mail address only. Value `all' means print all mail addresses." :group 'bbdb-utilities-print :type '(choice (const primary) (const all))) (defcustom bbdb-print-tex-quote-alist '(("[#$%&_]" . "\\\\\\&") ("[<>=]+" . "$\\&$") ("[{}]" . "$\\\\\\&$") ("~" . "\\\\~{}")) "Replacement alist for quoting TeX's special characters. Each element is of the form (REGEXP . REPLACE)." :group 'bbdb-utilities-print) (defcustom bbdb-print-address-format-list bbdb-address-format-list "List of address formatting rules for printing. Each element may take the same values as in `bbdb-address-format-list'. The EDIT elements of `bbdb-address-format-list' are ignored." :group 'bbdb-utilities-print) (defcustom bbdb-print-name-format 'first-last "Format for names when printing BBDB. If first-last format names as \"Firstname Lastname\". If last-first format names as \"Lastname, Firstname\". If `bbdb-print-name' returns the full name as a single, preformatted string, this takes precedence over `bbdb-print-name-format'." :group 'bbdb-utilities-print :type '(choice (const :tag "Firstname Lastname" first-last) (const :tag "Lastname, Firstname" last-first))) (defcustom bbdb-print-name 'tex-name "Xfield holding the full print name for a record. This may also be a function taking one argument, a record. If it returns the full print name as a single string, this is used \"as is\". If it returns a cons pair (FIRST . LAST) with the first and last name for this record, these are formatted obeying `bbdb-print-name-format'. In any case, this function should call `bbdb-print-tex-quote' as needed." :group 'bbdb-utilities-print :type '(choice (symbol :tag "xfield") (function :tag "print name function"))) ;;; Functions: (defsubst bbdb-print-field-p (field) (not (memq field bbdb-print-omit-fields))) (defun bbdb-print-front-if (func list) "Move first elt of LIST satisfying predicate FUNC to front of LIST. The car of the returned list is the first element that returned nonnil; The cdr are all other elements of LIST. If FUNC returns nil for all elements of LIST, return nil." (cond ((null list) nil) ((funcall func (car list)) list) ((let ((rest (bbdb-print-front-if func (cdr list)))) (if rest (cons (car rest) (cons (car list) (cdr rest)))))))) (defun bbdb-print-firstn (n list force) "Return the first N elements of LIST. If N is nil, just return LIST. If FORCE is nonnil and LIST is shorter than N, extend the list to length N by adding nil's." ;; FORCE is needed by the `brief' format that is really a big table. ;; So we want to create output for the relevant fields of a record ;; even if these fields are empty. (cond ((null n) list) ((null list) (if force (make-list n nil) nil)) ((<= n 0) nil) (t (cons (car list) (bbdb-print-firstn (1- n) (cdr list) force))))) (defun bbdb-print-tex-quote (string) "Quote any unquoted TeX special characters that appear in STRING. The replacement rules are defined in `bbdb-print-tex-quote-alist'." (if string (dolist (quote bbdb-print-tex-quote-alist string) (setq string (replace-regexp-in-string (car quote) (cdr quote) string))) "")) ;;;###autoload (defun bbdb-print (records file brief) "Make a TeX FILE for printing RECORDS. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. With prefix BRIEF non-nil, make a brief (one line per record) printout. There are various variables for customizing the content and format of the printout, notably the variables `bbdb-print-alist' and `bbdb-print-require'." (interactive (list (bbdb-do-records) (read-file-name (format "Print to file (default %s): " (abbreviate-file-name bbdb-print-file)) (file-name-directory bbdb-print-file) bbdb-print-file) current-prefix-arg)) ;; Remember our choice for `bbdb-print-file'. (setq bbdb-print-file (expand-file-name file)) (let* ((alist (append (if brief bbdb-print-brief-alist bbdb-print-full-alist) bbdb-print-alist)) (psstring (if (cdr (assoc 'ps-fonts alist)) "ps" "")) (columns (cdr (assoc 'columns alist))) (current-letter t) (pofl (cdr (assoc 'phone-on-first-line alist))) (n-phones (cdr (assoc 'n-phones alist))) (n-addresses (cdr (assoc 'n-addresses alist)))) (find-file bbdb-print-file) (widen) (erase-buffer) (insert bbdb-print-prolog) (let (tmp) (dolist (dim '(hsize vsize hoffset voffset)) (if (setq tmp (cdr (assoc dim alist))) (insert (format "\\%s=%s\n" dim tmp)))) (dolist (file (cdr (assoc 'include-files alist))) (if (setq tmp (locate-file file bbdb-print-tex-path '(".tex" ""))) (progn ;; We use lisp `insert-file-contents' instead of TeX `\input' ;; because installing the respective files in the proper place ;; of a TeX installation can be tricky... (insert-file-contents tmp) (goto-char (point-max))) (error "File `%s' not found, check bbdb-print-tex-path" file)))) (insert (format "\n\\set%ssize{%d}\n" psstring (cdr (assoc 'font-size alist))) (format "\\setseparator{%d}\n" (cdr (assoc 'separator alist))) (cond ((eq 'quad columns) (format "\\quadformat{%s}{%s}" (cdr (assoc 'quad-hsize alist)) (cdr (assoc 'quad-vsize alist)))) ((eq 'grid columns) "\\grid") ((= 4 columns) "\\fourcol") ((= 3 columns) "\\threecol") ((= 2 columns) "\\twocol") ((= 1 columns) "\\onecol")) "\n\n\\beginaddresses\n") (dolist (record (bbdb-record-list records)) (setq current-letter (bbdb-print-record record current-letter brief pofl n-phones n-addresses))) (insert bbdb-print-epilog) (goto-char (point-min)))) (defun bbdb-print-record (record current-letter brief pofl n-phones n-addresses) "Insert the bbdb RECORD in TeX format in the current buffer. CURRENT-LETTER is the first letter of the sortkey of the previous record. If this is non-nil and RECORD begins differently, a section heading is output. If CURRENT-LETTER is t always produce a heading. BRIEF is non-nil for 1-line-per-record printouts. PHONE-ON-FIRST-LINE, N-PHONES, and N-ADDRESSES are the respective values from `bbdb-print-alist'. The return value is the new CURRENT-LETTER." (let ((first-letter (substring (concat (bbdb-record-sortkey record) "?") 0 1)) (name (cond ((functionp bbdb-print-name) (let ((value (funcall bbdb-print-name record))) (cond ((stringp value) value) ((eq bbdb-print-name-format 'first-last) (bbdb-concat 'name-first-last (car value) (cdr value))) (t (bbdb-concat 'name-last-first (cdr value) (car value)))))) ((bbdb-record-xfield record bbdb-print-name)) ((eq bbdb-print-name-format 'first-last) (bbdb-print-tex-quote (bbdb-record-name record))) (t (bbdb-print-tex-quote (bbdb-record-name-lf record))))) (organization (bbdb-record-organization record)) (affix (bbdb-record-affix record)) (mail (bbdb-record-mail record)) (phone (bbdb-record-phone record)) (address (bbdb-record-address record)) (xfields (bbdb-record-xfields record)) (bbdb-address-format-list bbdb-print-address-format-list)) (when (eval bbdb-print-require) ;; Insert section header, if neccessary. (if (or (eq current-letter t) (not (string-equal first-letter current-letter))) (insert (format "%s\\separator{%s}\n%%\n" (if brief "" "\\goodbreak\n") (bbdb-print-tex-quote (upcase first-letter))))) (insert "\\beginrecord\n" (format "\\firstline{%s}{%s}\n" (cond (name) ;; if there is no name, use organization instead (organization (prog1 (bbdb-print-tex-quote (bbdb-concat 'organization organization)) (setq organization nil))) (t "")) ;; Possibly put one phone number next to name (cond ((null phone) "") ((eq t pofl) (prog1 (bbdb-print-phone (car phone)) (setq phone (cdr phone)))) ((stringp pofl) (let ((p (bbdb-print-front-if (lambda (ph) (string-match pofl (aref ph 0))) phone))) (if p (prog1 (bbdb-print-phone (car p)) (setq phone (cdr p))) ""))) (t "")))) (if (and organization (bbdb-print-field-p 'organization)) (insert (format "\\comp{%s}\n" (bbdb-print-tex-quote (bbdb-concat 'organization organization))))) ;; Phone numbers (if n-phones (setq phone (bbdb-print-firstn (- n-phones (if pofl 1 0)) phone brief))) (dolist (ph phone) (if (and ph (bbdb-print-field-p 'phone)) (insert (format "\\phone{%s%s}\n" (bbdb-print-tex-quote (if (or (not (aref ph 0)) (equal "" (aref ph 0))) "" (concat (aref ph 0) ": "))) (bbdb-print-phone ph))) (insert "\\phone{}\n"))) ;; needed for brief format ;; Mail address (when (and mail (bbdb-print-field-p 'mail)) (insert (format "\\email{%s}\n" (mapconcat (lambda (mail) ;; Make all dots legal line-breaks. (replace-regexp-in-string "\\." ".\\\\-" (bbdb-print-tex-quote mail))) (cond ((eq bbdb-print-mail 'primary) (list (car mail))) ((eq bbdb-print-mail 'all) mail)) ", ")))) ;; Addresses. FUTURE: If none left, should use phones instead. (if n-addresses (setq address (bbdb-print-firstn n-addresses address nil))) (if (and address (bbdb-print-field-p 'address)) (dolist (a address) (insert "\\address{" (replace-regexp-in-string "\n" (if brief ", " "\\\\\\\\\n") (bbdb-print-tex-quote (bbdb-format-address a 2))) "}\n")) (insert "\\address{}\n")) ;; needed for brief format ;; xfields (dolist (xfield xfields) (when (bbdb-print-field-p (car xfield)) (if (eq 'notes (car xfield)) (insert (format "\\notes{%s}\n" (bbdb-print-tex-quote (cdr xfield)))) (insert (format "\\note{%s}{%s}\n" (bbdb-print-tex-quote (symbol-name (car xfield))) (bbdb-print-tex-quote (cdr xfield))))))) ;; Mark end of the record. (insert "\\endrecord\n%\n") (setq current-letter first-letter))) current-letter) (defun bbdb-print-phone (phone) "Format PHONE as a string, obeying omit-area-code setting. Omit-area-code is one of the allowed symbols in `bbdb-print-alist'." (let ((str (bbdb-phone-string phone)) (omit (cdr (assoc 'omit-area-code bbdb-print-alist)))) (bbdb-print-tex-quote (if (and omit (string-match omit str)) (substring str (match-end 0)) str)))) (provide 'bbdb-print) ;;; bbdb-print ends here. bbdb-3.1.2/lisp/bbdb-snarf.el0000644000175000017500000003316612261714073012634 00000000000000;;; bbdb-snarf.el -- convert free-form text to BBDB records ;; Copyright (C) 1997 John Heidemann ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; The commands `bbdb-snarf', `bbdb-snarf-yank' and `bbdb-snarf-paragraph' ;;; create BBDB records by picking the name, addresses, phones, etc. ;;; out of a (buffer) string. Things are recognized by context (e.g., URLs ;;; start with http:// or www.). See `bbdb-snarf-rule-alist' for details. ;;; ;;; Currently this code is much biased towards the US. Hopefully, ;;; the concept of customizable rules allows you to develop new rules ;;; suitable for other parts of the world, too. Please let me know ;;; if you get such rules working. ;;; `mail' is a simple rule that can pick a single address from, say, ;;; a long list of mail addresses in a message. ;;; ;;; RW: `bbdb-snarf' is an interesting proof of concept. Yet I find ;;; its snarfing algorithms too simplistic to be useful in real life. ;;; How can this possibly be improved? Suggestions welcome. (require 'bbdb-com) (defcustom bbdb-snarf-rule-alist '((us bbdb-snarf-surrounding-space bbdb-snarf-phone-nanp bbdb-snarf-url bbdb-snarf-mail bbdb-snarf-empty-lines bbdb-snarf-name bbdb-snarf-address-us bbdb-snarf-empty-lines bbdb-snarf-notes bbdb-snarf-name-mail) (mail bbdb-snarf-mail-address)) "Alist of rules for snarfing. Each rule is of the form (KEY FUNCTION FUNCTION ...). The symbol KEY identifies the rule, see also `bbdb-snarf-rule-default'. Snarfing is a cumulative process. The text is copied to a snarf buffer that becomes current during snarfing. Each FUNCTION is called with one arg, the RECORD we are snarfing, and with point at the beginning of the snarf buffer. FUNCTION should populate the fields of RECORD. It may delete the part of the snarf buffer that it has processed so that the remaining FUNCTIONs operate only on those parts that were not yet snarfed. The order of the FUNCTION calls in a rule is then crucial. Unlike other parts of BBDB, FUNCTIONs need not update the cache and hash table for RECORD which is done at the end by `bbdb-snarf'." :group 'bbdb-utilities-snarf :type '(repeat (cons (symbol :tag "Key") (repeat (function :tag "Snarf function"))))) (defcustom bbdb-snarf-rule-default 'us "Default rule for snarfing." :group 'bbdb-utilities-snarf :type 'symbol) (defcustom bbdb-snarf-name-regexp "^[ \t'\"]*\\([- .,[:word:]]*[[:word:]]\\)" "Regexp matching a name. Case is ignored. The first subexpression becomes the name." :group 'bbdb-utilities-snarf :type 'regexp) (defcustom bbdb-snarf-phone-nanp-regexp (concat "\\(([2-9][0-9][0-9])[-. ]?\\|[2-9][0-9][0-9][-. ]\\)?" "[0-9][0-9][0-9][-. ][0-9][0-9][0-9][0-9]" "\\( *\\(x\\|ext\\.?\\) *[0-9]+\\)?") "Regexp matching a NANP phone number. Case is ignored. NANP is the North American Numbering Plan used in North and Central America." :group 'bbdb-utilities-snarf :type 'regexp) (defcustom bbdb-snarf-postcode-us-regexp (concat "\\<[0-9][0-9][0-9][0-9][0-9]" "\\(-[0-9][0-9][0-9][0-9]\\)?" "\\>$") "Regexp matching US postcodes." :group 'bbdb-utilities-snarf :type 'regexp) (defcustom bbdb-snarf-default-label-alist '((phone . "work") (address . "work")) "Default labels for snarfing. This is an alist where each element is a cons pair (FIELD . LABEL). The symbol FIELD denotes a record field like `phone' or `address'. The string LABEL denotes the default label for FIELD." :group 'bbdb-utilities-snarf :type '(repeat (cons (symbol :tag "Field") (string :tag "Label")))) (defcustom bbdb-snarf-url 'url "What xfield BBDB should use for URLs, or nil to not snarf URLs." :group 'bbdb-utilities-snarf :type 'symbol) (defcustom bbdb-snarf-url-regexp "\\(http://\\|www\.\\)[^ \t\n]+" "Regexp matching a URL. Case is ignored." :group 'bbdb-utilities-snarf :type 'regexp) (defun bbdb-snarf-surrounding-space (record) "Discard beginning and trailing space when snarfing RECORD." (while (re-search-forward "^[ \t]+" nil t) (replace-match "")) (goto-char (point-min)) (while (re-search-forward "\\s-+$" nil t) (replace-match ""))) (defun bbdb-snarf-empty-lines (record) "Discard empty lines when snarfing RECORD." (while (re-search-forward "^[ \t]*\n" nil t) (replace-match ""))) (defun bbdb-snarf-name (record) "Snarf name for RECORD." (if (and (not (bbdb-record-lastname record)) (let ((case-fold-search t)) (re-search-forward bbdb-snarf-name-regexp nil t))) (let ((name (match-string 1))) (replace-match "") (setq name (bbdb-divide-name name)) (bbdb-record-set-firstname record (car name)) (bbdb-record-set-lastname record (cdr name))))) (defun bbdb-snarf-name-mail (record) "Snarf name from mail address for RECORD." (let ((name (bbdb-record-lastname record))) (when (and (not name) (bbdb-record-mail record) (setq name (car (bbdb-extract-address-components (car (bbdb-record-mail record))))) (setq name (bbdb-divide-name name))) (bbdb-record-set-firstname record (car name)) (bbdb-record-set-lastname record (cadr name))))) (defun bbdb-snarf-mail-address (record) "Snarf name and mail address for RECORD." ;; The voodoo of `mail-extract-address-components' makes ;; the following quite powerful. If this function is used as part of ;; a more complex rule, the buffer should be narrowed appropriately. (let* ((data (bbdb-extract-address-components (buffer-string))) (name (and (car data) (bbdb-divide-name (car data))))) (bbdb-record-set-firstname record (car name)) (bbdb-record-set-lastname record (cdr name)) (bbdb-record-set-mail record (list (cadr data))) (delete-region (point-min) (point-max)))) (defun bbdb-snarf-label (field) "Extract the label before point, or return default label for FIELD." (if (looking-back "[\n,:]\\([^\n,:]+\\):[ \t]*") (prog1 (match-string 1) (delete-region (match-beginning 1) (match-end 0))) (cdr (assq field bbdb-snarf-default-label-alist)))) (defun bbdb-snarf-phone-nanp (record) "Snarf NANP Phone Numbers for RECORD. NANP is the North American Numbering Plan used in North and Central America." (let ((case-fold-search t) phones) (while (re-search-forward bbdb-snarf-phone-nanp-regexp nil t) (let ((begin (match-beginning 0)) (end (match-end 0))) (goto-char begin) (forward-char -1) (if (looking-at "[0-9A-Z]") ;; not really a phone number (goto-char end) (let ((number (bbdb-parse-phone (buffer-substring begin end)))) (delete-region begin end) (push (vconcat (list (bbdb-snarf-label 'phone)) number) phones))))) (bbdb-record-set-phone record (nconc (bbdb-record-phone record) phones)))) (defun bbdb-snarf-mail (record) "Snarf mail addresses for RECORD." (let (mails) (while (re-search-forward "[^ \t\n<]+@[^ \t\n>]+" nil t) (push (match-string 0) mails) (replace-match "")) (bbdb-record-set-mail record (nconc (bbdb-record-mail record) mails)))) (defun bbdb-snarf-streets (address) "Snarf streets for ADDRESS. This assumes a narrowed region." (bbdb-address-set-streets address (bbdb-split "\n" (buffer-string))) (delete-region (point-min) (point-max))) (defun bbdb-snarf-address-us (record) "Snarf a US address for RECORD." (let ((address (make-vector bbdb-address-length nil))) (cond ((re-search-forward bbdb-snarf-postcode-us-regexp nil t) ;; Streets, City, State Postcode (save-restriction (narrow-to-region (point-min) (match-end 0)) ;; Postcode (goto-char (match-beginning 0)) (bbdb-address-set-postcode address (bbdb-parse-postcode (match-string 0))) ;; State (skip-chars-backward " \t") (let ((pos (point))) (skip-chars-backward "^ \t,") (bbdb-address-set-state address (buffer-substring (point) pos))) ;; City (skip-chars-backward " \t,") (let ((pos (point))) (beginning-of-line) (bbdb-address-set-city address (buffer-substring (point) pos))) ;; Toss it (forward-char -1) (delete-region (point) (point-max)) ;; Streets (goto-char (point-min)) (bbdb-snarf-streets address))) ;; Try for just Streets, City, State ((let (case-fold-search) (re-search-forward "^\\(.*\\), \\([A-Z][A-Za-z]\\)$" nil t)) (bbdb-address-set-city address (match-string 1)) (bbdb-address-set-state address (match-string 2)) (replace-match "") (save-restriction (narrow-to-region (point-min) (match-beginning 0)) (goto-char (point-min)) (bbdb-snarf-streets address)))) ;; Fixme: There are no labels anymore. `bbdb-snarf-streets' snarfed ;; everything that was left! (bbdb-address-set-label address (bbdb-snarf-label 'address)) (bbdb-record-set-address record (nconc (bbdb-record-address record) (list address))))) (defun bbdb-snarf-url (record) "Snarf URL for RECORD." (when (and bbdb-snarf-url (let ((case-fold-search t)) (re-search-forward bbdb-snarf-url-regexp nil t))) (bbdb-record-set-xfields record (nconc (bbdb-record-xfields record) (list (cons bbdb-snarf-url (match-string 0))))) (replace-match ""))) (defun bbdb-snarf-notes (record) "Snarf notes for RECORD." (when (/= (point-min) (point-max)) (bbdb-record-set-xfields record (nconc (bbdb-record-xfields record) (list (cons bbdb-default-xfield (buffer-string))))) (erase-buffer))) (defsubst bbdb-snarf-rule-interactive () "Read snarf rule interactively." (intern (completing-read (format "Rule: (default `%s') " bbdb-snarf-rule-default) bbdb-snarf-rule-alist nil t nil nil (symbol-name bbdb-snarf-rule-default)))) ;;;###autoload (defun bbdb-snarf-paragraph (pos &optional rule) "Snarf BBDB record from paragraph around position POS using RULE. The paragraph is the one that contains POS or follows POS. Interactively POS is the position of point. RULE defaults to `bbdb-snarf-rule-default'. See `bbdb-snarf-rule-alist' for details." (interactive (list (point) (bbdb-snarf-rule-interactive))) (bbdb-snarf (save-excursion (goto-char pos) ;; similar to `mark-paragraph' (let ((end (progn (forward-paragraph 1) (point)))) (buffer-substring-no-properties (progn (backward-paragraph 1) (point)) end))) rule)) ;;;###autoload (defun bbdb-snarf-yank (&optional rule) "Snarf a BBDB record from latest kill using RULE. The latest kill may also be a window system selection, see `current-kill'. RULE defaults to `bbdb-snarf-rule-default'. See `bbdb-snarf-rule-alist' for details." (interactive (list (bbdb-snarf-rule-interactive))) (bbdb-snarf (current-kill 0) rule)) ;;;###autoload (defun bbdb-snarf (string &optional rule) "Snarf a BBDB record in STRING using RULE. Return this record. Interactively, STRING is the current region. RULE defaults to `bbdb-snarf-rule-default'. See `bbdb-snarf-rule-alist' for details." (interactive (list (buffer-substring-no-properties (region-beginning) (region-end)) (bbdb-snarf-rule-interactive))) (bbdb-editable) (let ((record (bbdb-empty-record))) (with-current-buffer (get-buffer-create " *BBDB Snarf*") (erase-buffer) (insert (substring-no-properties string)) (mapc (lambda (fun) (goto-char (point-min)) (funcall fun record)) (cdr (assq (or rule bbdb-snarf-rule-default) bbdb-snarf-rule-alist)))) (let ((old-record (car (bbdb-message-search (bbdb-concat 'name-first-last (bbdb-record-firstname record) (bbdb-record-lastname record)) (car (bbdb-record-mail record)))))) (if old-record (bbdb-merge-records old-record record) ;; create new record (bbdb-change-record record t t) (bbdb-display-records (list record)) record)))) ;; Some test cases ;; ;; another test person ;; 1234 Gridley St. ;; Los Angeles, CA 91342 ;; 555-1212 ;; test@person.net ;; http://www.foo.bar/ ;; other stuff about this person ;; ;; test person ;; 1234 Gridley St. ;; St. Los Angeles, CA 91342-1234 ;; 555-1212 ;; test@person.net ;; ;; x test person ;; 1234 Gridley St. ;; Los Angeles, California 91342-1234 ;; work: 555-1212 ;; home: 555-1213 ;; test@person.net ;; ;; y test person ;; 1234 Gridley St. ;; Los Angeles, CA ;; 555-1212 ;; test@person.net (provide 'bbdb-snarf) bbdb-3.1.2/lisp/bbdb-pkg.el.in0000644000175000017500000000015112241571322012671 00000000000000(define-package "@PACKAGE_NAME@" "@PACKAGE_VERSION@" "The Insidious Big Brother Database for GNU Emacs") bbdb-3.1.2/lisp/bbdb-message.el0000644000175000017500000001004512261714073013136 00000000000000;;; bbdb-message.el --- BBDB interface to Mail Composition Packages. ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains the BBDB interface to Mail Composition Packages. ;;; See the BBDB info manual for documentation. (require 'bbdb) (require 'message) (require 'sendmail) (defcustom bbdb/message-update-records-p 'bbdb-select-message "How `bbdb-mua-update-records' processes mail addresses in outgoing messages. This MUA-specific variable is normally not used. It is a fallback if the generic (MUA-independent) variables `bbdb-mua-auto-update-p', `bbdb-update-records-p' or `bbdb-mua-update-interactive-p' result in a value of nil for the arg UPDATE-P of `bbdb-update-records'. Allowed values are: nil Do nothing. search Search for existing records. update Search for existing records, update if necessary. query Update existing records or query for creating new ones. create or t Update existing records or create new ones. a function This functions will be called with no arguments. It should return one of the above values." :group 'bbdb-mua-message :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" (lambda () (let ((bbdb-update-records-p 'search)) (bbdb-select-message)))) (const :tag "update existing records" (lambda () (let ((bbdb-update-records-p 'update)) (bbdb-select-message)))) (const :tag "query annotation of all messages" (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message)))) (const :tag "annotate all messages" (lambda () (let ((bbdb-update-records-p 'create)) (bbdb-select-message)))) (const :tag "accept messages" bbdb-accept-message) (const :tag "ignore messages" bbdb-ignore-message) (const :tag "select messages" bbdb-select-message) (sexp :tag "user defined function"))) (defvaralias 'bbdb/mail-update-records-p 'bbdb/message-update-records-p) ;;;###autoload (defun bbdb-insinuate-message () "Hook BBDB into Message Mode. Do not call this in your init file. Use `bbdb-initialize'." ;; Suggestions welcome: What are good keybindings for the following ;; commands that do not collide with existing bindings? ;; (define-key message-mode-map "'" 'bbdb-mua-display-recipients) ;; (define-key message-mode-map ";" 'bbdb-mua-edit-field-recipients) ;; (define-key message-mode-map "/" 'bbdb) (if bbdb-complete-mail (define-key message-mode-map "\M-\t" 'bbdb-complete-mail))) ;;;###autoload (defun bbdb-insinuate-mail () "Hook BBDB into Mail Mode. Do not call this in your init file. Use `bbdb-initialize'." ;; Suggestions welcome: What are good keybindings for the following ;; commands that do not collide with existing bindings? ;; (define-key mail-mode-map "'" 'bbdb-mua-display-recipients) ;; (define-key mail-mode-map ";" 'bbdb-mua-edit-field-recipients) ;; (define-key mail-mode-map "/" 'bbdb) (if bbdb-complete-mail (define-key mail-mode-map "\M-\t" 'bbdb-complete-mail))) (provide 'bbdb-message) bbdb-3.1.2/lisp/bbdb-anniv.el0000644000175000017500000002075112261714072012631 00000000000000;;; bbdb-anniv.el --- get anniversaries from BBDB ;; Copyright (C) 2011-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;; Anniversaries are stored in xfields as defined via `bbdb-anniv-alist'. ;; Each such field may contain multiple anniversaries entries with separators ;; defined via `bbdb-separator-alist' (newlines by default). ;; Each anniversary entry is a string DATE followed by optional TEXT. ;; DATE may take the same format as the date of ordinary diary entries. ;; In particular, `calendar-date-style' is obeyed via `diary-date-forms'. ;; If `bbdb-anniv-alist' has a non-nil FORM for this type of anniversary, ;; FORM is used to display the anniversary entry in the diary buffer. ;; If FORM is nil, TEXT is used instead to display the anniversary entry ;; in the diary buffer. ;; ;; To display BBDB anniversaries in the Emacs diary, ;; call `bbdb-initialize' with arg `anniv'. ;; ;; See the BBDB info manual for documentation. (require 'bbdb) (require 'bbdb-com) (require 'diary-lib) (defcustom bbdb-anniv-alist '((birthday . "%n's %d%s birthday") (wedding . "%n's %d%s wedding anniversary") (anniversary)) "Alist of rules for formatting anniversaries in the diary buffer. Each element is of the form (LABEL . FORM). LABEL is the xfield where this type of anniversaries is stored. FORM is a format string with the following substitutions: %n name of the record %d number of years %s ordinal suffix (st, nd, rd, th) for the year. %t the optional text following the date string in field LABEL. If FORM is nil, use the text following the date string in field LABEL as format string." :type '(repeat (cons :tag "Rule" (symbol :tag "Label") (choice (regexp) (const nil)))) :group 'bbdb-utilities-anniv) ;; `bbdb-anniv-diary-entries' becomes a member of `diary-list-entries-hook'. ;; When this hook is run by `diary-list-entries', the variable `original-date' ;; is bound to the value of arg DATE of `diary-list-entries'. ;; Also, `number' is arg NUMBER of `diary-list-entries'. ;; `diary-list-entries' selects the entries for NUMBER days starting with DATE. (defvar original-date) ; defined in diary-lib (with-no-warnings (defvar number)) ; defined in diary-lib ;;;###autoload (defun bbdb-anniv-diary-entries () "Add anniversaries from BBDB records to `diary-list-entries'. This obeys `calendar-date-style' via `diary-date-forms'. To enable this feature, put the following into your .emacs: \(add-hook 'diary-list-entries-hook 'bbdb-anniv-diary-entries)" ;; Loop over NUMBER dates starting from ORGINAL-DATE. (let* ((num-date (1- (calendar-absolute-from-gregorian original-date))) (end-date (+ num-date number))) (while (<= (setq num-date (1+ num-date)) end-date) (let* ((date (calendar-gregorian-from-absolute num-date)) ;; The following variables may be used by `diary-date-forms'. (day (calendar-extract-day date)) (month (calendar-extract-month date)) (current-year (calendar-extract-year date)) (non-leap (and (= month 3) (= day 1) (not (calendar-leap-year-p current-year)))) (dayname (format "%s\\|%s\\.?" (calendar-day-name date) (calendar-day-name date 'abbrev))) (monthname (format "%s\\|%s" (calendar-month-name month) (calendar-month-name month 'abbrev))) (day (format "0*%d" day)) (month (format "0*%d" month)) ;; We could use an explicitly numbered group to match the year. ;; This requires emacs 23. (year "\\([0-9]+\\)\\|\\*") date-forms) (dolist (date-form diary-date-forms) ;; Require that the matched date is at the beginning of the string. ;; Use shy groups so that we can grab the year more easily. (push (cons (format "\\`%s?\\(?:%s\\)" (regexp-quote diary-nonmarking-symbol) (mapconcat 'eval (if (eq (car date-form) 'backup) (cdr date-form) date-form) "\\)\\(?:")) (eq (car date-form) 'backup)) date-forms)) ;; The anniversary of February 29 is considered to be March 1 ;; in non-leap years. So we search for February 29, too. (when non-leap (let* ((day "0*29") (month "0*2") (monthname (format "%s\\|%s" (calendar-month-name 2) (calendar-month-name 2 'abbrev)))) (dolist (date-form diary-date-forms) (push (cons (format "\\`%s?\\(?:%s\\)" (regexp-quote diary-nonmarking-symbol) (mapconcat 'eval (if (eq (car date-form) 'backup) (cdr date-form) date-form) "\\)\\(?:")) (eq (car date-form) 'backup)) date-forms)))) (dolist (record (bbdb-records)) (dolist (rule bbdb-anniv-alist) (dolist (anniv (bbdb-record-xfield-split record (car rule))) (let ((date-forms date-forms) (anniv-string (concat anniv " X")) ; for backup forms (case-fold-search t) form yy text) (while (setq form (pop date-forms)) (when (string-match (car form) anniv-string) (setq date-forms nil yy (match-string 1 anniv-string) yy (if (and yy (string-match-p "[0-9]+" yy)) (- current-year (string-to-number yy)) 100) ; as in `diary-anniversary' ;; For backup forms we should search backward in ;; anniv-string from (match-end 0) for "\\<". ;; That gets too complicated here! ;; Yet for the default value of `diary-date-forms' ;; this would matter only if anniv-string started ;; with a time. That is rather rare for anniversaries. ;; Then we may simply step backward by one character. text (substring anniv-string (if (cdr form) ; backup (1- (match-end 0)) (match-end 0)) -1) text (replace-regexp-in-string "\\`[ \t]+" "" text) text (replace-regexp-in-string "[ \t]+\\'" "" text)) (if (cdr rule) (setq text (replace-regexp-in-string "%t" text (cdr rule)))))) ;; Add the anniversaries to `diary-entries-list'. (if (and yy (> yy 0) (< 0 (length text))) (diary-add-to-list date (format ;; Text substitution similar to `diary-anniversary'. (replace-regexp-in-string "%n" (bbdb-record-name record) text) yy (diary-ordinal-suffix yy)) ;; It would be nice to have a SPECIFIER that allowed us to jump ;; from the diary display buffer to the respective BBDB record. ;; Yet it seems that diary-lib does not support this for us. ;; So we use instead an empty string. When clicking on the ;; anniversary entry in the diary display buffer, this give us ;; the message "Unable to locate this diary entry". "")))))))))) (provide 'bbdb-anniv) bbdb-3.1.2/lisp/bbdb-com.el0000644000175000017500000034564012322071003012267 00000000000000;;; bbdb-com.el --- user-level commands of BBDB ;; Copyright (C) 1991, 1992, 1993 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains most of the user-level interactive commands for BBDB. ;;; See the BBDB info manual for documentation. (require 'bbdb) (require 'mailabbrev) (eval-and-compile (autoload 'build-mail-aliases "mailalias") (autoload 'browse-url-url-at-point "browse-url")) (require 'crm) (defvar bbdb-crm-local-completion-map (let ((map (make-sparse-keymap))) (set-keymap-parent map crm-local-completion-map) (define-key map " " 'self-insert-command) map) "Keymap used for BBDB crm completions.") (defun bbdb-get-records (prompt) "If inside the *BBDB* buffer get the current records. In other buffers ask the user." (if (string= bbdb-buffer-name (buffer-name)) (bbdb-do-records) (bbdb-completing-read-records prompt))) ;; Note about the arg RECORDS of various BBDB commands: ;; - Usually, RECORDS is a list of records. (Interactively, ;; this list of records is set up by `bbdb-do-records'.) ;; - If these commands are used, e.g., in `bbdb-create-hook' or ;; `bbdb-change-hook', they will be called with one arg, a single record. ;; So depending on context the value of RECORDS will be a single record ;; or a list of records, and we want to handle both cases. ;; So we pass RECORDS to `bbdb-record-list' to handle both cases. (defun bbdb-record-list (records &optional full) "Ensure that RECORDS is a list of records. If RECORDS is a single record turn it into a list. If FULL is non-nil, assume that RECORDS include display information." (if records (if full (if (vectorp (car records)) (list records) records) (if (vectorp records) (list records) records)))) ;; Note about BBDB prefix commands: ;; - `bbdb-do-all-records' behaves more like a proper prefix command ;; in the sense that it must immediately precede the main command. ;; YET: a simple M-x makes the prefix go away... ;; - `bbdb-append-display' and `bbdb-search-invert' are fake prefix ;; commands. They need not precede the main commands. ;; Also, `bbdb-append-display' can act on multiple commands. ;; FIXME: Make this more uniform and robust. ;;;###autoload (defun bbdb-do-all-records () "Command prefix for operating on all records currently displayed. This only works for certain commands." (interactive) (message (substitute-command-keys "\\\\[bbdb-do-all-records]")) (setq prefix-arg current-prefix-arg last-command this-command)) ;;;###autoload (defun bbdb-do-records (&optional full) "Return list of records to operate on. Normally this list includes only the current record. It includes all currently displayed records if the command prefix \ \\\\[bbdb-do-all-records] is used. If FULL is non-nil, the list of records includes display information." (if (eq last-command 'bbdb-do-all-records) (if full bbdb-records (mapcar 'car bbdb-records)) (list (bbdb-current-record full)))) ;;;###autoload (defun bbdb-append-display-p () "Return variable `bbdb-append-display' and reset." (let ((job (cond ((eq t bbdb-append-display)) ((numberp bbdb-append-display) (setq bbdb-append-display (1- bbdb-append-display)) (if (zerop bbdb-append-display) (setq bbdb-append-display nil)) t) (bbdb-append-display (setq bbdb-append-display nil) t)))) (cond ((numberp bbdb-append-display) (aset bbdb-modeline-info 0 (format "(add %dx)" bbdb-append-display))) ((not bbdb-append-display) (aset bbdb-modeline-info 0 nil))) job)) ;;;###autoload (defun bbdb-append-display (&optional arg) "Toggle appending next searched records in the *BBDB* buffer. With prefix ARG \\[universal-argument] always append. With ARG a positive number append for that many times. With ARG a negative number do not append." (interactive "P") (setq bbdb-append-display (cond ((and arg (listp arg)) t) ((and (numberp arg) (< 1 arg)) arg) ((or (and (numberp arg) (< arg 0)) bbdb-append-display) nil) (t 'once))) (aset bbdb-modeline-info 0 (cond ((numberp bbdb-append-display) (format "(add %dx)" bbdb-append-display)) ((eq t bbdb-append-display) "Add") (bbdb-append-display "add") (t nil))) (aset bbdb-modeline-info 2 (if bbdb-append-display (substitute-command-keys "\\\\[bbdb-append-display]"))) (let ((msg (bbdb-concat " " (elt bbdb-modeline-info 2) (elt bbdb-modeline-info 3)))) (unless (string= "" msg) (message "%s" msg)))) (defsubst bbdb-layout-prefix () "Set the LAYOUT arg interactively using the prefix arg." (cond ((eq current-prefix-arg 0) 'one-line) (current-prefix-arg 'multi-line) (t bbdb-layout))) (defun bbdb-search-invert-p () "Return variable `bbdb-search-invert' and set it to nil. To set it again, use command `bbdb-search-invert'." (let ((result bbdb-search-invert)) (setq bbdb-search-invert nil) (aset bbdb-modeline-info 1 nil) (aset bbdb-modeline-info 3 nil) result)) ;;;###autoload (defun bbdb-search-invert (&optional arg) "Toggle inversion of the next search command. With prefix ARG a positive number, invert next search. With prefix ARG a negative number, do not invert next search." (interactive "P") (if (setq bbdb-search-invert (or (and (numberp arg) (< 0 arg)) (and (not (numberp arg)) (not bbdb-search-invert)))) (progn (aset bbdb-modeline-info 1 "inv") (aset bbdb-modeline-info 3 (substitute-command-keys "\\\\[bbdb-search-invert]"))) (aset bbdb-modeline-info 1 nil) (aset bbdb-modeline-info 3 nil)) (message "%s" (bbdb-concat " " (elt bbdb-modeline-info 2) (elt bbdb-modeline-info 3)))) (defmacro bbdb-search (records &optional name-re org-re mail-re xfield-re phone-re address-re) "Search RECORDS for fields matching regexps. Regexp NAME-RE is matched against FIRST_LAST, LAST_FIRST, and AKA. Regexp XFIELD-RE is matched against xfield notes. XFIELD-RE may also be a cons (LABEL . RE). Then RE is matched against xfield LABEL. If LABEL is '* then RE is matched against any xfield. This macro only generates code for those fields actually being searched for; literal nils at compile-time cause no code to be generated. To reverse the search, bind variable `bbdb-search-invert' to t. See also `bbdb-message-search' for fast searches using `bbdb-hashtable' but not allowing for regexps." (let (clauses) ;; I did not protect these vars from multiple evaluation because that ;; actually generates *less efficient code* in elisp, because the extra ;; bindings cannot easily be optimized away without lexical scope. fmh. (or (stringp name-re) (symbolp name-re) (error "name-re must be atomic")) (or (stringp org-re) (symbolp org-re) (error "org-re must be atomic")) (or (stringp mail-re) (symbolp mail-re) (error "mail-re must be atomic")) (or (stringp xfield-re) (symbolp xfield-re) (consp xfield-re) (error "xfield-re must be atomic or cons")) (or (stringp phone-re) (symbolp phone-re) (error "phone-re must be atomic")) (or (stringp address-re) (symbolp address-re) (error "address-re must be atomic")) (when name-re (push `(string-match ,name-re (or (bbdb-record-name record) "")) clauses) (push `(string-match ,name-re (or (bbdb-record-name-lf record) "")) clauses) (push `(let ((akas (bbdb-record-field record 'aka-all)) aka done) (while (and (setq aka (pop akas)) (not done)) (setq done (string-match ,name-re aka))) done) clauses)) (if org-re (push `(let ((organizations (bbdb-record-organization record)) org done) (if organizations (while (and (setq org (pop organizations)) (not done)) (setq done (string-match ,org-re org))) ;; so that "^$" can be used to find records that ;; have no organization (setq done (string-match ,org-re ""))) done) clauses)) (if phone-re (push `(let ((phones (bbdb-record-phone record)) ph done) (if phones (while (and (setq ph (pop phones)) (not done)) (setq done (string-match ,phone-re (bbdb-phone-string ph)))) ;; so that "^$" can be used to find records that ;; have no phones (setq done (string-match ,phone-re ""))) done) clauses)) (if address-re (push `(let ((addresses (bbdb-record-address record)) a done) (if addresses (while (and (setq a (pop addresses)) (not done)) (setq done (string-match ,address-re (bbdb-format-address a 2)))) ;; so that "^$" can be used to find records that ;; have no addresses. (setq done (string-match ,address-re ""))) done) clauses)) (if mail-re (push `(let ((mails (bbdb-record-mail record)) (bbdb-case-fold-search t) ; there is no case for mails m done) (if mails (while (and (setq m (pop mails)) (not done)) (setq done (string-match ,mail-re m))) ;; so that "^$" can be used to find records that ;; have no mail addresses. (setq done (string-match ,mail-re ""))) done) clauses)) (if xfield-re (push `(cond ((stringp ,xfield-re) ;; check xfield `bbdb-default-xfield' (string-match ,xfield-re (or (bbdb-record-xfield record bbdb-default-xfield) ""))) ((eq (car ,xfield-re) '*) ;; check all xfields (let ((labels bbdb-xfield-label-list) done tmp) (if (bbdb-record-xfields record) (while (and (not done) labels) (setq tmp (bbdb-record-xfield record (car labels)) done (and tmp (string-match (cdr ,xfield-re) tmp)) labels (cdr labels))) ;; so that "^$" can be used to find records that ;; have no notes (setq done (string-match (cdr ,xfield-re) ""))) done)) (t ; check one field (string-match (cdr ,xfield-re) (or (bbdb-record-xfield record (car ,xfield-re)) "")))) clauses)) `(let ((case-fold-search bbdb-case-fold-search) (invert (bbdb-search-invert-p)) matches) (dolist (record ,records) (unless (eq (not invert) (not (or ,@clauses))) (push record matches))) (nreverse matches)))) (defun bbdb-search-read (&optional field) "Read regexp to search FIELD values of records." (read-string (format "Search records%s %smatching regexp: " (if field (concat " with " field) "") (if bbdb-search-invert "not " "")))) ;;;###autoload (defun bbdb (regexp &optional layout) "Display all records in the BBDB matching REGEXP in either the name(s), organization, address, phone, mail, or xfields." (interactive (list (bbdb-search-read) (bbdb-layout-prefix))) (let ((records (bbdb-search (bbdb-records) regexp regexp regexp (cons '* regexp) regexp regexp))) (if records (bbdb-display-records records layout nil t) (message "No records matching '%s'" regexp)))) ;;;###autoload (defun bbdb-search-name (regexp &optional layout) "Display all records in the BBDB matching REGEXP in the name \(or ``alternate'' names\)." (interactive (list (bbdb-search-read "names") (bbdb-layout-prefix))) (bbdb-display-records (bbdb-search (bbdb-records) regexp) layout)) ;;;###autoload (defun bbdb-search-organization (regexp &optional layout) "Display all records in the BBDB matching REGEXP in the organization field." (interactive (list (bbdb-search-read "organization") (bbdb-layout-prefix))) (bbdb-display-records (bbdb-search (bbdb-records) nil regexp) layout)) ;;;###autoload (defun bbdb-search-address (regexp &optional layout) "Display all records in the BBDB matching REGEXP in the address fields." (interactive (list (bbdb-search-read "address") (bbdb-layout-prefix))) (bbdb-display-records (bbdb-search (bbdb-records) nil nil nil nil nil regexp) layout)) ;;;###autoload (defun bbdb-search-mail (regexp &optional layout) "Display all records in the BBDB matching REGEXP in the mail address." (interactive (list (bbdb-search-read "mail address") (bbdb-layout-prefix))) (bbdb-display-records (bbdb-search (bbdb-records) nil nil regexp) layout)) ;;;###autoload (defun bbdb-search-phone (regexp &optional layout) "Display all records in the BBDB matching REGEXP in the phones field." (interactive (list (bbdb-search-read "phone") (bbdb-layout-prefix))) (bbdb-display-records (bbdb-search (bbdb-records) nil nil nil nil regexp) layout)) ;;;###autoload (defun bbdb-search-xfields (field regexp &optional layout) "Display all BBDB records for which xfield FIELD matches REGEXP." (interactive (let ((field (completing-read "Xfield to search (RET for all): " (mapcar 'list bbdb-xfield-label-list) nil t))) (list (if (string= field "") '* (intern field)) (bbdb-search-read (if (string= field "") "any xfield" field)) (bbdb-layout-prefix)))) (bbdb-display-records (bbdb-search (bbdb-records) nil nil nil (cons field regexp)) layout)) (define-obsolete-function-alias 'bbdb-search-notes 'bbdb-search-xfields) ;;;###autoload (defun bbdb-search-changed (&optional layout) "Display all records in the bbdb database which have changed since the database was last saved." (interactive (list (bbdb-layout-prefix))) (if (bbdb-search-invert-p) (let (unchanged-records) (dolist (record (bbdb-records)) (unless (memq record bbdb-changed-records) (push record unchanged-records))) (bbdb-display-records unchanged-records layout)) (bbdb-display-records bbdb-changed-records layout))) (defun bbdb-search-prog (function &optional layout) "Search records using FUNCTION. FUNCTION is called with one argument, the record, and should return the record to be displayed or nil otherwise." (bbdb-display-records (delq nil (mapcar function (bbdb-records))) layout)) ;; clean-up functions ;;; Sometimes one gets mail from foo@bar.baz.com, and then later gets mail ;;; from foo@baz.com. At this point, one would like to delete the bar.baz.com ;;; address, since the baz.com address is obviously superior. (defun bbdb-mail-redundant-re (mail) "Return a regexp matching redundant variants of email address MAIL. For example, \"foo@bar.baz.com\" is redundant w.r.t. \"foo@baz.com\". Return nil if MAIL is not a valid plain email address. In particular, ignore addresses \"Joe Smith \"." (let* ((match (string-match "\\`\\([^ ]+\\)@\\(.+\\)\\'" mail)) (name (and match (match-string 1 mail))) (host (and match (match-string 2 mail)))) (if (and name host) (concat (regexp-quote name) "@.*\\." (regexp-quote host))))) (defun bbdb-delete-redundant-mails (records &optional query update) "Delete redundant or duplicate mails from RECORDS. For example, \"foo@bar.baz.com\" is redundant w.r.t. \"foo@baz.com\". Duplicates may (but should not) occur if we feed BBDB automatically. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. If QUERY is non-nil (as in interactive calls, unless we use a prefix arg) query before deleting the redundant mail addresses. If UPDATE is non-nil (as in interactive calls) update the database. Otherwise, this is the caller's responsiblity. Noninteractively, this may be used as an element of `bbdb-notice-record-hook' or `bbdb-change-hook'. However, see also `bbdb-ignore-redundant-mails', which is probably more suited for your needs." (interactive (list (bbdb-do-records) (not current-prefix-arg) t)) (bbdb-editable) (dolist (record (bbdb-record-list records)) (let (mails redundant okay) ;; We do not look at the canonicalized mail addresses of RECORD. ;; An address "Joe Smith " can only be entered manually ;; into BBDB, and we assume that this is what the user wants. ;; Anyway, if a mail field contains all the elements ;; foo@baz.com, "Joe Smith ", "Jonathan Smith " ;; we do not know which address to keep and which ones to throw. (dolist (mail (bbdb-record-mail record)) (if (assoc-string mail mails t) ; duplicate mail address (push mail redundant) (push mail mails))) (let ((mail-re (delq nil (mapcar 'bbdb-mail-redundant-re mails))) (case-fold-search t)) (if (not (cdr mail-re)) ; at most one mail-re address to consider (setq okay (nreverse mails)) (setq mail-re (concat "\\`\\(?:" (mapconcat 'identity mail-re "\\|") "\\)\\'")) (dolist (mail mails) (if (string-match mail-re mail) ; redundant mail address (push mail redundant) (push mail okay))))) (let ((form (format "redundant mail%s %s" (if (< 1 (length redundant)) "s" "") (bbdb-concat 'mail (nreverse redundant))))) (when (and redundant (or (not query) (y-or-n-p (format "Delete %s: " form)))) (unless query (message "Deleting %s" form)) (bbdb-record-set-field record 'mail okay) (when update (bbdb-change-record record))))))) (define-obsolete-function-alias 'bbdb-delete-duplicate-mails 'bbdb-delete-redundant-mails) (defun bbdb-search-duplicates (&optional fields) "Search all records that have duplicate entries for FIELDS. The list FIELDS may contain the symbols `name', `mail', and `aka'. If FIELDS is nil use all these fields. With prefix, query for FIELDS. The search results are displayed in the BBDB buffer." (interactive (list (if current-prefix-arg (list (intern (completing-read "Field: " '("name" "mail" "aka") nil t)))))) (setq fields (or fields '(name mail aka))) (let (hash ret) (dolist (record (bbdb-records)) (when (and (memq 'name fields) (bbdb-record-name record) (setq hash (bbdb-gethash (bbdb-record-name record) '(fl-name lf-name aka))) (> (length hash) 1)) (setq ret (append hash ret)) (message "BBDB record `%s' has duplicate name." (bbdb-record-name record)) (sit-for 0)) (if (memq 'mail fields) (dolist (mail (bbdb-record-mail-canon record)) (setq hash (bbdb-gethash mail '(mail))) (when (> (length hash) 1) (setq ret (append hash ret)) (message "BBDB record `%s' has duplicate mail `%s'." (bbdb-record-name record) mail) (sit-for 0)))) (if (memq 'aka fields) (dolist (aka (bbdb-record-aka record)) (setq hash (bbdb-gethash aka '(fl-name lf-name aka))) (when (> (length hash) 1) (setq ret (append hash ret)) (message "BBDB record `%s' has duplicate aka `%s'" (bbdb-record-name record) aka) (sit-for 0))))) (bbdb-display-records (sort (delete-dups ret) 'bbdb-record-lessp)))) (defun bbdb-fix-records (records) "Fix broken RECORDS. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'," (interactive (list (bbdb-do-records))) (bbdb-editable) (dolist (record (bbdb-record-list records)) ;; For the fields which take a list of strings (affix, organization, ;; aka, and mail) `bbdb=record-set-field' calls `bbdb-list-strings' ;; which removes all elements from such a list which are not non-empty ;; strings. This should fix most problems with these fields. (bbdb-record-set-field record 'affix (bbdb-record-affix record)) (bbdb-record-set-field record 'organization (bbdb-record-organization record)) (bbdb-record-set-field record 'aka (bbdb-record-aka record)) (bbdb-record-set-field record 'mail (bbdb-record-mail record)) (bbdb-change-record record))) ;;; Time-based functions (defmacro bbdb-compare-records (cmpval label compare) "Builds a lambda comparison function that takes one argument, RECORD. RECORD is returned if (COMPARE VALUE CMPVAL) is t, where VALUE is the value of xfield LABEL of RECORD." `(lambda (record) (let ((val (bbdb-record-xfield record ,label))) (if (and val (,compare val ,cmpval)) record)))) (defsubst bbdb-string> (a b) (not (or (string= a b) (string< a b)))) ;;;###autoload (defun bbdb-timestamp-older (date &optional layout) "Display records with timestamp older than DATE. DATE must be in yyyy-mm-dd format." (interactive (list (read-string "Older than date (yyyy-mm-dd): ") (bbdb-layout-prefix))) (bbdb-search-prog (bbdb-compare-records date 'timestamp string<) layout)) ;;;###autoload (defun bbdb-timestamp-newer (date &optional layout) "Display records with timestamp newer than DATE. DATE must be in yyyy-mm-dd format." (interactive (list (read-string "Newer than date (yyyy-mm-dd): ") (bbdb-layout-prefix))) (bbdb-search-prog (bbdb-compare-records date 'timestamp bbdb-string>) layout)) ;;;###autoload (defun bbdb-creation-older (date &optional layout) "Display records with creation-date older than DATE. DATE must be in yyyy-mm-dd format." (interactive (list (read-string "Older than date (yyyy-mm-dd): ") (bbdb-layout-prefix))) (bbdb-search-prog (bbdb-compare-records date 'creation-date string<) layout)) ;;;###autoload (defun bbdb-creation-newer (date &optional layout) "Display records with creation-date newer than DATE. DATE must be in yyyy-mm-dd format." (interactive (list (read-string "Newer than date (yyyy-mm-dd): ") (bbdb-layout-prefix))) (bbdb-search-prog (bbdb-compare-records date 'creation-date bbdb-string>) layout)) ;;;###autoload (defun bbdb-creation-no-change (&optional layout) "Display records that have the same timestamp and creation-date." (interactive (list (bbdb-layout-prefix))) (bbdb-search-prog ;; RECORD is bound in `bbdb-search-prog'. (bbdb-compare-records (bbdb-record-xfield record 'timestamp) 'creation-date string=) layout)) ;;; Parsing phone numbers ;;; XXX this needs expansion to handle international prefixes properly ;;; i.e. +353-number without discarding the +353 part. Problem being ;;; that this will necessitate yet another change in the database ;;; format for people who are using north american numbers. (defsubst bbdb-subint (string num) "Used for parsing phone numbers." (string-to-number (match-string num string))) (defun bbdb-parse-phone (string &optional style) "Parse a phone number from STRING and return a list of integers the form \(area-code exchange number extension). This is both lenient and strict in what it will parse - whitespace may appear (or not) between any of the groups of digits, parentheses around the area code are optional, as is a dash between the exchange and number, and a '1' preceeding the area code; but there must be three digits in the area code and exchange, and four in the number (if they are present). All of these are unambigously parsable: ( 415 ) 555 - 1212 x123 -> (415 555 1212 123) (415)555-1212 123 -> (415 555 1212 123) (1-415) 555-1212 123 -> (415 555 1212 123) 1 (415)-555-1212 123 -> (415 555 1212 123) 555-1212 123 -> (0 555 1212 123) 555 1212 -> (0 555 1212 0) 415 555 1212 -> (415 555 1212 0) 1 415 555 1212 -> (415 555 1212 0) 5551212 -> (0 555 1212 0) 4155551212 -> (415 555 1212 0) 4155551212123 -> (415 555 1212 123) 5551212x123 -> (0 555 1212 123) 1234 -> (0 0 0 1234) Note that \"4151212123\" is ambiguous; it could be interpreted either as \"(415) 121-2123\" or as \"415-1212 x123\". Return a list containing four numbers or one string." ;; RW: Missing parts of NANP numbers are replaced by zeros. ;; Is this always correct? What about an extension zero? ;; Should we use nil instead of zeros? (unless style (setq style bbdb-phone-style)) (let ((area-regexp (concat "(?[ \t]*\\+?1?[ \t]*[-\(]?[ \t]*[-\(]?[ \t]*" "\\([2-9][0-9][0-9]\\)[ \t]*)?[-./ \t]*")) (main-regexp (concat "\\([1-9][0-9][0-9]\\)[ \t]*[-.]?[ \t]*" "\\([0-9][0-9][0-9][0-9]\\)[ \t]*")) (ext-regexp "x?[ \t]*\\([0-9]+\\)[ \t]*")) (cond ((not (eq style 'nanp)) (list (bbdb-string-trim string))) ((string-match ;; (415) 555-1212 x123 (concat "^[ \t]*" area-regexp main-regexp ext-regexp "$") string) (list (bbdb-subint string 1) (bbdb-subint string 2) (bbdb-subint string 3) (bbdb-subint string 4))) ;; (415) 555-1212 ((string-match (concat "^[ \t]*" area-regexp main-regexp "$") string) (list (bbdb-subint string 1) (bbdb-subint string 2) (bbdb-subint string 3) 0)) ;; 555-1212 x123 ((string-match (concat "^[ \t]*" main-regexp ext-regexp "$") string) (list 0 (bbdb-subint string 1) (bbdb-subint string 2) (bbdb-subint string 3))) ;; 555-1212 ((string-match (concat "^[ \t]*" main-regexp "$") string) (list 0 (bbdb-subint string 1) (bbdb-subint string 2) 0)) ;; x123 ((string-match (concat "^[ \t]*" ext-regexp "$") string) (list 0 0 0 (bbdb-subint string 1))) ;; We trust the user she knows what she wants (t (list (bbdb-string-trim string)))))) (defun bbdb-message-search (name mail) "Return list of BBDB records matching NAME and/or MAIL. First try to find a record matching both NAME and MAIL. If this fails try to find a record matching MAIL. If this fails try to find a record matching NAME. NAME may match FIRST_LAST, LAST_FIRST or AKA. This function performs a fast search using `bbdb-hashtable'. NAME and MAIL must be strings or nil. See `bbdb-search' for searching records with regexps." (when (or name mail) (bbdb-buffer) ; make sure database is loaded and up-to-date (let ((mrecords (if mail (bbdb-gethash mail '(mail)))) (nrecords (if name (bbdb-gethash name '(fl-name lf-name aka))))) ;; (1) records matching NAME and MAIL (or (and mrecords nrecords (let (records) (dolist (record nrecords) (mapc (lambda (mr) (if (and (eq record mr) (not (memq record records))) (push record records))) mrecords)) records)) ;; (2) records matching MAIL mrecords ;; (3) records matching NAME nrecords)))) (defun bbdb-read-record (&optional first-and-last) "Read and return a new BBDB record. Does not insert it into the database or update the hashtables, but does ensure that there will not be name collisions." (bbdb-editable) (let (name) (bbdb-error-retry (setq name (bbdb-read-name first-and-last)) (bbdb-check-name (car name) (cdr name))) (let ((organizations (bbdb-read-organization)) ;; mail (mail (bbdb-split 'mail (bbdb-read-string "E-Mail Addresses: "))) ;; address (addresses (let (addresses label address) (while (not (string= "" (setq label (bbdb-read-string "Snail Mail Address Label [RET when done]: " nil bbdb-address-label-list)))) (setq address (make-vector bbdb-address-length nil)) (bbdb-record-edit-address address label t) (push address addresses)) (nreverse addresses))) ;; phones (phones (let (phones phone-list label) (while (not (string= "" (setq label (bbdb-read-string "Phone Label [RET when done]: " nil bbdb-phone-label-list)))) (setq phone-list (bbdb-error-retry (bbdb-parse-phone (read-string "Phone: " (and (integerp bbdb-default-area-code) (format "(%03d) " bbdb-default-area-code)))))) (push (apply 'vector label phone-list) phones)) (nreverse phones))) ;; `bbdb-default-xfield' (xfield (bbdb-read-xfield bbdb-default-xfield))) (vector (car name) (cdr name) nil nil organizations phones addresses mail (unless (string= xfield "") (list (cons bbdb-default-xfield xfield))) (make-vector bbdb-cache-length nil))))) (defun bbdb-read-name (&optional first-and-last dfirst dlast) "Read name for a record from minibuffer. FIRST-AND-LAST controls the reading mode: If it is 'first-last read first and last name separately. If it is 'last-first read last and first name separately. If it is 'fullname read full name at once. If it is t read name parts separately, obeying `bbdb-read-name-format' if possible. Otherwise use `bbdb-read-name-format'. DFIRST and DLAST are default values for the first and last name. Return cons with first and last name." (unless (memq first-and-last '(first-last last-first fullname)) ;; We do not yet know how to read the name (setq first-and-last (if (and first-and-last (not (memq bbdb-read-name-format '(first-last last-first)))) 'first-last bbdb-read-name-format))) (let ((name (cond ((eq first-and-last 'last-first) (let (fn ln) (setq ln (bbdb-read-string "Last Name: " dlast) fn (bbdb-read-string "First Name: " dfirst)) (cons fn ln))) ((eq first-and-last 'first-last) (cons (bbdb-read-string "First Name: " dfirst) (bbdb-read-string "Last Name: " dlast))) (t (bbdb-divide-name (bbdb-read-string "Name: " (bbdb-concat 'name-first-last dfirst dlast))))))) (if (string= (car name) "") (setcar name nil)) (if (string= (cdr name) "") (setcdr name nil)) name)) ;;;###autoload (defun bbdb-create (record) "Add a new RECORD to BBDB. When called interactively read all relevant info. Do not call this from a program; call `bbdb-create-internal' instead." (interactive (list (bbdb-read-record current-prefix-arg))) (bbdb-change-record record t t) (bbdb-display-records (list record))) (defun bbdb-create-internal (&optional name affix aka organization mail phone address xfields check) "Add a new record to the database and return it. NAME is a string or a cons cell (FIRST . LAST), the name of the person to add. An error is thrown if NAME is already in use and `bbdb-allow-duplicates' is nil. ORGANIZATION is a list of strings. MAIL is a comma-separated list of mail address, or a list of strings. An error is thrown if a mail address in MAIL is already in use and `bbdb-allow-duplicates' is nil. ADDRESS is a list of address objects. An address is a vector of the form \[\"label\" (\"line1\" \"line2\" ... ) \"City\" \"State\" \"Postcode\" \"Country\"]. PHONE is a list of phone-number objects. A phone-number is a vector of the form [\"label\" areacode prefix suffix extension-or-nil] or [\"label\" \"phone-number\"] XFIELDS is an alist associating symbols with strings. If CHECK is non-nil throw an error if an argument is not syntactically correct." (bbdb-editable) ;; name (cond ((stringp name) (setq name (bbdb-divide-name name))) (check (bbdb-check-type name '(or (const nil) (cons string string)) t))) (let ((firstname (car name)) (lastname (cdr name)) (record-type (cdr bbdb-record-type))) (bbdb-check-name firstname lastname) ;; mail addresses (cond ((stringp mail) (setq mail (bbdb-split 'mail mail))) (check (bbdb-check-type mail (bbdb-record-mail record-type) t))) (unless bbdb-allow-duplicates (dolist (elt mail) (if (bbdb-gethash elt '(mail)) (error "%s is already in the database" elt)))) ;; other fields (when check (bbdb-check-type affix (bbdb-record-affix record-type) t) (bbdb-check-type aka (bbdb-record-aka record-type) t) (bbdb-check-type organization (bbdb-record-organization record-type) t) (bbdb-check-type phone (bbdb-record-phone record-type) t) (bbdb-check-type address (bbdb-record-address record-type) t) (bbdb-check-type xfields (bbdb-record-xfields record-type) t)) (bbdb-change-record (vector firstname lastname affix aka organization phone address mail xfields (make-vector bbdb-cache-length nil)) t t))) ;;;###autoload (defun bbdb-insert-field (record field value) "For RECORD, add a new FIELD with value VALUE. Interactively, read FIELD and VALUE; RECORD is the current record. A non-nil prefix arg is passed on to `bbdb-read-field' as FLAG (see there)." (interactive (let* ((_ (bbdb-editable)) (record (or (bbdb-current-record) (error "Point not on a record"))) (list (append bbdb-xfield-label-list '(affix organization aka phone address mail))) (field "") (completion-ignore-case t) (present (mapcar 'car (bbdb-record-xfields record)))) (if (bbdb-record-affix record) (push 'affix present)) (if (bbdb-record-organization record) (push 'organization present)) (if (bbdb-record-mail record) (push 'mail present)) (if (bbdb-record-aka record) (push 'aka present)) (dolist (field present) (setq list (remq field list))) (setq list (mapcar 'symbol-name list)) (while (string= field "") (setq field (downcase (completing-read "Insert Field: " list)))) (setq field (intern field)) (if (memq field present) (error "Field \"%s\" already exists" field)) (list record field (bbdb-read-field record field current-prefix-arg)))) (cond (;; affix (eq field 'affix) (if (bbdb-record-affix record) (error "Affix field exists already")) (if (stringp value) (setq value (bbdb-split 'affix value))) (bbdb-record-set-field record 'affix value)) ;; organization ((eq field 'organization) (if (bbdb-record-organization record) (error "Organization field exists already")) (if (stringp value) (setq value (bbdb-split 'organization value))) (bbdb-record-set-field record 'organization value)) ;; phone ((eq field 'phone) (bbdb-record-set-field record 'phone (nconc (bbdb-record-phone record) (list value)))) ;; address ((eq field 'address) (bbdb-record-set-field record 'address (nconc (bbdb-record-address record) (list value)))) ;; mail ((eq field 'mail) (if (bbdb-record-mail record) (error "Mail field exists already")) (if (stringp value) (setq value (bbdb-split 'mail value))) (bbdb-record-set-field record 'mail value)) ;; AKA ((eq field 'aka) (if (bbdb-record-aka record) (error "Alternate names field exists already")) (if (stringp value) (setq value (bbdb-split 'aka value))) (bbdb-record-set-field record 'aka value)) ;; xfields ((assq field (bbdb-record-xfields record)) (error "xfield \"%s\" already exists" field)) (t (bbdb-record-set-xfield record field value))) (let (bbdb-layout) (bbdb-change-record record))) (defun bbdb-read-field (record field &optional flag) "For RECORD read FIELD interactively. If inserting a new phone number, the phone number style is controlled via `bbdb-phone-style'. A non-nil FLAG inverts the style, If inserting a new mail address lacking a domain, BBDB appends `bbdb-default-domain' if this variable non-nil. With non-nil FLAG \(or `bbdb-default-domain' being nil) do not alter the mail address." (let* ((init-f (intern-soft (concat "bbdb-init-" (symbol-name field)))) (init (if (and init-f (functionp init-f)) (funcall init-f record)))) (cond (;; affix (eq field 'affix) (bbdb-read-string "Affix: " init)) ;; organization ((eq field 'organization) (bbdb-read-organization init)) ;; mail ((eq field 'mail) (let ((mail (bbdb-read-string "Mail: " init))) (if (string-match "^mailto:" mail) (setq mail (substring mail (match-end 0)))) (if (or (not bbdb-default-domain) flag (string-match "[@%!]" mail)) mail (concat mail "@" bbdb-default-domain)))) ;; AKA ((eq field 'aka) (bbdb-read-string "Alternate Names: " init)) ;; Phone ((eq field 'phone) (let ((bbdb-phone-style (if flag (if (eq bbdb-phone-style 'nanp) nil 'nanp) bbdb-phone-style))) (apply 'vector (bbdb-read-string "Label: " nil bbdb-phone-label-list) (bbdb-error-retry (bbdb-parse-phone (read-string "Phone: " (and (integerp bbdb-default-area-code) (format "(%03d) " bbdb-default-area-code)))))))) ;; Address ((eq field 'address) (let ((address (make-vector bbdb-address-length nil))) (bbdb-record-edit-address address nil t) address)) ;; xfield ((or (memq field bbdb-xfield-label-list) ;; New xfield (y-or-n-p (format "\"%s\" is an unknown field name. Define it? " field)) (error "Aborted")) (bbdb-read-xfield field init))))) ;;;###autoload (defun bbdb-edit-field (record field &optional value flag) "Edit the contents of FIELD of RECORD. If point is in the middle of a multi-line field (e.g., address), then the entire field is edited, not just the current line. For editing phone numbers or addresses, VALUE must be the phone number or address that gets edited. An error is thrown when attempting to edit a phone number or address with VALUE being nil." (interactive (save-excursion (bbdb-editable) ;; when at the end of the line take care of it (if (and (eolp) (not (bobp)) (not (bbdb-current-field))) (backward-char 1)) (let* ((field-l (bbdb-current-field)) (field (car field-l)) (value (nth 1 field-l))) (unless field (error "Point not in a field")) (list (bbdb-current-record) (if (memq field '(name affix organization aka mail phone address)) field ; not an xfield (elt value 0)) ; xfield value current-prefix-arg)))) ;; Some editing commands require re-sorting records (let (bbdb-need-to-sort edit-str) (cond ((memq field '(firstname lastname xfields)) ;; FIXME: We could also edit first and last names. (error "Field `%s' not editable this way." field)) ((eq field 'name) (bbdb-error-retry (bbdb-record-set-field record 'name (bbdb-read-name (if flag ;; Here we try to obey the name-format field for ;; editing the name field. Is this useful? Or is this ;; irritating overkill and we better obey consistently ;; `bbdb-read-name-format'? (or (bbdb-record-xfield-intern record 'name-format) flag)) (bbdb-record-firstname record) (bbdb-record-lastname record))))) ((eq field 'phone) (unless value (error "No phone specified")) (bbdb-record-edit-phone (bbdb-record-phone record) value)) ((eq field 'address) (unless value (error "No address specified")) (bbdb-record-edit-address value nil flag)) ((eq field 'organization) (bbdb-record-set-field record field (bbdb-read-organization (bbdb-concat field (bbdb-record-organization record))))) ((setq edit-str (assq field '((affix . "Affix") (mail . "Mail") (aka . "AKA")))) (bbdb-record-set-field record field (bbdb-split field (bbdb-read-string (format "%s: " (cdr edit-str)) (bbdb-concat field (bbdb-record-field record field)))))) (t ; xfield (bbdb-record-set-xfield record field (bbdb-read-xfield field (bbdb-record-xfield record field))))) (bbdb-change-record record bbdb-need-to-sort))) (defun bbdb-edit-foo (record field &optional nvalue) "For RECORD edit some FIELD (mostly interactively). FIELD may take the same values as the elements of the variable `bbdb-edit-foo'. If FIELD is 'phone or 'address, NVALUE should be an integer in order to edit the NVALUEth phone or address field; otherwise insert a new phone or address field. Interactively, if called without a prefix, the value of FIELD is the car of the variable `bbdb-edit-foo'. When called with a prefix, the value of FIELD is the cdr of this variable." (interactive (let* ((_ (bbdb-editable)) (record (bbdb-current-record)) (tmp (if current-prefix-arg (cdr bbdb-edit-foo) (car bbdb-edit-foo))) (field (if (memq tmp '(current-fields all-fields)) ;; Do not require match so that we can define new xfields. (intern (completing-read "Field: " (mapcar 'list (if (eq tmp 'all-fields) (append '(name affix organization aka mail phone address) bbdb-xfield-label-list) (append (if (bbdb-record-name record) '(name)) (if (bbdb-record-affix record) '(affix)) (if (bbdb-record-organization record) '(organization)) (if (bbdb-record-aka record) '(aka)) (if (bbdb-record-mail record) '(mail)) (if (bbdb-record-phone record) '(phone)) (if (bbdb-record-address record) '(address)) (mapcar 'car (bbdb-record-xfields record))))))) tmp)) ;; Multiple phone and address fields may use the same label. ;; So we cannot use these labels to uniquely identify ;; a phone or address field. So instead we number these fields ;; consecutively. But we do use the labels to annotate the numbers ;; (available starting from GNU Emacs 24.1). (nvalue (cond ((eq field 'phone) (let* ((phones (bbdb-record-phone record)) (collection (cons (cons "new" "new phone #") (mapcar (lambda (n) (cons (format "%d" n) (bbdb-phone-label (nth n phones)))) (number-sequence 0 (1- (length phones)))))) (completion-extra-properties '(:annotation-function (lambda (s) (format " (%s)" (cdr (assoc s collection))))))) ; (completion-annotate-function (cadr completion-extra-properties))) ; Emacs 23 (if (< 0 (length phones)) (completing-read "Phone field: " collection nil t) "new"))) ((eq field 'address) (let* ((addresses (bbdb-record-address record)) (collection (cons (cons "new" "new address") (mapcar (lambda (n) (cons (format "%d" n) (bbdb-address-label (nth n addresses)))) (number-sequence 0 (1- (length addresses)))))) (completion-extra-properties '(:annotation-function (lambda (s) (format " (%s)" (cdr (assoc s collection))))))) ; (completion-annotate-function (cadr completion-extra-properties))) ; Emacs 23 (if (< 0 (length addresses)) (completing-read "Address field: " collection nil t) "new")))))) (list record field (and (stringp nvalue) (if (string= "new" nvalue) 'new (string-to-number nvalue)))))) (if (memq field '(firstname lastname name-lf aka-all mail-aka mail-canon)) (error "Field `%s' illegal" field)) (let ((value (if (numberp nvalue) (nth nvalue (cond ((eq field 'phone) (bbdb-record-phone record)) ((eq field 'address) (bbdb-record-address record)) (t (error "%s: nvalue %s meaningless" field nvalue))))))) (if (and (numberp nvalue) (not value)) (error "%s: nvalue %s out of range" field nvalue)) (if (or (and (eq field 'affix) (bbdb-record-affix record)) (and (eq field 'organization) (bbdb-record-organization record)) (and (eq field 'mail) (bbdb-record-mail record)) (and (eq field 'aka) (bbdb-record-aka record)) (assq field (bbdb-record-xfields record)) value) (bbdb-edit-field record field value) (bbdb-insert-field record field (bbdb-read-field record field))))) (defun bbdb-read-xfield (field &optional init) "Read xfield FIELD with optional INIT. This calls bbdb-read-xfield-FIELD if it exists." (let ((read-fun (intern-soft (format "bbdb-read-xfield-%s" field)))) (if (fboundp read-fun) (funcall read-fun init) (bbdb-read-string (format "%s: " field) init)))) (defun bbdb-read-organization (&optional init) "Read organization." (if (string< "24.3" (substring emacs-version 0 4)) (let ((crm-separator (concat "[ \t\n]*" (cadr (assq 'organization bbdb-separator-alist)) "[ \t\n]*")) (crm-local-completion-map bbdb-crm-local-completion-map)) (completing-read-multiple "Organizations: " bbdb-organization-list nil nil init)) (bbdb-split 'organization (bbdb-read-string "Organizations: " init)))) (defun bbdb-record-edit-address (address &optional label ignore-country) "Edit ADDRESS. If LABEL is nil, edit the label sub-field of the address as well. If the country field of ADDRESS is nonempty and IGNORE-COUNTRY is nil, use the rule from `bbdb-address-format-list' matching this country. Otherwise, use the default rule according to `bbdb-address-format-list'." (unless label (setq label (bbdb-read-string "Label: " (bbdb-address-label address) bbdb-address-label-list))) (let ((country (or (bbdb-address-country address) "")) new-addr edit) (unless (or ignore-country (string= "" country)) (let ((list bbdb-address-format-list) identifier elt) (while (and (not edit) (setq elt (pop list))) (setq identifier (car elt)) (if (or (and (listp identifier) (member-ignore-case country identifier)) (and (functionp identifier) (funcall identifier address))) (setq edit (nth 1 elt)))))) (unless edit (setq edit (nth 1 (assq t bbdb-address-format-list)))) (unless edit (error "No address editing function defined")) (if (functionp edit) (setq new-addr (funcall edit address)) (setq new-addr (make-vector 5 "")) (dolist (elt (string-to-list edit)) (cond ((eq elt ?s) (aset new-addr 0 (bbdb-edit-address-street (bbdb-address-streets address)))) ((eq elt ?c) (aset new-addr 1 (bbdb-read-string "City: " (bbdb-address-city address) bbdb-city-list))) ((eq elt ?S) (aset new-addr 2 (bbdb-read-string "State: " (bbdb-address-state address) bbdb-state-list))) ((eq elt ?p) (aset new-addr 3 (bbdb-error-retry (bbdb-parse-postcode (bbdb-read-string "Postcode: " (bbdb-address-postcode address) bbdb-postcode-list))))) ((eq elt ?C) (aset new-addr 4 (bbdb-read-string "Country: " (or (bbdb-address-country address) bbdb-default-country) bbdb-country-list)))))) (bbdb-address-set-label address label) (bbdb-address-set-streets address (elt new-addr 0)) (bbdb-address-set-city address (elt new-addr 1)) (bbdb-address-set-state address (elt new-addr 2)) (bbdb-address-set-postcode address (elt new-addr 3)) (if (string= "" (bbdb-concat "" (elt new-addr 0) (elt new-addr 1) (elt new-addr 2) (elt new-addr 3) (elt new-addr 4))) ;; User did not enter anything. this causes a display bug. ;; The following is a temporary fix. Ideally, we would simply discard ;; the entire address, but that requires bigger hacking. (bbdb-address-set-country address "Emacs") (bbdb-address-set-country address (elt new-addr 4))))) (defun bbdb-edit-address-street (streets) "Edit list STREETS." (let ((n 0) street list) (while (not (string= "" (setq street (bbdb-read-string (format "Street, line %d: " (1+ n)) (nth n streets) bbdb-street-list)))) (push street list) (setq n (1+ n))) (reverse list))) ;; This function can provide some guidance for writing ;; your own address editing function (defun bbdb-edit-address-default (address) "Function to use for address editing. The sub-fields and the prompts used are: Street, line n: (nth n street) City: city State: state Postcode: postcode Country: country" (list (bbdb-edit-address-street (bbdb-address-streets address)) (bbdb-read-string "City: " (bbdb-address-city address) bbdb-city-list) (bbdb-read-string "State: " (bbdb-address-state address) bbdb-state-list) (bbdb-error-retry (bbdb-parse-postcode (bbdb-read-string "Postcode: " (bbdb-address-postcode address) bbdb-postcode-list))) (bbdb-read-string "Country: " (or (bbdb-address-country address) bbdb-default-country) bbdb-country-list))) (defun bbdb-record-edit-phone (phones phone) "For list PHONES edit PHONE number." ;; Phone numbers are special. They are vectors with either ;; two or four elements. We do not know whether after editing PHONE ;; we still have a number requiring the same format as PHONE. ;; So we take all numbers PHONES of the record so that we can ;; replace the element PHONE in PHONES. (setcar (memq phone phones) (apply 'vector (bbdb-read-string "Label: " (bbdb-phone-label phone) bbdb-phone-label-list) (bbdb-error-retry (bbdb-parse-phone (read-string "Phone: " (bbdb-phone-string phone))))))) ;; (bbdb-list-transpose '(a b c d) 1 3) (defun bbdb-list-transpose (list i j) "For LIST transpose elements I and J destructively. I and J start with zero. Return the modified LIST." (if (eq i j) list ; ignore that i, j could be invalid (let (a b c) ;; Travel down LIST only once (if (> i j) (setq a i i j j a)); swap (setq a (nthcdr i list) b (nthcdr (- j i) a) c (car b)) (unless b (error "Args %i, %i beyond length of list." i j)) (setcar b (car a)) (setcar a c) list))) (defun bbdb-ident-point (&optional point) "Return identifier (RECNUM FIELD NUM) for position POINT. If POINT is nil use current value of point. RECNUM is the number of the record (starting from zero). FIELD is the field type. If FIELD's value is a list, NUM is the position of the subfield within FIELD. If any of these terms is not defined at POINT, the respective value is nil." (unless point (setq point (point))) (let ((recnum (get-text-property point 'bbdb-record-number)) (field (get-text-property point 'bbdb-field))) (cond ((not field) (list recnum nil nil)) ((eq (car field) 'name) (list recnum 'name nil)) ((not (nth 1 field)) (list recnum (car field) nil)) (t (let* ((record (car (nth recnum bbdb-records))) (fields (bbdb-record-field record (car field))) (val (nth 1 field)) (num 0) done elt) ;; For xfields we only check the label because the rest of VAL ;; can be anything. (xfields are unique within a record.) (if (eq 'xfields (car field)) (setq val (car val) fields (mapcar 'car fields))) (while (and (not done) (setq elt (pop fields))) (if (eq val elt) (setq done t) (setq num (1+ num)))) (unless done (error "Field %s not found" val)) (list recnum (car field) num)))))) ;;;###autoload (defun bbdb-transpose-fields (arg) "Transpose previous and current field of a BBDB record. With numeric prefix ARG, take previous field and move it past ARG fields. With region active or ARG 0, transpose field point is in and field mark is in. 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 numbers or email addresses are listed, but you cannot use it to make an address appear before a phone number; the order of field types is fixed). If the current field is the name field, transpose first and last name, irrespective of the value of ARG." ;; This functionality is inspired by `transpose-lines'. (interactive "p") (bbdb-editable) (let* ((ident (bbdb-ident-point)) (record (and (car ident) (car (nth (car ident) bbdb-records)))) num1 num2 need-to-sort) (cond ((not (car ident)) (error "Point not in BBDB record")) ((not (nth 1 ident)) (error "Point not in BBDB field")) ((eq 'name (nth 1 ident)) ;; Transpose firstname and lastname (bbdb-record-set-name record (bbdb-record-lastname record) (bbdb-record-firstname record)) (setq need-to-sort t)) ((not (integerp arg)) (error "Arg `%s' not an integer" arg)) ((not (nth 2 ident)) (error "Point not in a transposable field")) (t (if (or (use-region-p) (zerop arg)) (let ((ident2 (bbdb-ident-point (or (mark) (error "No mark set in this buffer"))))) (unless (and (eq (car ident) (car ident2)) (eq (cadr ident) (cadr ident2)) (integerp (nth 2 ident2))) (error "Mark (or point) not on transposable field")) (setq num1 (nth 2 ident) num2 (nth 2 ident2))) (setq num1 (1- (nth 2 ident)) num2 (+ num1 arg)) (if (or (< (min num1 num2) 0) (>= (max num1 num2) (length (bbdb-record-field record (nth 1 ident))))) (error "Cannot transpose fields of different types"))) (bbdb-record-set-field record (nth 1 ident) (bbdb-list-transpose (bbdb-record-field record (nth 1 ident)) num1 num2)))) (bbdb-change-record record need-to-sort))) ;;;###autoload (defun bbdb-delete-field-or-record (records field &optional noprompt) "For RECORDS delete FIELD. If FIELD is the `name' field, delete RECORDS from datanbase. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records', and FIELD is the field point is on. If prefix NOPROMPT is non-nil, do not confirm deletion." ;; The value of FIELD is whatever `bbdb-current-field' returns. ;; This way we can identify more accurately what really needs ;; to be done. (interactive (list (bbdb-do-records) (bbdb-current-field) current-prefix-arg)) (bbdb-editable) (unless field (error "Not a field")) (setq records (bbdb-record-list records)) (let* ((type (car field)) (type-x (if (eq type 'xfields) (car (nth 1 field)) type))) (if (eq type 'name) (bbdb-delete-records records noprompt) (if (memq type '(firstname lastname)) (error "Cannot delete field `%s'" type)) (dolist (record records) (when (or noprompt (y-or-n-p (format "delete this `%s' field (of %s)? " type-x (bbdb-record-name record)))) (cond ((memq type '(phone address)) (bbdb-record-set-field record type (delq (nth 1 field) (bbdb-record-field record type)))) ((memq type '(affix organization mail aka)) (bbdb-record-set-field record type nil)) ((eq type 'xfields) (bbdb-record-set-xfield record type-x nil)) (t (error "Unknown field %s" type))) (bbdb-change-record record)))))) ;;;###autoload (defun bbdb-delete-records (records &optional noprompt) "Delete RECORDS. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. If prefix NOPROMPT is non-nil, do not confirm deletion." (interactive (list (bbdb-do-records) current-prefix-arg)) (bbdb-editable) (dolist (record (bbdb-record-list records)) (when (or noprompt (y-or-n-p (format "Delete the BBDB record of %s? " (or (bbdb-record-name record) (car (bbdb-record-mail record)))))) (bbdb-delete-record-internal record t) (setq bbdb-records (delq (assq record bbdb-records) bbdb-records)) ;; Possibly we changed RECORD before deleting it. (setq bbdb-changed-records (delq record bbdb-changed-records))))) ;;;###autoload (defun bbdb-display-all-records (&optional layout) "Show all records. If invoked in a *BBDB* buffer point stays on the currently visible record. Inverse of `bbdb-display-current-record'." (interactive (list (bbdb-layout-prefix))) (let ((current (ignore-errors (bbdb-current-record)))) (bbdb-display-records (bbdb-records) layout) (when (setq current (assq current bbdb-records)) (redisplay) ; Strange display bug?? (goto-char (nth 2 current))))) ;; (set-window-point (selected-window) (nth 2 current))))) ;;;###autoload (defun bbdb-display-current-record (&optional layout) "Narrow to current record. Inverse of `bbdb-display-all-records'." (interactive (list (bbdb-layout-prefix))) (bbdb-display-records (list (bbdb-current-record)) layout)) (defun bbdb-change-records-layout (records layout) (dolist (record records) (unless (eq layout (nth 1 record)) (setcar (cdr record) layout) (bbdb-redisplay-record (car record))))) ;;;###autoload (defun bbdb-toggle-records-layout (records &optional arg) "Toggle layout of RECORDS (elided or expanded). Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. With prefix ARG 0, RECORDS are displayed elided. With any other non-nil ARG, RECORDS are displayed expanded." (interactive (list (bbdb-do-records t) current-prefix-arg)) (let* ((record (bbdb-current-record)) (current-layout (nth 1 (assq record bbdb-records))) (layout-alist ;; Try to consider only those layouts that have the `toggle' ;; option set (or (delq nil (mapcar (lambda (l) (if (and (assq 'toggle l) (cdr (assq 'toggle l))) l)) bbdb-layout-alist)) bbdb-layout-alist)) (layout (cond ((eq arg 0) 'one-line) ((null current-layout) 'multi-line) ;; layout is not the last element of layout-alist ;; and we switch to the following element of layout-alist ((caar (cdr (memq (assq current-layout layout-alist) layout-alist)))) (t ; layout is the last element of layout-alist ;; and we switch to the first element of layout-alist (caar layout-alist))))) (message "Using %S layout" layout) (bbdb-change-records-layout (bbdb-record-list records t) layout))) ;;;###autoload (defun bbdb-display-records-completely (records) "Display RECORDS using layout `full-multi-line' (i.e., display all fields). Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'." (interactive (list (bbdb-do-records t))) (let* ((record (bbdb-current-record)) (current-layout (nth 1 (assq record bbdb-records))) (layout (if (not (eq current-layout 'full-multi-line)) 'full-multi-line 'multi-line))) (bbdb-change-records-layout (bbdb-record-list records t) layout))) ;;;###autoload (defun bbdb-display-records-with-layout (records layout) "Display RECORDS using LAYOUT. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'." (interactive (list (bbdb-do-records t) (intern (completing-read "Layout: " (mapcar (lambda (i) (list (symbol-name (car i)))) bbdb-layout-alist))))) (bbdb-change-records-layout (bbdb-record-list records t) layout)) ;;;###autoload (defun bbdb-omit-record (n) "Remove current record from the display without deleting it from BBDB. With prefix N, omit the next N records. If negative, omit backwards." (interactive "p") (while (not (= n 0)) (if (< n 0) (bbdb-prev-record 1)) (let ((record (bbdb-current-record t))) (bbdb-redisplay-record (car record) t) (setq bbdb-records (delete record bbdb-records))) (setq n (if (> n 0) (1- n) (1+ n))))) ;;; Fixing up bogus records ;;;###autoload (defun bbdb-merge-records (old-record new-record) "Merge OLD-RECORD into NEW-RECORD, return NEW-RECORD. This copies all the data in OLD-RECORD into NEW-RECORD. Then OLD-RECORD is deleted. If both records have names ask which to use. Affixes, organizations, phone numbers, addresses, and mail addresses are simply concatenated. Interactively, OLD-RECORD is the current record. NEW-RECORD is prompted for. With prefix arg NEW-RECORD defaults to the first record with the same name." (interactive (let* ((_ (bbdb-editable)) (old-record (bbdb-current-record)) (name (bbdb-record-name old-record)) (new-record (and current-prefix-arg ;; take the first record with the same name (car (delq old-record (bbdb-search (bbdb-records) name)))))) (when new-record (message "Merge current record with duplicate record `%s'" name) (sit-for 1)) (list old-record (or new-record (bbdb-completing-read-record (format "merge record \"%s\" into: " (or (bbdb-record-name old-record) (car (bbdb-record-mail old-record)) "???")) (list old-record)))))) (bbdb-editable) (cond ((eq old-record new-record) (error "Records are equal")) ((null new-record) (error "No record to merge with"))) ;; Merge names (let* ((new-name (bbdb-record-name new-record)) (old-name (bbdb-record-name old-record)) (old-aka (bbdb-record-aka old-record)) extra-name (name (cond ((or (string= "" old-name) (bbdb-string= old-name new-name)) (cons (bbdb-record-firstname new-record) (bbdb-record-lastname new-record))) ((string= "" new-name) (cons (bbdb-record-firstname old-record) (bbdb-record-lastname old-record))) (t (prog1 (if (y-or-n-p (format "Use name \"%s\" instead of \"%s\"? " old-name new-name)) (progn (setq extra-name new-name) (cons (bbdb-record-firstname old-record) (bbdb-record-lastname old-record))) (setq extra-name old-name) (cons (bbdb-record-firstname new-record) (bbdb-record-lastname new-record))) (unless (bbdb-eval-spec (bbdb-add-job bbdb-add-aka new-record extra-name) (format "Keep \"%s\" as an alternate name? " extra-name)) (setq extra-name nil))))))) (bbdb-record-set-name new-record (car name) (cdr name)) (if extra-name (push extra-name old-aka)) ;; It is better to delete OLD-RECORD at the end. ;; So we must temporarily allow duplicates in NEW-RECORD. (let ((bbdb-allow-duplicates t)) (bbdb-record-set-field new-record 'aka old-aka t))) ;; Merge other stuff (bbdb-record-set-field new-record 'affix (bbdb-record-affix old-record) t) (bbdb-record-set-field new-record 'organization (bbdb-record-organization old-record) t) (bbdb-record-set-field new-record 'phone (bbdb-record-phone old-record) t) (bbdb-record-set-field new-record 'address (bbdb-record-address old-record) t) (let ((bbdb-allow-duplicates t)) (bbdb-record-set-field new-record 'mail (bbdb-record-mail old-record) t)) (bbdb-record-set-field new-record 'xfields (bbdb-record-xfields old-record) t) (bbdb-delete-records (list old-record) 'noprompt) (bbdb-change-record new-record t) new-record) ;; The following sorting functions are also intended for use ;; in `bbdb-change-hook'. Then they will be called with one arg, the record. ;;;###autoload (defun bbdb-sort-addresses (records &optional update) "Sort the addresses in RECORDS according to the label. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. If UPDATE is non-nil (as in interactive calls) update the database. Otherwise, this is the caller's responsiblity (for example, when used in `bbdb-change-hook')." (interactive (list (bbdb-do-records) t)) (bbdb-editable) (dolist (record (bbdb-record-list records)) (bbdb-record-set-address record (sort (bbdb-record-address record) (lambda (xx yy) (string< (aref xx 0) (aref yy 0))))) (if update (bbdb-change-record record)))) ;;;###autoload (defun bbdb-sort-phones (records &optional update) "Sort the phones in RECORDS according to the label. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. If UPDATE is non-nil (as in interactive calls) update the database. Otherwise, this is the caller's responsiblity (for example, when used in `bbdb-change-hook')." (interactive (list (bbdb-do-records) t)) (bbdb-editable) (dolist (record (bbdb-record-list records)) (bbdb-record-set-phone record (sort (bbdb-record-phone record) (lambda (xx yy) (string< (aref xx 0) (aref yy 0))))) (if update (bbdb-change-record record)))) ;;;###autoload (defun bbdb-sort-xfields (records &optional update) "Sort the xfields in RECORDS according to `bbdb-xfields-sort-order'. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. If UPDATE is non-nil (as in interactive calls) update the database. Otherwise, this is the caller's responsiblity (for example, when used in `bbdb-change-hook')." (interactive (list (bbdb-do-records) t)) (bbdb-editable) (dolist (record (bbdb-record-list records)) (bbdb-record-set-xfields record (sort (bbdb-record-xfields record) (lambda (a b) (< (or (cdr (assq (car a) bbdb-xfields-sort-order)) 100) (or (cdr (assq (car b) bbdb-xfields-sort-order)) 100))))) (if update (bbdb-change-record record)))) (define-obsolete-function-alias 'bbdb-sort-notes 'bbdb-sort-xfields) ;;; Send-Mail interface ;;;###autoload (defun bbdb-dwim-mail (record &optional mail) ;; Do What I Mean! "Return a string to use as the mail address of RECORD. The name in the mail address is formatted obeying `bbdb-mail-name-format' and `bbdb-mail-name'. However, if both the first name and last name are constituents of the address as in John.Doe@Some.Host, and `bbdb-mail-avoid-redundancy' is non-nil, then the address is used as is and `bbdb-mail-name-format' and `bbdb-mail-name' are ignored. If `bbdb-mail-avoid-redundancy' is 'mail-only the name is never included. MAIL may be a mail address to be used for RECORD. If MAIL is an integer, use the MAILth mail address of RECORD. If MAIL is nil use the first mail address of RECORD." (unless mail (let ((mails (bbdb-record-mail record))) (setq mail (or (and (integerp mail) (nth mail mails)) (car mails))))) (unless mail (error "Record has no mail addresses")) (let (name fn ln) (cond ((let ((address (bbdb-decompose-bbdb-address mail))) ;; We need to know whether we should quote the name part of MAIL ;; because of special characters. (if (car address) (setq mail (cadr address) name (car address) ln name)))) ((functionp bbdb-mail-name) (setq name (funcall bbdb-mail-name record)) (if (consp name) (setq fn (car name) ln (cdr name) name (if (eq bbdb-mail-name-format 'first-last) (bbdb-concat 'name-first-last fn ln) (bbdb-concat 'name-last-first ln fn))) (let ((pair (bbdb-divide-name name))) (setq fn (car pair) ln (cdr pair))))) ((setq name (bbdb-record-xfield record bbdb-mail-name)) (let ((pair (bbdb-divide-name name))) (setq fn (car pair) ln (cdr pair)))) (t (setq name (if (eq bbdb-mail-name-format 'first-last) (bbdb-record-name record) (bbdb-record-name-lf record)) fn (bbdb-record-firstname record) ln (bbdb-record-lastname record)))) (if (or (not name) (equal "" name) (eq 'mail-only bbdb-mail-avoid-redundancy) (and bbdb-mail-avoid-redundancy (cond ((and fn ln) (let ((fnq (regexp-quote fn)) (lnq (regexp-quote ln))) (or (string-match (concat "\\`[^!@%]*\\b" fnq "\\b[^!%@]+\\b" lnq "\\b") mail) (string-match (concat "\\`[^!@%]*\\b" lnq "\\b[^!%@]+\\b" fnq "\\b") mail)))) ((or fn ln) (string-match (concat "\\`[^!@%]*\\b" (regexp-quote (or fn ln)) "\\b") mail))))) mail ;; If the name contains backslashes or double-quotes, backslash them. (setq name (replace-regexp-in-string "[\\\"]" "\\\\\\&" name)) ;; If the name contains control chars or RFC822 specials, it needs ;; to be enclosed in quotes. This quotes a few extra characters as ;; well (!,%, and $) just for common sense. ;; `define-mail-alias' uses regexp "[^- !#$%&'*+/0-9=?A-Za-z^_`{|}~]". (format (if (string-match "[][[:cntrl:]\177()<>@,;:.!$%[:nonascii:]]" name) "\"%s\" <%s>" "%s <%s>") name mail)))) (defun bbdb-compose-mail (&rest args) "Start composing a mail message to send. Use `bbdb-mail-user-agent' or (if nil) use `mail-user-agent'. ARGS are passed to `compose-mail'." (let ((mail-user-agent (or bbdb-mail-user-agent mail-user-agent))) (apply 'compose-mail args))) ;;;###autoload (defun bbdb-mail (records &optional subject n verbose) "Compose a mail message to RECORDS (optional: using SUBJECT). Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. By default, the first mail addresses of RECORDS are used. If prefix N is a number, use Nth mail address of RECORDS (starting from 1). If prefix N is C-u (t noninteractively) use all mail addresses of RECORDS. If VERBOSE is non-nil (as in interactive calls) be verbose." (interactive (list (bbdb-do-records) nil (or (consp current-prefix-arg) current-prefix-arg) t)) (setq records (bbdb-record-list records)) (if (not records) (if verbose (message "No records")) (let ((to (bbdb-mail-address records n nil verbose))) (unless (string= "" to) (bbdb-compose-mail to subject))))) (defun bbdb-mail-address (records &optional n kill-ring-save verbose) "Return mail addresses of RECORDS as a string. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. By default, the first mail addresses of RECORDS are used. If prefix N is a number, use Nth mail address of RECORDS (starting from 1). If prefix N is C-u (t noninteractively) use all mail addresses of RECORDS. If KILL-RING-SAVE is non-nil (as in interactive calls), copy mail addresses to kill ring. If VERBOSE is non-nil (as in interactive calls) be verbose." (interactive (list (bbdb-do-records) (or (consp current-prefix-arg) current-prefix-arg) t t)) (setq records (bbdb-record-list records)) (if (not records) (progn (if verbose (message "No records")) "") (let ((good "") bad) (dolist (record records) (let ((mails (bbdb-record-mail record))) (cond ((not mails) (push record bad)) ((eq n t) (setq good (bbdb-concat ",\n\t" good (mapcar (lambda (mail) (bbdb-dwim-mail record mail)) mails)))) (t (setq good (bbdb-concat ",\n\t" good (bbdb-dwim-mail record (or (and (numberp n) (nth (1- n) mails)) (car mails))))))))) (when (and bad verbose) (message "No mail addresses for %s." (mapconcat 'bbdb-record-name (nreverse bad) ", ")) (unless (string= "" good) (sit-for 2))) (when (and kill-ring-save (not (string= good ""))) (kill-new good) (if verbose (message "%s" good))) good))) ;; Is there better way to yank selected mail addresses from the BBDB ;; buffer into a message buffer? We need some kind of a link between ;; the BBDB buffer and the message buffer, where the mail addresses ;; are supposed to go. Then we could browse the BBDB buffer and copy ;; selected mail addresses from the BBDB buffer into a message buffer. (defun bbdb-mail-yank () "CC the people displayed in the *BBDB* buffer on this mail message. The primary mail of each of the records currently listed in the *BBDB* buffer will be appended to the CC: field of the current buffer." (interactive) (let ((addresses (with-current-buffer bbdb-buffer-name (delq nil (mapcar (lambda (x) (if (bbdb-record-mail (car x)) (bbdb-dwim-mail (car x)))) bbdb-records)))) (case-fold-search t)) (goto-char (point-min)) (if (re-search-forward "^CC:[ \t]*" nil t) ;; We have a CC field. Move to the end of it, inserting a comma ;; if there are already addresses present. (unless (eolp) (end-of-line) (while (looking-at "\n[ \t]") (forward-char) (end-of-line)) (insert ",\n") (indent-relative)) ;; Otherwise, if there is an empty To: field, move to the end of it. (unless (and (re-search-forward "^To:[ \t]*" nil t) (eolp)) ;; Otherwise, insert an empty CC: field. (end-of-line) (while (looking-at "\n[ \t]") (forward-char) (end-of-line)) (insert "\nCC:") (indent-relative))) ;; Now insert each of the addresses on its own line. (while addresses (insert (car addresses)) (when (cdr addresses) (insert ",\n") (indent-relative)) (setq addresses (cdr addresses))))) (define-obsolete-function-alias 'bbdb-yank-addresses 'bbdb-mail-yank) ;;; completion ;;;###autoload (defun bbdb-completion-predicate (symbol) "For use as the third argument to `completing-read'. Obey `bbdb-completion-list'." (cond ((null bbdb-completion-list) nil) ((eq t bbdb-completion-list) t) ((not (boundp symbol)) nil) ; deleted (unhashed) record (t (let ((key (symbol-name symbol))) (catch 'bbdb-hash-ok (dolist (record (symbol-value symbol)) (bbdb-hash-p key record bbdb-completion-list)) nil))))) (defun bbdb-completing-read-records (prompt &optional omit-records) "Read and return list of records from the bbdb. Completion is done according to `bbdb-completion-list'. If the user just hits return, nil is returned. Otherwise, a valid response is forced." (let* ((completion-ignore-case t) (string (completing-read prompt bbdb-hashtable 'bbdb-completion-predicate t)) symbol ret) (unless (string= "" string) (setq symbol (intern-soft string bbdb-hashtable)) (if (and (boundp symbol) (symbol-value symbol)) (dolist (record (symbol-value symbol) (delete-dups ret)) (if (not (memq record omit-records)) (push record ret))) (error "Selecting deleted (unhashed) record \"%s\"" symbol))))) (defun bbdb-completing-read-record (prompt &optional omit-records) "Prompt for and return a single record from the bbdb; completion is done according to `bbdb-completion-list'. If the user just hits return, nil is returned. Otherwise, a valid response is forced. If OMIT-RECORDS is non-nil it should be a list of records to dis-allow completion with." (let ((records (bbdb-completing-read-records prompt omit-records))) (cond ((eq (length records) 1) (car records)) ((> (length records) 1) (bbdb-display-records records 'one-line) (let* ((count (length records)) (result (completing-read (format "Which record (1-%s): " count) (mapcar 'number-to-string (number-sequence 1 count)) nil t))) (nth (1- (string-to-number result)) records)))))) ;;;###autoload (defun bbdb-completing-read-mails (prompt &optional init) "Like `read-string', but allows `bbdb-complete-mail' style completion." (read-from-minibuffer prompt init bbdb-completing-read-mails-map)) (defconst bbdb-quoted-string-syntax-table (let ((st (make-syntax-table))) (modify-syntax-entry ?\\ "\\" st) (modify-syntax-entry ?\" "\"" st) st) "Syntax-table to parse matched quotes. Used by `bbdb-complete-mail'.") ;;;###autoload (defun bbdb-complete-mail (&optional beg cycle-completion-buffer) "In a mail buffer, complete the user name or mail before point. Completion happens up to the preceeding colon, comma, or BEG. Return non-nil if there is a valid completion, else return nil. Completion behaviour obeys `bbdb-completion-list' (see there). If what has been typed matches a unique BBDB record, insert an address formatted by `bbdb-dwim-mail' (see there). Also, display this record if `bbdb-completion-display-record' is non-nil, If what has been typed is a valid completion but does not match a unique record, display a list of completions. If the completion is done and `bbdb-complete-mail-allow-cycling' is t then cycle through the mails for the matching record. If BBDB would format a given address different from what we have in the mail buffer, the first round of cycling reformats the address accordingly, then we cycle through the mails for the matching record. With prefix CYCLE-COMPLETION-BUFFER non-nil, display a list of all mails available for cycling. Set the variable `bbdb-complete-mail' non-nil for enabling this feature as part of the MUA insinuation." (interactive (list nil current-prefix-arg)) (bbdb-buffer) ; Make sure the database is initialized. ;; Completion should begin after the preceding comma (separating ;; two addresses) or colon (separating the header field name ;; from the header field body). We want to ignore these characters ;; if they appear inside a quoted string (RFC 5322, Sec. 3.2.4). ;; Note also that a quoted string may span multiple lines ;; (RFC 5322, Sec. 2.2.3). ;; So to be save, we go back to the beginning of the header field body ;; (past the colon, when we are certainly not inside a quoted string), ;; then we parse forward, looking for commas not inside a quoted string ;; and positioned before END. - This fails with an unbalanced quote. ;; But an unbalanced quote is bound to fail anyway. (when (and (not beg) (<= (point) (save-restriction ; `mail-header-end' (widen) (save-excursion (rfc822-goto-eoh) (point))))) (let ((end (point)) start pnt state) (save-excursion ;; A header field name must appear at the beginning of a line, ;; and it must be terminated by a colon. (re-search-backward "^[^ \t\n:][^:]*:[ \t\n]+") (setq beg (match-end 0) start beg) (goto-char beg) ;; If we are inside a syntactically correct header field, ;; all continuation lines in between the field name and point ;; must begin with a white space character. (if (re-search-forward "\n[^ \t]" end t) ;; An invalid header is identified via BEG set to nil. (setq beg nil) ;; Parse field body up to END (with-syntax-table bbdb-quoted-string-syntax-table (while (setq pnt (re-search-forward ",[ \t\n]*" end t)) (setq state (parse-partial-sexp start pnt nil nil state) start pnt) (unless (nth 3 state) (setq beg pnt)))))))) ;; Do we have a meaningful way to set BEG if we are not in a message header? (unless beg (message "Not a valid buffer position for mail completion") (sit-for 1)) (let* ((end (point)) (done (unless beg 'nothing)) (orig (and beg (buffer-substring beg end))) (completion-ignore-case t) (completion (and orig (try-completion orig bbdb-hashtable 'bbdb-completion-predicate))) all-completions dwim-completions one-record) (unless done ;; We get fooled if a partial COMPLETION matches "," (for example, ;; a comma in lf-name). Such a partial COMPLETION cannot be protected ;; by quoting. Then the comma gets interpreted as BEG. ;; So we never perform partial completion beyond the first comma. ;; This works even if we have just one record matching ORIG (thus ;; allowing dwim-completion) because ORIG is a substring of COMPLETION ;; even after COMPLETION got truncated; and ORIG by itself must be ;; sufficient to identify this record. ;; Yet if multiple records match ORIG we can only offer a *Completions* ;; buffer. (if (and (stringp completion) (string-match "," completion)) (setq completion (substring completion 0 (match-beginning 0)))) ;; We cannot use the return value of the function `all-completions' ;; to set the variable `all-completions' because this function ;; converts all symbols into strings (all-completions orig bbdb-hashtable (lambda (sym) (if (bbdb-completion-predicate sym) (push sym all-completions)))) ;; Resolve the records matching ORIG: ;; Multiple completions may match the same record (let ((records (delete-dups (apply 'append (mapcar 'symbol-value all-completions))))) ;; Is there only one matching record? (setq one-record (and (not (cdr records)) (car records)))) ;; Clean up *Completions* buffer window, if it exists (let ((window (get-buffer-window "*Completions*"))) (if (window-live-p window) (quit-window nil window))) (cond ;; Match for a single record (one-record (let ((completion-list (if (eq t bbdb-completion-list) '(fl-name lf-name mail aka organization) bbdb-completion-list)) (mails (bbdb-record-mail one-record)) mail elt) (if (not mails) (progn (message "Matching record has no mail field") (sit-for 1) (setq done 'nothing)) ;; Determine the mail address of ONE-RECORD to use for ADDRESS. ;; Do we have a preferential order for the following tests? ;; (1) If ORIG matches name, AKA, or organization of ONE-RECORD, ;; then ADDRESS will be the first mail address of ONE-RECORD. (if (try-completion orig (append (if (memq 'fl-name completion-list) (list (or (bbdb-record-name one-record) ""))) (if (memq 'lf-name completion-list) (list (or (bbdb-record-name-lf one-record) ""))) (if (memq 'aka completion-list) (bbdb-record-field one-record 'aka-all)) (if (memq 'organization completion-list) (bbdb-record-organization one-record)))) (setq mail (car mails))) ;; (2) If ORIG matches one or multiple mail addresses of ONE-RECORD, ;; then we take the first one matching ORIG. ;; We got here with MAIL nil only if `bbdb-completion-list' ;; includes 'mail or 'primary. (unless mail (while (setq elt (pop mails)) (if (try-completion orig (list elt)) (setq mail elt mails nil)))) ;; This error message indicates a bug! (unless mail (error "No match for %s" orig)) (let ((dwim-mail (bbdb-dwim-mail one-record mail))) (if (string= dwim-mail orig) ;; We get here if `bbdb-mail-avoid-redundancy' is 'mail-only ;; and `bbdb-completion-list' includes 'mail. (unless (and bbdb-complete-mail-allow-cycling (< 1 (length (bbdb-record-mail one-record)))) (setq done 'unchanged)) ;; Replace the text with the expansion (delete-region beg end) (insert dwim-mail) (bbdb-complete-mail-cleanup dwim-mail beg) (setq done 'unique)))))) ;; Partial completion ((and (stringp completion) (not (bbdb-string= orig completion))) (delete-region beg end) (insert completion) (setq done 'partial)) ;; Partial match not allowing further partial completion (completion (let ((completion-list (if (eq t bbdb-completion-list) '(fl-name lf-name mail aka organization) bbdb-completion-list)) sname) ;; Now collect all the dwim-addresses for each completion. ;; Add it if the mail is part of the completions (dolist (sym all-completions) (setq sname (symbol-name sym)) (dolist (record (symbol-value sym)) (let ((mails (bbdb-record-mail record)) accept) (when mails (dolist (field completion-list) (cond ((eq field 'fl-name) (if (bbdb-string= sname (bbdb-record-name record)) (push (car mails) accept))) ((eq field 'lf-name) (if (bbdb-string= sname (bbdb-cache-lf-name (bbdb-record-cache record))) (push (car mails) accept))) ((eq field 'aka) (if (member-ignore-case sname (bbdb-record-field record 'aka-all)) (push (car mails) accept))) ((eq field 'organization) (if (member-ignore-case sname (bbdb-record-organization record)) (push (car mails) accept))) ((eq field 'primary) (if (bbdb-string= sname (car mails)) (push (car mails) accept))) ((eq field 'mail) (dolist (mail mails) (if (bbdb-string= sname mail) (push mail accept)))))) (dolist (mail (delete-dups accept)) (push (bbdb-dwim-mail record mail) dwim-completions)))))) (setq dwim-completions (sort (delete-dups dwim-completions) 'string-lessp)) (cond ((not dwim-completions) (message "Matching record has no mail field") (sit-for 1) (setq done 'nothing)) ;; DWIM-COMPLETIONS may contain only one element, ;; if multiple completions match the same record. ;; Then we may proceed with DONE set to `unique'. ((eq 1 (length dwim-completions)) (delete-region beg end) (insert (car dwim-completions)) (bbdb-complete-mail-cleanup (car dwim-completions) beg) (setq done 'unique)) (t (setq done 'choose))))))) ;; By now, we have considered all possiblities to perform a completion. ;; If nonetheless we haven't done anything so far, consider cycling. ;; ;; Completion and cycling are really two very separate things. ;; Completion is controlled by the user variable `bbdb-completion-list'. ;; Cycling assumes that ORIG already holds a valid RFC 822 mail address. ;; Therefore cycling may consider different records than completion. (when (and (not done) bbdb-complete-mail-allow-cycling) ;; find the record we are working on. (let* ((address (bbdb-extract-address-components orig)) (record (car (bbdb-message-search (car address) (cadr address))))) (if (and record (setq dwim-completions (mapcar (lambda (m) (bbdb-dwim-mail record m)) (bbdb-record-mail record)))) (cond ((and (= 1 (length dwim-completions)) (string= orig (car dwim-completions))) (setq done 'unchanged)) (cycle-completion-buffer ; use completion buffer (setq done 'cycle-choose)) ;; Reformatting / Clean up: ;; If the canonical mail address (nth 1 address) ;; matches the Nth canonical mail address of RECORD, ;; but ORIG is not `equal' to (bbdb-dwim-mail record n), ;; then we replace ORIG by (bbdb-dwim-mail record n). ;; For example, the address "JOHN SMITH " ;; gets reformatted as "John Smith ". ;; We attempt this reformatting before the yet more ;; aggressive proper cycling. ((let* ((cmails (bbdb-record-mail-canon record)) (len (length cmails)) mail dwim-mail) (while (and (not done) (setq mail (pop cmails))) (when (and (bbdb-string= mail (nth 1 address)) ; ignore case (not (string= orig (setq dwim-mail (nth (- len 1 (length cmails)) dwim-completions))))) (delete-region beg end) (insert dwim-mail) (bbdb-complete-mail-cleanup dwim-mail beg) (setq done 'reformat))) done)) (t ;; ORIG is `equal' to an element of DWIM-COMPLETIONS ;; Use the next element of DWIM-COMPLETIONS. (let ((dwim-mail (or (nth 1 (member orig dwim-completions)) (nth 0 dwim-completions)))) ;; replace with new mail address (delete-region beg end) (insert dwim-mail) (bbdb-complete-mail-cleanup dwim-mail beg) (setq done 'cycle))))))) (when (member done '(choose cycle-choose)) ;; Pop up a completions window using DWIM-COMPLETIONS. ;; Too bad: The following requires at least GNU Emacs 23.2 ;; which introduced the variable `completion-base-position'. ;; For an older Emacs there is really no satisfactory workaround ;; (see GNU Emacs bug #4699), unless we use something radical like ;; advicing `choose-completion-string' (used by BBDB v2). (if (string< (substring emacs-version 0 4) "23.2") (message "*Completions* buffer requires at least GNU Emacs 23.2") ;; `completion-in-region' does not work here as `dwim-completions' ;; is not a collection for completion in the usual sense, but it ;; is really a list of replacements. (let ((status (not (eq (selected-window) (minibuffer-window)))) (completion-base-position (list beg end)) ;; If we even have `completion-list-insert-choice-function' ;; (introduced in GNU Emacs 24.1) that is yet better. ;; Then we first call the default value of this variable ;; before performing our own stuff. (completion-list-insert-choice-function `(lambda (beg end text) ,(if (boundp 'completion-list-insert-choice-function) `(funcall ',completion-list-insert-choice-function beg end text)) (bbdb-complete-mail-cleanup text beg)))) (if status (message "Making completion list...")) (with-output-to-temp-buffer "*Completions*" (display-completion-list dwim-completions)) (if status (message "Making completion list...done"))))) ;; If DONE is `nothing' return nil so that possibly some other code ;; can take over. (unless (eq done 'nothing) done))) ;;;###autoload (define-obsolete-function-alias 'bbdb-complete-name 'bbdb-complete-mail) (defun bbdb-complete-mail-cleanup (mail beg) "Clean up after inserting MAIL at position BEG. If we are past `fill-column', wrap at the previous comma." (if (and (not (auto-fill-function)) (>= (current-column) fill-column)) (save-excursion (goto-char beg) (when (search-backward "," (line-beginning-position) t) (forward-char 1) (insert "\n") (indent-relative) (if (looking-at "[ \t\n]+") (delete-region (point) (match-end 0)))))) (if (or bbdb-completion-display-record bbdb-complete-mail-hook) (let* ((address (bbdb-extract-address-components mail)) (records (bbdb-message-search (car address) (nth 1 address)))) ;; Update the *BBDB* buffer if desired. (if bbdb-completion-display-record (let ((bbdb-silent-internal t)) ;; FIXME: This pops up *BBDB* before removing *Completions* (bbdb-display-records records nil t))) ;; `bbdb-complete-mail-hook' may access MAIL, ADDRESS, and RECORDS. (run-hooks 'bbdb-complete-mail-hook)))) ;;; interface to mail-abbrevs.el. ;;;###autoload (defun bbdb-mail-aliases (&optional force-rebuilt noisy) "Define mail aliases for the records in the database. Define a mail alias for every record that has a `mail-alias' field which is the contents of that field. If there are multiple comma-separated words in the `mail-alias' field, then all of those words will be defined as aliases for that person. If multiple records in the database have the same mail alias, then that alias expands to a comma-separated list of the mail addresses of all of these people. Add this command to `mail-setup-hook'. Mail aliases are (re)built only if `bbdb-mail-aliases-need-rebuilt' is non-nil because the database was newly loaded or it has been edited. Rebuilding the aliases is enforced if prefix FORCE-REBUILT is t." (interactive (list current-prefix-arg t)) ;; Build `mail-aliases' if not yet done. ;; Note: `mail-abbrevs-setup' rebuilds the mail-aliases only if ;; `mail-personal-alias-file' has changed. So it would not do anything ;; if we want to rebuild the mail-aliases because of changes in BBDB. (if (or force-rebuilt (eq t mail-aliases)) (build-mail-aliases)) ;; We should be cleverer here and instead of rebuilding all aliases ;; we should just do what's necessary, i.e. remove deleted records ;; and add new records ;; Calling `bbdb-records' can change `bbdb-mail-aliases-need-rebuilt' (let ((records (bbdb-search (bbdb-records) nil nil nil (cons bbdb-mail-alias-field "."))) results match) (if (not (or force-rebuilt bbdb-mail-aliases-need-rebuilt)) (if noisy (message "BBDB mail alias: nothing to do")) (setq bbdb-mail-aliases-need-rebuilt nil) ;; collect an alist of (alias rec1 [rec2 ...]) (dolist (record records) (if (bbdb-record-mail record) (dolist (alias (bbdb-record-xfield-split record bbdb-mail-alias-field)) (if (setq match (assoc alias results)) ;; If an alias appears more than once, we collect all records ;; that refer to it. (nconc match (list record)) (push (list alias record) results))) (unless bbdb-silent (bbdb-warn "record %S has no mail address, but the aliases: %s" (bbdb-record-name record) (bbdb-record-xfield record bbdb-mail-alias-field)) (sit-for 1)))) ;; Iterate over the results and create the aliases (dolist (result results) (let* ((aliasstem (car result)) (expansions (if (cddr result) ;; for group aliases we just take all the primary mails ;; and define only one expansion! (list (mapconcat (lambda (record) (bbdb-dwim-mail record)) (cdr result) mail-alias-separator-string)) ;; this is an alias for a single person so deal with it ;; according to `bbdb-mail-alias' (let* ((record (nth 1 result)) (mails (bbdb-record-mail record))) (if (or (eq 'first bbdb-mail-alias) (not (cdr mails))) ;; Either we want to define only one alias for ;; the first mail address or there is anyway ;; only one address. In either case, we take ;; take only the first address. (list (bbdb-dwim-mail record (car mails))) ;; We need to deal with more than one mail address... (let* ((all (mapcar (lambda (m) (bbdb-dwim-mail record m)) mails)) (star (bbdb-concat mail-alias-separator-string all))) (if (eq 'star bbdb-mail-alias) (list star (car all)) ;; if `bbdb-mail-alias' is 'all, we create ;; two aliases for the primary mail address (cons star (cons (car all) all)))))))) (count -1) ; n=-1: *; n=0: ; n>0: n (len (length expansions)) alias f-alias) ;; create the aliases for each expansion (dolist (expansion expansions) (cond ((or (= 1 len) (= count 0)) (setq alias aliasstem)) ((= count -1) ;; all the mails of a record (setq alias (concat aliasstem "*"))) (t ;; n for each mail of a record (setq alias (format "%s%s" aliasstem count)))) (setq count (1+ count)) (add-to-list 'mail-aliases (cons alias expansion)) (define-mail-abbrev alias expansion) (unless (setq f-alias (intern-soft (downcase alias) mail-abbrevs)) (error "Cannot find the alias")) ;; `define-mail-abbrev' initializes f-alias to be ;; `mail-abbrev-expand-hook'. We replace this by ;; `bbdb-mail-abbrev-expand-hook' (unless (eq (symbol-function f-alias) 'mail-abbrev-expand-hook) (error "mail-aliases contains unexpected hook %s" (symbol-function f-alias))) ;; `bbdb-mail-abbrev-hook' is called with mail addresses instead of ;; bbdb records to avoid keeping pointers to records, which would ;; lose if the database was reverted. ;; `bbdb-mail-abbrev-hook' uses `bbdb-message-search' to convert ;; these mail addresses to records, which is plenty fast. ;; FIXME: The value of arg MAILS for `bbdb-mail-abbrev-hook' ;; is wrong. Currently it is based on the list of records that have ;; referenced ALIASTEM and we simply take the first mail address ;; from each of these records. ;; Then `bbdb-message-search' will find the correct records ;; (assuming that each mail address appears only once in the ;; database). Nonethless, arg MAILS for `bbdb-mail-abbrev-hook' ;; does not, in general, contain the actual mail addresses ;; of EXPANSION. So what we would need is to go back from ;; EXPANSION to the mail addresses it contains (which is tricky ;; because mail addresses in the database can be shortcuts for ;; the addresses in EXPANSION). (fset f-alias `(lambda () (bbdb-mail-abbrev-expand-hook ,alias ',(mapcar (lambda (r) (car (bbdb-record-mail r))) (cdr result)))))))) (if noisy (message "BBDB mail alias: rebuilding done"))))) (defun bbdb-mail-abbrev-expand-hook (alias mails) (run-hook-with-args 'bbdb-mail-abbrev-expand-hook alias mails) (mail-abbrev-expand-hook) (when bbdb-completion-display-record (let ((bbdb-silent-internal t)) (bbdb-display-records (apply 'append (mapcar (lambda (mail) (bbdb-message-search nil mail)) mails)) nil t)))) (defun bbdb-get-mail-aliases () "Return a list of mail aliases used in the BBDB." (let ((records (bbdb-search (bbdb-records) nil nil nil (cons bbdb-mail-alias-field "."))) result) (dolist (record records result) (dolist (alias (bbdb-record-xfield-split record bbdb-mail-alias-field)) (add-to-list 'result alias))))) ;;;###autoload (defun bbdb-add-mail-alias (record &optional alias delete) "Add ALIAS to RECORD. If pefix DELETE is non-nil, remove ALIAS from RECORD." (interactive (let* ((_ (bbdb-editable)) (record (bbdb-current-record)) (init-f (concat "bbdb-init-" (symbol-name bbdb-mail-alias-field))) (init (if (and (setq init-f (intern-soft init-f)) (functionp init-f)) (funcall init-f record)))) (list record (completing-read (format "%s mail alias: " (if current-prefix-arg "Remove" "Add")) (if current-prefix-arg (or (bbdb-record-xfield-split record bbdb-mail-alias-field) (error "Record has no alias")) (bbdb-get-mail-aliases)) nil nil init) current-prefix-arg))) (setq alias (bbdb-string-trim alias)) (unless (string= "" alias) (let ((aliases (bbdb-record-xfield-split record bbdb-mail-alias-field))) (if delete (setq aliases (delete alias aliases)) ;; Add alias only if it is not there yet (add-to-list 'aliases alias)) (setq aliases (bbdb-concat bbdb-mail-alias-field aliases)) (bbdb-record-set-xfield record bbdb-mail-alias-field aliases)) (bbdb-change-record record) ;; Rebuilt mail aliases (setq bbdb-mail-aliases-need-rebuilt (if delete 'deleted (if (bbdb-record-mail record) 'new))))) ;;; Dialing numbers from BBDB (defun bbdb-dial-number (phone-string) "Dial the number specified by PHONE-STRING. This uses the tel URI syntax passed to `browse-url' to make the call. If `bbdb-dial-function' is non-nil then that is called to make the phone call." (interactive "sDial number: ") (if bbdb-dial-function (funcall bbdb-dial-function phone-string) (browse-url (concat "tel:" phone-string)))) ;;;###autoload (defun bbdb-dial (phone force-area-code) "Dial the number at point. If the point is at the beginning of a record, dial the first phone number. Use rules from `bbdb-dial-local-prefix-alist' unless prefix FORCE-AREA-CODE is non-nil. Do not dial the extension." (interactive (list (bbdb-current-field) current-prefix-arg)) (if (eq (car-safe phone) 'name) (setq phone (car (bbdb-record-phone (bbdb-current-record))))) (if (eq (car-safe phone) 'phone) (setq phone (car (cdr phone)))) (or (vectorp phone) (error "Not on a phone field")) (let ((number (bbdb-phone-string phone)) shortnumber) ;; cut off the extension (if (string-match "x[0-9]+$" number) (setq number (substring number 0 (match-beginning 0)))) (unless force-area-code (let ((alist bbdb-dial-local-prefix-alist) prefix) (while (setq prefix (pop alist)) (if (string-match (concat "^" (eval (car prefix))) number) (setq shortnumber (concat (cdr prefix) (substring number (match-end 0))) alist nil))))) (if shortnumber (setq number shortnumber) ;; This is terrifically Americanized... ;; Leading 0 => local number (?) (if (and bbdb-dial-local-prefix (string-match "^0" number)) (setq number (concat bbdb-dial-local-prefix number))) ;; Leading + => long distance/international number (if (and bbdb-dial-long-distance-prefix (string-match "^\+" number)) (setq number (concat bbdb-dial-long-distance-prefix " " (substring number 1))))) (unless bbdb-silent (message "Dialing %s" number)) (bbdb-dial-number number))) ;;; url interface ;;;###autoload (defun bbdb-browse-url (records &optional which) "Brwose URLs stored in the `url' field of RECORDS. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'. Prefix WHICH specifies which URL in field `url' is used (starting from 0). Default is the first URL." (interactive (list (bbdb-get-records "Visit (URL): ") (and current-prefix-arg (prefix-numeric-value current-prefix-arg)))) (unless which (setq which 0)) (dolist (record (bbdb-record-list records)) (let ((url (bbdb-record-xfield-split record 'url))) (when url (setq url (read-string "fetch: " (nth which url))) (unless (string= "" url) (browse-url url)))))) ;;;###autoload (defun bbdb-grab-url (record url) "Grab URL and store it in RECORD." (interactive (let ((url (browse-url-url-at-point))) (unless url (error "No URL at point")) (list (bbdb-completing-read-record (format "Add `%s' for: " url)) url))) (bbdb-record-set-field record 'url url t) (bbdb-change-record record) (bbdb-display-records (list record))) ;;; Copy to kill ring ;;;###autoload (defun bbdb-copy-records-as-kill (records) "Copy displayed RECORDS to kill ring. Interactively, use BBDB prefix \ \\\\[bbdb-do-all-records], see `bbdb-do-all-records'." (interactive (list (bbdb-do-records t))) (let (drec marker) (dolist (record (bbdb-record-list records t)) (push (buffer-substring (nth 2 record) (or (nth 2 (car (cdr (memq record bbdb-records)))) (point-max))) drec)) (kill-new (replace-regexp-in-string "[ \t\n]*\\'" "\n" (mapconcat 'identity (nreverse drec) ""))))) ;;; Help and documentation ;;;###autoload (defun bbdb-info () (interactive) (info (format "(%s)Top" (or bbdb-info-file "bbdb")))) ;;;###autoload (defun bbdb-help () (interactive) (message (substitute-command-keys "\\\ new field: \\[bbdb-insert-field]; \ edit field: \\[bbdb-edit-field]; \ delete field: \\[bbdb-delete-field-or-record]; \ mode help: \\[describe-mode]; \ info: \\[bbdb-info]"))) (provide 'bbdb-com) bbdb-3.1.2/lisp/makefile-temp0000644000175000017500000001354512310460436012750 00000000000000# Cheap BBDB makefile -*- Makefile -*- # Copyright (C) 2010-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . ### Commentary: # This file provides a cheap workaround for (most of) those users # who like to use the latest BBDB, but do not have autotools installed. # This file can compile BBDB's lisp code on most systems. Yet it is not # intended to be foolproof! # This file may also come handy for BBDB developers as it knows # about the proper dependencies of the elisp files, so that it keeps # the *.elc files consistently up to date. srcdir = . prefix = /usr/local lispdir = $(DESTDIR)/usr/local/share/emacs/site-lisp/bbdb INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 RM = /bin/rm -f LN_S = /bin/ln -s CP = /bin/cp EMACS = emacs # Command line flags for Emacs. EMACSOPT = # The actual Emacs command run in the targets below. emacs = LC_ALL=C $(EMACS) --batch --directory=./ $(EMACSOPT) # If you want to use BBDB with VM this should point to your vm/lisp directory. # See also the target all below. VMDIR = VM = -eval '(unless (string-match "$(VMDIR)" "") (push "$(VMDIR)" load-path))' .SUFFIXES: .elc .el .tar .Z .gz .uu SRCS = bbdb.el bbdb-site.el bbdb-com.el bbdb-print.el bbdb-anniv.el \ bbdb-migrate.el bbdb-snarf.el \ bbdb-mua.el bbdb-message.el bbdb-rmail.el \ bbdb-gnus.el bbdb-mhe.el bbdb-vm.el bbdb-pgp.el bbdb-sc.el \ bbdb-ispell.el bbdb-pkg.el # ELC = $(patsubst %.el,%.elc,$(SRCS)) # GNU Make ELC = bbdb.elc bbdb-site.elc bbdb-com.elc bbdb-print.elc bbdb-anniv.elc \ bbdb-migrate.elc bbdb-snarf.elc \ bbdb-mua.elc bbdb-message.elc bbdb-rmail.elc \ bbdb-gnus.elc bbdb-mhe.elc bbdb-pgp.elc bbdb-sc.elc \ bbdb-ispell.elc # bbdb-pkg.elc all: bbdb bbdb: bbdb-loaddefs.el $(ELC) vm: bbdb-vm.elc bbdb-loaddefs.el: $(SRCS) # 2011-12-11: We switched from bbdb-autoloads.el to bbdb-loaddefs.el. # If the user still has an old bbdb-autoloads.el in the BBDB # lisp directory (and keeps loading it from the emacs init file), # we might get strange error messages that things fail. # So we throw an error if these old files are found. @if test -f bbdb-autoloads.el -o -f bbdb-autoloads.elc; then \ (echo "*** ERROR: Old file(s) \`bbdb-autoloads.el(c)' found ***" ; \ echo "*** Delete these files; do not load them from your init file ***") && \ false ; \ fi -$(RM) $@; @echo "(provide 'bbdb-loaddefs)" > $@; @echo "(if (and load-file-name (file-name-directory load-file-name))" >> $@; @echo " (add-to-list 'load-path (file-name-directory load-file-name)))" >> $@; @echo " " >> $@; # Generated autoload-file must have an absolute path, # $(srcdir) can be relative. $(emacs) -l autoload \ --eval '(setq generated-autoload-file "'`pwd`/$@'")' \ --eval '(setq make-backup-files nil)' \ -f batch-update-autoloads `pwd` .el.elc: $(emacs) -f batch-byte-compile $< # Not perfect, but better than nothing: If we do not have / do not use # autotools, we simply copy bbdb-site.el.in to bbdb-site.el. bbdb-site.el: bbdb-site.el.in $(CP) $< $@ bbdb-site.elc: bbdb-site.el $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb.elc: bbdb.el bbdb-site.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-com.elc: bbdb-com.el bbdb.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-mua.elc: bbdb-mua.el bbdb-com.elc $(emacs) -eval '(unless (string= "$(VMDIR)" "") (push "$(VMDIR)" load-path) (load "vm" t t))' \ -f batch-byte-compile $(@:.elc=.el) bbdb-rmail.elc: bbdb-rmail.el bbdb-mua.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-gnus.elc: bbdb-gnus.el bbdb-mua.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-mhe.elc: bbdb-mhe.el bbdb-mua.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) # VM is not part of GNU Emacs bbdb-vm.elc: bbdb-vm.el bbdb-mua.elc $(emacs) $(VM) -f batch-byte-compile $(@:.elc=.el) bbdb-sc.elc: bbdb-sc.el bbdb-mua.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-print.elc: bbdb-print.el bbdb-com.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-migrate.elc: bbdb-migrate.el bbdb.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-anniv.elc: bbdb-anniv.el bbdb-com.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-ispell.elc: bbdb-ispell.el bbdb.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) bbdb-snarf.elc: bbdb-snarf.el bbdb-com.elc $(emacs) -f batch-byte-compile $(@:.elc=.el) install-el: all $(INSTALL) -d -m 0755 "$(lispdir)/" for elc in *.elc; do \ el=`basename $$elc c`; \ if test -f "$(srcdir)/$$el"; then \ echo "Install $$el in $(lispdir)/"; \ $(INSTALL_DATA) "${srcdir}/$$el" "$(lispdir)/"; \ fi; \ done; for el in bbdb-loaddefs.el; do \ echo "Install $$el in $(lispdir)/"; \ $(INSTALL_DATA) $$el "$(lispdir)/"; \ done; install-elc: all $(INSTALL) -d -m 0755 "$(lispdir)/" for elc in bbdb-loaddefs.el *.elc; do \ echo "Install $$elc in $(lispdir)/"; \ $(INSTALL_DATA) $$elc "$(lispdir)/"; \ done; uninstall: for elc in *.elc; do \ $(RM) "$(lispdir)/$$elc"; \ done for el in *.el; do \ $(RM) "$(lispdir)/$$el"; \ done # Assorted clean-up targets clean: -$(RM) bbdb*.elc TAGS distclean: clean maintainer-clean: distclean -$(RM) bbdb-loaddefs.el # Generated file -$(RM) Makefile extraclean: maintainer-clean -$(RM) *~ \#* TAGS: $(SRCS) etags $(SRCS) bbdb-3.1.2/lisp/bbdb-site.el0000644000175000017500000000235612327261604012464 00000000000000;;; bbdb-site.el.in --- site-specific variables for BBDB ;; Copyright (C) 2013-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Code: (defconst bbdb-version "3.1.2" "Version of BBDB.") (if (< emacs-major-version 23) (error "BBDB %s requires GNU Emacs 23 or later" bbdb-version)) (defconst bbdb-version-date "2014-04-27 15:07:24-05:00" "Version date of BBDB.") (defcustom bbdb-print-tex-path '("/usr/local/share/bbdb") "List of directories with the BBDB tex files." :group 'bbdb-utilities-print :type '(repeat (directory :tag "Directory"))) (provide 'bbdb-site) bbdb-3.1.2/lisp/bbdb-vm.el0000644000175000017500000004113212314063311012124 00000000000000;;; bbdb-vm.el --- BBDB interface to VM ;; Copyright (C) 1991, 1992, 1993 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains the BBDB interface to VM. ;;; See the BBDB info manual for documentation. (require 'bbdb) (require 'bbdb-com) (require 'bbdb-mua) (require 'vm-autoloads) (require 'vm) (require 'vm-motion) (require 'vm-summary) (require 'vm-mime) (require 'vm-vars) (require 'vm-macro) (require 'vm-message) (require 'vm-misc) (defcustom bbdb/vm-update-records-p (lambda () (let ((bbdb-update-records-p (if (vm-new-flag (car vm-message-pointer)) 'query 'search))) (bbdb-select-message))) "How `bbdb-mua-update-records' processes mail addresses in VM. This VM-specific variable is normally not used. It is a fallback if the generic (MUA-independent) variables `bbdb-mua-auto-update-p', `bbdb-update-records-p' or `bbdb-mua-update-interactive-p' result in a value of nil for the arg UPDATE-P of `bbdb-update-records'. Allowed values are: nil Do nothing. search Search for existing records. update Search for existing records, update if necessary. query Update existing records or query for creating new ones. create or t Update existing records or create new ones. a function This functions will be called with no arguments. It should return one of the above values." :group 'bbdb-mua-vm :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" (lambda () (let ((bbdb-update-records-p 'search)) (bbdb-select-message)))) (const :tag "update existing records" (lambda () (let ((bbdb-update-records-p 'update)) (bbdb-select-message)))) (const :tag "query annotation of all messages" (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message)))) (const :tag "annotate (query) only new messages" (lambda () (let ((bbdb-update-records-p (if (vm-new-flag (car vm-message-pointer)) 'query 'search))) (bbdb-select-message)))) (const :tag "annotate all messages" (lambda () (let ((bbdb-update-records-p 'create)) (bbdb-select-message)))) (const :tag "accept messages" bbdb-accept-message) (const :tag "ignore messages" bbdb-ignore-message) (const :tag "select messages" bbdb-select-message) (sexp :tag "user defined function"))) (defun bbdb/vm-header (header) (save-current-buffer (vm-select-folder-buffer) (vm-get-header-contents (car vm-message-pointer) (concat header ":")))) ;; By Alastair Burt ;; vm 5.40 and newer support a new summary format, %U, to call ;; a user-provided function. Use "%-17.17UB" instead of "%-17.17F" to ;; have your VM summary buffers display BBDB's idea of the sender's full ;; name instead of the name (or lack thereof) in the message itself. ;; RW: this is a VM-specific version of `bbdb-mua-summary-unify' ;; which respects `vm-summary-uninteresting-senders'. (defun vm-summary-function-B (m) "For VM message M return the BBDB name of the sender. Respect `vm-summary-uninteresting-senders'." (if vm-summary-uninteresting-senders (if (let ((case-fold-search t)) (string-match vm-summary-uninteresting-senders (vm-su-from m))) (concat vm-summary-uninteresting-senders-arrow (or (bbdb/vm-alternate-full-name (vm-su-to m)) (vm-decode-mime-encoded-words-in-string (vm-su-to-names m)))) (or (bbdb/vm-alternate-full-name (vm-su-from m)) (vm-su-full-name m))) (or (bbdb/vm-alternate-full-name (vm-su-from m)) (vm-decode-mime-encoded-words-in-string (vm-su-full-name m))))) (defun bbdb/vm-alternate-full-name (address) (if address (let* ((data (bbdb-extract-address-components address)) (record (car (bbdb-message-search (car data) (cadr data))))) (if record (or (bbdb-record-xfield record 'mail-name) (bbdb-record-name record)))))) ;;;###autoload (defcustom bbdb/vm-auto-folder-headers '("From:" "To:" "CC:") "The headers used by `bbdb/vm-auto-folder'. The order in this list is the order how matching will be performed." :group 'bbdb-mua-vm :type '(repeat (string :tag "header name"))) ;;;###autoload (defcustom bbdb/vm-auto-folder-field 'vm-folder "The xfield which `bbdb/vm-auto-folder' searches for." :group 'bbdb-mua-vm :type 'symbol) ;;;###autoload (defcustom bbdb/vm-virtual-folder-field 'vm-virtual "The xfield which `bbdb/vm-virtual-folder' searches for." :group 'bbdb-mua-vm :type 'symbol) ;;;###autoload (defcustom bbdb/vm-virtual-real-folders nil "Real folders used for defining virtual folders. If nil use `vm-primary-inbox'." :group 'bbdb-mua-vm :type 'symbol) ;;;###autoload (defun bbdb/vm-auto-folder () "Add entries to `vm-auto-folder-alist' for the records in BBDB. For each record that has a `vm-folder' xfield, add an element \(MAIL-REGEXP . FOLDER-NAME) to `vm-auto-folder-alist'. The element gets added to the sublists of `vm-auto-folder-alist' specified in `bbdb/vm-auto-folder-headers'. MAIL-REGEXP matches the mail addresses of the BBDB record. The value of the `vm-folder' xfield becomes FOLDER-NAME. The `vm-folder' xfield is defined via `bbdb/vm-auto-folder-field'. Add this function to `bbdb-before-save-hook' and your .vm." (interactive) (let ((records ; Collect BBDB records with a vm-folder xfield. (delq nil (mapcar (lambda (r) (if (bbdb-record-xfield r bbdb/vm-auto-folder-field) r)) (bbdb-records)))) folder-list folder-name mail-regexp) ;; Add (MAIL-REGEXP . FOLDER-NAME) pair to this sublist of `vm-auto-folder-alist' (dolist (header bbdb/vm-auto-folder-headers) ;; create the folder-list in `vm-auto-folder-alist' if it does not exist (unless (setq folder-list (assoc header vm-auto-folder-alist)) (push (list header) vm-auto-folder-alist) (setq folder-list (assoc header vm-auto-folder-alist))) (dolist (record records) ;; Ignore everything past a comma (setq folder-name (car (bbdb-record-xfield-split record bbdb/vm-auto-folder-field)) ;; quote all the mail addresses for the record and join them mail-regexp (regexp-opt (bbdb-record-mail record))) ;; In general, the values of xfields are strings (required for editing). ;; If we could set the value of `bbdb/vm-auto-folder-field' to a symbol, ;; it could be a function that is called with arg record to calculate ;; the value of folder-name. ;; (if (functionp folder-name) ;; (setq folder-name (funcall folder-name record))) (unless (or (string= "" mail-regexp) (assoc mail-regexp folder-list)) ;; Convert relative into absolute file names using ;; `vm-folder-directory'. (unless (file-name-absolute-p folder-name) (setq folder-name (abbreviate-file-name (expand-file-name folder-name vm-folder-directory)))) ;; nconc modifies the list in place (nconc folder-list (list (cons mail-regexp folder-name)))))))) ;;;###autoload (defun bbdb/vm-virtual-folder () "Create `vm-virtual-folder-alist' according to the records in BBDB. For each record that has a `vm-virtual' xfield, add or modify the corresponding VIRTUAL-FOLDER-NAME element of `vm-virtual-folder-alist'. (VIRTUAL-FOLDER-NAME ((FOLDER-NAME ...) (author-or-recipient MAIL-REGEXP))) VIRTUAL-FOLDER-NAME is the first element of the `vm-virtual' xfield. FOLDER-NAME ... are either the remaining elements of the `vm-virtual' xfield, or `bbdb/vm-virtual-real-folders' or `vm-primary-inbox'. MAIL-REGEXP matches the mail addresses of the BBDB record. The `vm-virtual' xfield is defined via `bbdb/vm-virtual-folder-field'. Add this function to `bbdb-before-save-hook' and your .vm." (interactive) (let (real-folders mail-regexp folder val tmp) (dolist (record (bbdb-records)) (when (setq val (bbdb-record-xfield-split record bbdb/vm-virtual-folder-field)) (setq mail-regexp (regexp-opt (bbdb-record-mail record))) (unless (string= "" mail-regexp) (setq folder (car val) real-folders (mapcar (lambda (f) (if (file-name-absolute-p f) f (abbreviate-file-name (expand-file-name f vm-folder-directory)))) (or (cdr val) bbdb/vm-virtual-real-folders (list vm-primary-inbox))) ;; Either extend the definition of an already defined ;; virtual folder or define a new virtual folder tmp (or (assoc folder vm-virtual-folder-alist) (car (push (list folder) vm-virtual-folder-alist))) tmp (or (assoc real-folders (cdr tmp)) (car (setcdr tmp (cons (list real-folders) (cdr tmp))))) tmp (or (assoc 'author-or-recipient (cdr tmp)) (car (setcdr tmp (cons (list 'author-or-recipient) (cdr tmp)))))) (cond ((not (cdr tmp)) (setcdr tmp (list mail-regexp))) ((not (string-match (regexp-quote mail-regexp) (cadr tmp))) (setcdr tmp (list (concat (cadr tmp) "\\|" mail-regexp)))))))))) ;; RW: Adding custom labels to VM messages allows one to create, ;; for example, virtual folders. The following code creates ;; the required labels in a rather simplistic way, checking merely ;; whether the sender's BBDB record uses a certain mail alias. ;; (Note that `bbdb/vm-virtual-folder' can achieve the same goal, ;; yet this requires a second xfield that must be kept up-to-date, too.) ;; To make auto labels yet more useful, the code could allow more ;; sophisticated schemes, too. Are there real-world applications ;; for this? ;;; Howard Melman, contributed Jun 16 2000 (defcustom bbdb/vm-auto-add-label-list nil "List used by `bbdb/vm-auto-add-label' to automatically label VM messages. Its elements may be strings used both as the xfield value to check for and as the label to apply to the message. If an element is a cons pair (VALUE . LABEL), VALUE is the xfield value to search for and LABEL is the label to apply." :group 'bbdb-mua-vm :type 'list) (defcustom bbdb/vm-auto-add-label-field bbdb-mail-alias-field "Xfields used by `bbdb/vm-auto-add-label' to automatically label messages. This is either a single BBDB xfield or a list of xfields that `bbdb/vm-auto-add-label' uses to check for labels to apply to a message. Defaults to `bbdb-mail-alias-field' which defaults to `mail-alias'." :group 'bbdb-mua-vm :type '(choice symbol list)) (defun bbdb/vm-auto-add-label (record) "Automatically add labels to VM messages. Add this to `bbdb-notice-record-hook' to check the messages noticed by BBDB. If the value of `bbdb/vm-auto-add-label-field' in the sender's BBDB record matches a value in `bbdb/vm-auto-add-label-list' then a VM label will be added to the message. Such VM labels can be used, e.g., to mark messages via `vm-mark-matching-messages' or to define virtual folders via `vm-create-virtual-folder' Typically `bbdb/vm-auto-add-label-field' and `bbdb/vm-auto-add-label-list' refer to mail aliases FOO used with multiple records. This adds a label FOO to all incoming messages matching FOO. Then VM can create a virtual folder for these messages. The concept of combining multiple recipients of an outgoing message in one mail alias thus gets extended to incoming messages from different senders." ;; This could go into `vm-arrived-message-hook' to check messages only once. (if (eq major-mode 'vm-mode) (let* ((xvalues ;; Inspect the relevant fields of RECORD (append (mapcar (lambda (field) (bbdb-record-xfield-split record field)) (cond ((listp bbdb/vm-auto-add-label-field) bbdb/vm-auto-add-label-field) ((symbolp bbdb/vm-auto-add-label-field) (list bbdb/vm-auto-add-label-field)) (t (error "Bad value for bbdb/vm-auto-add-label-field")))))) ;; Collect the relevant labels from `bbdb/vm-auto-add-label-list' (labels (delq nil (mapcar (lambda (l) (cond ((stringp l) (if (member l xvalues) l)) ((and (consp l) (stringp (car l)) (stringp (cdr l))) (if (member (car l) xvalues) (cdr l))) (t (error "Malformed bbdb/vm-auto-add-label-list")))) bbdb/vm-auto-add-label-list)))) (if labels (vm-add-message-labels (mapconcat 'identity labels " ") 1))))) ;;;###autoload (defun bbdb-insinuate-vm () "Hook BBDB into VM. Do not call this in your init file. Use `bbdb-initialize'." (define-key vm-mode-map ":" 'bbdb-mua-display-records) (define-key vm-mode-map "`" 'bbdb-mua-display-sender) (define-key vm-mode-map "'" 'bbdb-mua-display-recipients) (define-key vm-mode-map ";" 'bbdb-mua-edit-field-sender) ;; Do we need keybindings for more commands? Suggestions welcome. ;; (define-key vm-mode-map "'" 'bbdb-mua-edit-field-recipients) (define-key vm-mode-map "/" 'bbdb) ;; `mail-mode-map' is the parent of `vm-mail-mode-map'. ;; So the following is also done by `bbdb-insinuate-mail'. (if (and bbdb-complete-mail (boundp 'vm-mail-mode-map)) (define-key vm-mail-mode-map "\M-\t" 'bbdb-complete-mail)) ;; Set up user field for use in `vm-summary-format' ;; (1) Big solution: use whole name (if bbdb-mua-summary-unify-format-letter (fset (intern (concat "vm-summary-function-" bbdb-mua-summary-unify-format-letter)) (lambda (m) (bbdb-mua-summary-unify ;; VM does not give us the original From header. ;; So we have to work backwards. (let ((name (vm-decode-mime-encoded-words-in-string (vm-su-interesting-full-name m))) (mail (vm-su-from m))) (if (string= name mail) mail (format "\"%s\" <%s>" name mail))))))) ;; (2) Small solution: a mark for messages whos sender is in BBDB. (if bbdb-mua-summary-mark-format-letter (fset (intern (concat "vm-summary-function-" bbdb-mua-summary-mark-format-letter)) ;; VM does not give us the original From header. ;; So we assume that the mail address is sufficient to identify ;; the BBDB record of the sender. (lambda (m) (bbdb-mua-summary-mark (vm-su-from m)))))) (provide 'bbdb-vm) bbdb-3.1.2/lisp/bbdb-mhe.el0000644000175000017500000001404012261714070012257 00000000000000;;; bbdb-mhe.el --- BBDB interface to mh-e ;; Copyright (C) 1991 Todd Kaufmann ;; Modified: 28-Jul-94 by Fritz Knabe ;; Jack Repenning ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains the BBDB interface to mh-e. ;;; See the BBDB info manual for documentation. (require 'bbdb) (require 'bbdb-com) (require 'bbdb-mua) (require 'mh-e) (if (fboundp 'mh-version) (require 'mh-comp)) ; For mh-e 4.x (require 'advice) (defcustom bbdb/mh-update-records-p (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message))) "How `bbdb-mua-update-records' processes mail addresses in MH-E. This MH-E-specific variable is normally not used. It is a fallback if the generic (MUA-independent) variables `bbdb-mua-auto-update-p', `bbdb-update-records-p' or `bbdb-mua-update-interactive-p' result in a value of nil for the arg UPDATE-P of `bbdb-update-records'. Allowed values are: nil Do nothing. search Search for existing records. update Search for existing records, update if necessary. query Update existing records or query for creating new ones. create or t Update existing records or create new ones. a function This functions will be called with no arguments. It should return one of the above values." :group 'bbdb-mua-gnus :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" (lambda () (let ((bbdb-update-records-p 'search)) (bbdb-select-message)))) (const :tag "update existing records" (lambda () (let ((bbdb-update-records-p 'update)) (bbdb-select-message)))) (const :tag "query annotation of all messages" (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message)))) (const :tag "annotate (query) only new messages" (if (equal "" (gnus-summary-article-mark (gnus-summary-article-number))) (bbdb-select-message) 'search)) (const :tag "annotate all messages" (lambda () (let ((bbdb-update-records-p 'create)) (bbdb-select-message)))) (const :tag "accept messages" bbdb-accept-message) (const :tag "ignore messages" bbdb-ignore-message) (const :tag "select messages" bbdb-select-message) (sexp :tag "user defined"))) ;; A simplified `mail-fetch-field'. We could use instead (like rmail): ;; (mail-header (intern-soft (downcase header)) (mail-header-extract)) (defun bbdb/mh-header (header) "Find and return the value of HEADER in the current buffer. Returns the empty string if HEADER is not in the message." (let ((case-fold-search t)) (goto-char (point-min)) ;; This will be fooled if HEADER appears in the body of the message. ;; Also, it fails if HEADER appears more than once. (cond ((not (re-search-forward header nil t)) "") ((looking-at "[\t ]*$") "") (t (re-search-forward "[ \t]*\\([^ \t\n].*\\)$" nil t) (let ((start (match-beginning 1))) (while (progn (forward-line 1) (looking-at "[ \t]"))) (backward-char 1) (buffer-substring-no-properties start (point))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Use BBDB for interactive spec of MH-E commands (defadvice mh-send (before mh-bbdb-send act) (interactive (list (bbdb-completing-read-mails "To: ") (bbdb-completing-read-mails "Cc: ") (read-string "Subject: ")))) (defadvice mh-send-other-window (before mh-bbdb-send-other act) (interactive (list (bbdb-completing-read-mails "To: ") (bbdb-completing-read-mails "Cc: ") (read-string "Subject: ")))) (defadvice mh-forward (before mh-bbdb-forward act) (interactive (list (bbdb-completing-read-mails "To: ") (bbdb-completing-read-mails "Cc: ") (if current-prefix-arg (mh-read-seq-default "Forward" t) (mh-get-msg-num t))))) (defadvice mh-redistribute (before mh-bbdb-redist act) (interactive (list (bbdb-completing-read-mails "Redist-To: ") (bbdb-completing-read-mails "Redist-Cc: ") (mh-get-msg-num t)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;###autoload (defun bbdb-insinuate-mh () "Call this function to hook BBDB into MH-E. Do not call this in your init file. Use `bbdb-initialize'." (define-key mh-folder-mode-map ":" 'bbdb-mua-display-sender) (define-key mh-folder-mode-map ";" 'bbdb-mua-edit-field-sender) ;; Do we need keybindings for more commands? Suggestions welcome. ;; (define-key mh-folder-mode-map ":" 'bbdb-mua-display-records) ;; (define-key mh-folder-mode-map "'" 'bbdb-mua-display-recipients) ;; (define-key mh-folder-mode-map ";" 'bbdb-mua-edit-field-recipients) (when bbdb-complete-mail (define-key mh-letter-mode-map "\M-;" 'bbdb-complete-mail) (define-key mh-letter-mode-map "\e\t" 'bbdb-complete-mail))) (provide 'bbdb-mhe) bbdb-3.1.2/lisp/bbdb-ispell.el0000644000175000017500000001160612261714537013013 00000000000000;;; bbdb-ispell.el --- export names from BBDB to personal ispell dictionaries ;; Copyright (C) 2011-2013 Ivan Kanis ;; Copyright (C) 2011-2014 Roland Winkler ;; Author: Ivan Kanis ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;; ;; Names are often not recognized by the standard ispell dictionaries. ;; `bbdb-ispell-export' exports the names from your BBDB records to your ;; personal ispell dictionaries. ;; The personal dictionaries are in `bbdb-ispell-dictionary-list' ;; The BBDB fields for this are in `bbdb-ispell-field-list'. ;; Exclude words via `bbdb-ispell-min-word-length' and `bbdb-ispell-ignore-re'. ;; ;; Bugs: ;; Save your personal directories before running this code. I had my ;; dictionary truncated while debugging. It shouldn't happen ;; but better be safe than sorry... ;; ;; See the BBDB info manual for documentation. ;;; Code: (require 'ispell) (require 'bbdb) (defcustom bbdb-ispell-dictionary-list '("default") "List of ispell personal dictionaries. Allowed elements are as in the return value of `ispell-valid-dictionary-list'." :group 'bbdb-utilities-ispell :type (cons 'set (mapcar (lambda (dict) `(string ,dict)) (ispell-valid-dictionary-list)))) (defcustom bbdb-ispell-field-list '(name organization aka) "List of fields of each BBDB record considered for the personal dictionary." :group 'bbdb-utilities-ispell :type (list 'repeat (append '(choice) (mapcar (lambda (field) `(const ,field)) '(name organization affix aka address)) '((symbol :tag "xfield"))))) (defcustom bbdb-ispell-min-word-length 3 "Words with fewer characters are ignored." :group 'bbdb-utilities-ispell :type 'number) (defcustom bbdb-ispell-ignore-re "[^[:alpha:]]" "Words matching this regexp are ignored." :group 'bbdb-utilities-ispell :type 'regexp) ;; Internal variable (defvar bbdb-ispell-word-list nil "List of words extracted from the BBDB records.") ;;;###autoload (defun bbdb-ispell-export () "Export BBDB records to ispell personal dictionaries." (interactive) (message "Exporting to personal dictionary...") (let (bbdb-ispell-word-list) ;; Collect words from BBDB records. (dolist (record (bbdb-records)) (dolist (field bbdb-ispell-field-list) (bbdb-ispell-collect-words (bbdb-record-field record field)))) ;; Update personal dictionaries (dolist (dict (or bbdb-ispell-dictionary-list '("default"))) (ispell-change-dictionary dict) ;; Initialize variables and dicts alists (ispell-set-spellchecker-params) (ispell-init-process) ;; put in verbose mode (ispell-send-string "%\n") (let (new) (dolist (word (delete-dups bbdb-ispell-word-list)) (ispell-send-string (concat "^" word "\n")) (while (progn (ispell-accept-output) (not (string= "" (car ispell-filter))))) ;; remove extra \n (setq ispell-filter (cdr ispell-filter)) (when (and ispell-filter (listp ispell-filter) (not (eq (ispell-parse-output (car ispell-filter)) t))) ;; ok the word doesn't exist, add it (ispell-send-string (concat "*" word "\n")) (setq new t))) (when new ;; Save dictionary: ;; aspell doesn't tell us when it completed the saving. ;; So we send it another word for spellchecking. (ispell-send-string "#\n^hello\n") (while (progn (ispell-accept-output) (not (string= "" (car ispell-filter))))))))) (message "Exporting to personal dictionary...done")) (defun bbdb-ispell-collect-words (field) "Parse BBDB FIELD and collect words in `bbdb-ispell-word-list'." ;; Ignore everything in FIELD that is not a string or a sequence. (cond ((stringp field) (dolist (word (split-string field)) (if (and (>= (length word) bbdb-ispell-min-word-length) (not (string-match bbdb-ispell-ignore-re word))) (push word bbdb-ispell-word-list)))) ((sequencep field) (mapc 'bbdb-ispell-collect-words field)))) (provide 'bbdb-ispell) bbdb-3.1.2/lisp/bbdb-gnus.el0000644000175000017500000004716012261714070012473 00000000000000;;; bbdb-gnus.el --- BBDB interface to Gnus ;; Copyright (C) 1991, 1992, 1993 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains the BBDB interface to Gnus. ;;; See the BBDB info manual for documentation. (require 'bbdb) (require 'bbdb-com) (require 'bbdb-mua) (require 'gnus) (defcustom bbdb/gnus-update-records-p (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message))) "How `bbdb-mua-update-records' processes mail addresses in Gnus. This Gnus-specific variable is normally not used. It is a fallback if the generic (MUA-independent) variables `bbdb-mua-auto-update-p', `bbdb-update-records-p' or `bbdb-mua-update-interactive-p' result in a value of nil for the arg UPDATE-P of `bbdb-update-records'. Allowed values are: nil Do nothing. search Search for existing records. update Search for existing records, update if necessary. query Update existing records or query for creating new ones. create or t Update existing records or create new ones. a function This functions will be called with no arguments. It should return one of the above values." :group 'bbdb-mua-gnus :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" (lambda () (let ((bbdb-update-records-p 'search)) (bbdb-select-message)))) (const :tag "update existing records" (lambda () (let ((bbdb-update-records-p 'update)) (bbdb-select-message)))) (const :tag "query annotation of all messages" (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message)))) (const :tag "annotate (query) only new messages" (if (equal "" (gnus-summary-article-mark (gnus-summary-article-number))) (bbdb-select-message) 'search)) (const :tag "annotate all messages" (lambda () (let ((bbdb-update-records-p 'create)) (bbdb-select-message)))) (const :tag "accept messages" bbdb-accept-message) (const :tag "ignore messages" bbdb-ignore-message) (const :tag "select messages" bbdb-select-message) (sexp :tag "user defined"))) ;; ;; Scoring ;; (defcustom bbdb/gnus-score-field 'gnus-score "This variable contains the name of the BBDB field which should be checked for a score to add to the mail addresses in the same record." :group 'bbdb-mua-gnus-scoring :type 'symbol) (defcustom bbdb/gnus-score-default nil "If this is set, then every mail address in the BBDB that does not have an associated score field will be assigned this score. A value of nil implies a default score of zero." :group 'bbdb-mua-gnus-scoring :type '(choice (const :tag "Do not assign default score") (integer :tag "Assign this default score" 0))) (defvar bbdb/gnus-score-default-internal nil "Internal variable for detecting changes to `bbdb/gnus-score-default'. You should not set this variable directly - set `bbdb/gnus-score-default' instead.") (defvar bbdb/gnus-score-alist nil "The text version of the scoring structure returned by bbdb/gnus-score. This is built automatically from the BBDB.") (defvar bbdb/gnus-score-rebuild-alist t "Set to t to rebuild bbdb/gnus-score-alist on the next call to bbdb/gnus-score. This will be set automatically if you change a BBDB record which contains a gnus-score field.") (defun bbdb/gnus-score-invalidate-alist (record) "This function is called through `bbdb-after-change-hook', and sets `bbdb/gnus-score-rebuild-alist' to t if the changed record contains a gnus-score field." (if (bbdb-record-xfield record bbdb/gnus-score-field) (setq bbdb/gnus-score-rebuild-alist t))) ;;;###autoload (defun bbdb/gnus-score (group) "This returns a score alist for Gnus. A score pair will be made for every member of the mail field in records which also have a gnus-score field. This allows the BBDB to serve as a supplemental global score file, with the advantage that it can keep up with multiple and changing addresses better than the traditionally static global scorefile." (list (list (condition-case nil (read (bbdb/gnus-score-as-text group)) (error (setq bbdb/gnus-score-rebuild-alist t) (message "Problem building BBDB score table.") (ding) (sit-for 2) nil))))) (defun bbdb/gnus-score-as-text (group) "Returns a SCORE file format string built from the BBDB." (cond ((or (cond ((/= (or bbdb/gnus-score-default 0) (or bbdb/gnus-score-default-internal 0)) (setq bbdb/gnus-score-default-internal bbdb/gnus-score-default) t)) (not bbdb/gnus-score-alist) bbdb/gnus-score-rebuild-alist) (setq bbdb/gnus-score-rebuild-alist nil) (setq bbdb/gnus-score-alist (concat "((touched nil) (\"from\"\n" (mapconcat (lambda (record) (let ((score (or (bbdb-record-xfield record bbdb/gnus-score-field) bbdb/gnus-score-default)) (mail (bbdb-record-mail record))) (when (and score mail) (mapconcat (lambda (address) (format "(\"%s\" %s)\n" address score)) mail "")))) (bbdb-records) "") "))")))) bbdb/gnus-score-alist) ;;; from Brian Edmonds' gnus-bbdb.el ;;; ;;; Splitting / filing with gnus-folder ;;; ;;; To use this feature, you need to put this file somewhere in your ;;; load-path and add the following lines of code to your .gnus file: ;;; ;;; (setq nnmail-split-methods 'bbdb/gnus-split-method) ;;; ;;; You should also examine the variables defvar'd below and customize ;;; them to your taste. They're listed roughly in descending likelihood ;;; of your wanting to change them. Once that is done, you need to add ;;; filing information to your BBDB. There are two fields of interest: ;;; ;;; 1. gnus-private. This field contains the name of the group in which ;;; mail to you from any of the addresses associated with this record ;;; will be filed. Also, any self-copies of mail you send any of the ;;; same addresses will be filed here. ;;; 2. gnus-public. This field is used to keep mail from mailing lists ;;; out of the private mailboxes. It should be added to a record for ;;; the list submission address, and is formatted as follows: ;;; "group regexp" ;;; where group is where mail from the list should be filed, and ;;; regexp is a regular expression which is checked against the ;;; envelope sender (from the From_ header) to verify that this is ;;; the copy which came from the list. For example, the entry for ;;; the ding mailing list might be: ;;; "mail.emacs.ding ding-request@ifi.uio.no" ;;; Yes, the second part *is* a regexp, so those dots may match ;;; something other than dots. Sue me. ;;; ;;; Note that you can also specify a gnus-private field for mailing list ;;; addresses, in which case self-copies of mail you send to the list ;;; will be filed there. Also, the field names can be changed below if ;;; the defaults are not hip enough for you. Lastly, if you specify a ;;; gnus-private field for your *own* BBDB record, then all self-copies ;;; of mail you send will be filed to that group. ;;; ;;; This documentation should probably be expanded and moved to a ;;; separate file, but it's late, and *I* know what I'm trying to ;;; say. :) (defcustom bbdb/gnus-split-default-group "mail.misc" "If the BBDB does not indicate any group to spool a message to, it will be spooled to this group. If `bbdb/gnus-split-crosspost-default' is not nil, and if the BBDB did not indicate a specific group for one or more addresses, messages will be crossposted to this group in addition to any group(s) which the BBDB indicated." :group 'bbdb-mua-gnus-splitting :type 'string) (defcustom bbdb/gnus-split-nomatch-function nil "This function will be called after searching the BBDB if no place to file the message could be found. It should return a group name (or list of group names) -- `nnmail-split-fancy' as provided with Gnus is an excellent choice." :group 'bbdb-mua-gnus-splitting :type 'function) (defcustom bbdb/gnus-split-myaddr-regexp (concat "^" (user-login-name) "$\\|^" (user-login-name) "@\\([-a-z0-9]+\\.\\)*" (or (message-make-domain) (system-name) "") "$") "This regular expression should match your address as found in the From header of your mail." :group 'bbdb-mua-gnus-splitting :type 'string) (defcustom bbdb/gnus-split-crosspost-default nil "If this variable is not nil, then if the BBDB could not identify a group for every mail address, messages will be filed in `bbdb/gnus-split-default-group' in addition to any group(s) which the BBDB identified." :group 'bbdb-mua-gnus-splitting :type 'boolean) (defcustom bbdb/gnus-split-private-field 'gnus-private "This variable is used to determine the xfield to reference to find the associated group when saving private mail for a mail address known to the BBDB. The value of the xfield should be the name of a mail group." :group 'bbdb-mua-gnus-splitting :type 'string) (defcustom bbdb/gnus-split-public-field 'gnus-public "This variable is used to determine the xfield to reference to find the associated group when saving non-private mail (received from a mailing list) for a mail address known to the BBDB. The value of the xfield should be the name of a mail group, followed by a space, and a regular expression to match on the envelope sender to verify that this mail came from the list in question." :group 'bbdb-mua-gnus-splitting :type 'string) ;; The split function works by assigning one of four spooling priorities ;; to each group that is associated with an address in the message. The ;; priorities are assigned as follows: ;; ;; 0. This priority is assigned when crosspost-default is nil to To/Cc ;; addresses which have no private group defined in the BBDB. If the ;; user's own address has no private group defined, then it will ;; always be given this priority. ;; 1. This priority is assigned to To/Cc addresses which have a private ;; group defined in the BBDB. If crosspost-default is not nil, then ;; To/Cc addresses which have no private group will also be assigned ;; this priority. This is also assigned to the user's own address in ;; the From position if a private group is defined for it. ;; 2. This priority is assigned to From addresses which have a private ;; group defined in the BBDB, except for the user's own address as ;; described under priorities 0 and 1. ;; 3. This priority is assigned to To/Cc addresses which have a public ;; group defined in the BBDB, and whose associated regular expression ;; matches the envelope sender (found in the header From_). ;; ;; The split function evaluates the spool priority for each address in ;; the headers of the message, and returns as a list all the groups ;; associated with the addresses which share the highest calculated ;; priority. ;;;###autoload (defun bbdb/gnus-split-method () "This function expects to be called in a buffer which contains a mail message to be spooled, and the buffer should be narrowed to the message headers. It returns a list of groups to which the message should be spooled, using the addresses in the headers and information from BBDB." (let ((prq (list (list 0) (list 1) (list 2) (list 3)))) ;; the From: header is special (let* ((hdr (or (mail-fetch-field "resent-from") (mail-fetch-field "from") (user-login-name))) (rv (bbdb/gnus-split-to-group hdr t))) (setcdr (nth (cdr rv) prq) (list (car rv)))) ;; do the rest of the headers (let ((hdr (or (concat (or (mail-fetch-field "resent-to" nil t) (mail-fetch-field "to" nil t)) ", " (mail-fetch-field "cc" nil t) ", " (mail-fetch-field "apparently-to" nil t)) ""))) (dolist (address (bbdb-extract-address-components hdr t)) (let* ((rv (bbdb/gnus-split-to-group address)) (pr (nth (cdr rv) prq))) (unless (member-ignore-case (car rv) pr) (setcdr pr (cons (car rv) (cdr pr))))))) ;; find the highest non-empty queue (setq prq (reverse prq)) (while (and prq (not (cdr (car prq)))) (setq prq (cdr prq))) ;; and return... (if (not (or (not (cdr (car prq))) (and (equal (cdr (car prq)) (list bbdb/gnus-split-default-group)) (symbolp bbdb/gnus-split-nomatch-function) (fboundp bbdb/gnus-split-nomatch-function)))) (cdr (car prq)) (goto-char (point-min)) (funcall bbdb/gnus-split-nomatch-function)))) (defun bbdb/gnus-split-to-group (address &optional source) "This function is called from `bbdb/gnus-split-method' in order to determine the group and spooling priority for a single address." (condition-case nil (let* ((tmp (bbdb-extract-address-components address)) (mail (cadr tmp)) (record (car (bbdb-message-search (car tmp) mail))) public private rgx) (when record (setq private (bbdb-record-xfield record bbdb/gnus-split-private-field) public (bbdb-record-xfield record bbdb/gnus-split-public-field)) (if (and public (not source) (string-match "^\\([^ ]+\\) \\(.*\\)$" public)) (setq rgx (substring public (match-beginning 2) (match-end 2)) public (substring public (match-beginning 1) (match-end 1))) (setq public nil))) (cond ((and rgx public (goto-char (point-min)) (re-search-forward "^From: \\([^ \n]+\\)[ \n]" nil t) (string-match rgx (buffer-substring (match-beginning 1) (match-end 1)))) (cons public 3)) (private (cons private (- 1 (if source -1 0) (if (string-match bbdb/gnus-split-myaddr-regexp mail) 1 0)))) (t (cons bbdb/gnus-split-default-group (cond ((string-match bbdb/gnus-split-myaddr-regexp mail) 0) (source 2) (bbdb/gnus-split-crosspost-default 1) (t 0)))))) (error (cons bbdb/gnus-split-default-group 0)))) ;; ;; Imap support (Uwe Brauer) ;; (defun bbdb/gnus-nnimap-folder-list-from-bbdb () "Return a list of \( \"From\" mail-regexp imap-folder-name\) tuples based on the contents of the bbdb. The folder-name is the value of the 'imap attribute of the BBDB record; the mail-regexp consists of all the mail addresses for the BBDB record concatenated with OR. Records without an 'imap attribute are ignored. Here is an example of a relevant BBDB record: Uwe Brauer mail: oub@mat.ucm.es imap: testimap This function uses `regexp-opt' to generate the mail-regexp which automatically `regexp-quote's its arguments. Please note: in order that this will work with the `nnimap-split-fancy' method you have to use macros, that is your setting will look like: \(setq nnimap-split-rule 'nnimap-split-fancy nnimap-split-inbox \"INBOX\" nnimap-split-fancy `\(| ,@\(bbdb/gnus-nnimap-folder-list-from-bbdb\) ... \)\) Note that `\( is the backquote, NOT the quote '\(." (let (;; the value of the 'imap attribute of a bbdb record folder-attr ;; a regexp matching all the mail addresses from a bbdb record mail-regexp ;; the list of (folder mail) tuples to return new-elmnt-list) ;; Loop over BBDB records. If an imap attribute exists for ;; the record, generate a regexp matching all the mail addresses ;; and add a tuple (folder mail-regexp) to the new-elmnt-list (dolist (record (bbdb-records)) (when (setq folder-attr (bbdb-record-xfield record 'imap)) (setq mail-regexp (regexp-opt (mapcar 'downcase (bbdb-record-mail record)))) (unless (string= "" mail-regexp) (push (list "From" mail-regexp folder-attr) new-elmnt-list)))) new-elmnt-list)) ;; ;; Insinuation ;; ;;;###autoload (defun bbdb-insinuate-gnus () "Hook BBDB into Gnus. Do not call this in your init file. Use `bbdb-initialize'." ;; `bbdb-mua-display-sender' fails in *Article* buffers, where ;; `gnus-article-read-summary-keys' provides an additional wrapper ;; that restores the window configuration. (define-key gnus-summary-mode-map ":" 'bbdb-mua-display-sender) (define-key gnus-article-mode-map ":" 'bbdb-mua-display-sender) ;; For `bbdb-mua-edit-field-sender' it is probably OK if ;;`gnus-article-read-summary-keys' restores the window configuration. (define-key gnus-summary-mode-map ";" 'bbdb-mua-edit-field-sender) (define-key gnus-article-mode-map ";" 'bbdb-mua-edit-field-sender) ;; Do we need keybindings for more commands? Suggestions welcome. ;; (define-key gnus-summary-mode-map ":" 'bbdb-mua-display-records) ;; (define-key gnus-summary-mode-map "'" 'bbdb-mua-display-recipients) ;; (define-key gnus-summary-mode-map ";" 'bbdb-mua-edit-field-recipients) ;; Set up user field for use in `gnus-summary-line-format' ;; (1) Big solution: use whole name (if bbdb-mua-summary-unify-format-letter (fset (intern (concat "gnus-user-format-function-" bbdb-mua-summary-unify-format-letter)) (lambda (header) (bbdb-mua-summary-unify (mail-header-from header))))) ;; (2) Small solution: a mark for messages whos sender is in BBDB. (if bbdb-mua-summary-mark-format-letter (fset (intern (concat "gnus-user-format-function-" bbdb-mua-summary-mark-format-letter)) (lambda (header) (bbdb-mua-summary-mark (mail-header-from header))))) ;; Scoring (add-hook 'bbdb-after-change-hook 'bbdb/gnus-score-invalidate-alist)) ;; (setq gnus-score-find-score-files-function ;; (if (boundp 'gnus-score-find-score-files-function) ;; (cond ((functionp gnus-score-find-score-files-function) ;; (list gnus-score-find-score-files-function 'bbdb/gnus-score)) ;; ((listp gnus-score-find-score-files-function) ;; (append gnus-score-find-score-files-function 'bbdb/gnus-score)) ;; (t 'bbdb/gnus-score)) ;; 'bbdb/gnus-score)) (provide 'bbdb-gnus) bbdb-3.1.2/lisp/bbdb-migrate.el0000644000175000017500000003263112261714070013144 00000000000000;;; bbdb-migrate.el --- migration functions for BBDB ;; Copyright (C) 1991, 1992, 1993, 1994 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains the migration functions for BBDB. ;;; See the BBDB info manual for documentation. (require 'bbdb) ;;; Migrating the BBDB ;; Unused (defconst bbdb-migration-features '((3 . "* Date format for `creation-date' and `timestamp' has changed, from \"dd mmm yy\" (ex: 25 Sep 97) to \"yyyy-mm-dd\" (ex: 1997-09-25).") (4 . "* Country field added.") (5 . "* More flexible street address.") (6 . "* postcodes are stored as plain strings.") (7 . "* Xfields is always a list. Organizations are stored as list. New field `affix'.")) "BBDB Features that have changed in various database revisions. Format ((VERSION . DIFFERENCES) ... ).") (defun bbdb-peel-the-onion (lis) "Remove outer layers of parens around singleton lists. This is done until we get a list which is either not a singleton list or does not contain a list. This is a utility function used in recovering slightly munged old BBDB files." (while (and (consp lis) (null (cdr lis)) (listp (car lis))) (setq lis (car lis))) lis) ;;;###autoload (defun bbdb-migrate (records old-format) "Migrate the BBDB from the version on disk to the current version \(in `bbdb-file-format')." ;; Some BBDB files were corrupted by random outer layers of ;; parentheses surrounding the actual correct data. We attempt to ;; compensate for this. (setq records (bbdb-peel-the-onion records)) ;; Add new field `affix'. (if (< old-format 7) (let ((temp records) record) (while (setq record (car temp)) (setcar temp (vector (elt record 0) (elt record 1) nil (elt record 2) (elt record 3) (elt record 4) (elt record 5) (elt record 6) (elt record 7) (elt record 8))) (setq temp (cdr temp))))) (mapc (bbdb-migrate-versions-lambda old-format) records) records) (defconst bbdb-migration-spec '((2 (bbdb-record-xfields bbdb-record-set-xfields bbdb-migrate-change-dates)) (3 (bbdb-record-address bbdb-record-set-address bbdb-migrate-add-country-field)) (4 (bbdb-record-address bbdb-record-set-address bbdb-migrate-streets-to-list)) (5 (bbdb-record-address bbdb-record-set-address bbdb-migrate-postcodes-to-strings)) (6 (bbdb-record-xfields bbdb-record-set-xfields bbdb-migrate-xfields-to-list) (bbdb-record-organization bbdb-record-set-organization bbdb-migrate-organization-to-list))) "The alist of (version . migration-spec-list). See `bbdb-migrate-record-lambda' for details.") (defun bbdb-migrate-record-lambda (changes) "Return a function which will migrate a single record. CHANGES is a `migration-spec-list' containing entries of the form (GET SET FUNCTION) where GET is the function to be used to retrieve the field to be modified, and SET is the function to be used to set the field to be modified. FUNCTION will be applied to the result of GET, and its results will be saved with SET." (byte-compile `(lambda (record) ,@(mapcar (lambda (ch) `(,(cadr ch) record (,(car (cddr ch)) (,(car ch) record)))) changes) record))) (defun bbdb-migrate-versions-lambda (v0) "Return the function to migrate from V0 to `bbdb-file-format'." (let (spec) (while (< v0 bbdb-file-format) (setq spec (append spec (cdr (assoc v0 bbdb-migration-spec))) v0 (1+ v0))) (bbdb-migrate-record-lambda spec))) (defun bbdb-migrate-postcodes-to-strings (addresses) "Make all postcodes plain strings. This uses the code that used to be in `bbdb-address-postcode'." ;; apply the function to all addresses in the list and return a ;; modified list of addresses (mapcar (lambda (address) (let ((postcode (if (stringp (bbdb-address-postcode address)) (bbdb-address-postcode address) ;; if not a string, make it a string... (if (consp (bbdb-address-postcode address)) ;; if a cons cell with two strings (if (and (stringp (car (bbdb-address-postcode address))) (stringp (car (cdr (bbdb-address-postcode address))))) ;; if the second string starts with 4 digits (if (string-match "^[0-9][0-9][0-9][0-9]" (car (cdr (bbdb-address-postcode address)))) (concat (car (bbdb-address-postcode address)) "-" (car (cdr (bbdb-address-postcode address)))) ;; if ("abc" "efg") (concat (car (bbdb-address-postcode address)) " " (car (cdr (bbdb-address-postcode address))))) ;; if ("SE" (123 45)) (if (and (stringp (nth 0 (bbdb-address-postcode address))) (consp (nth 1 (bbdb-address-postcode address))) (integerp (nth 0 (nth 1 (bbdb-address-postcode address)))) (integerp (nth 1 (nth 1 (bbdb-address-postcode address))))) (format "%s-%d %d" (nth 0 (bbdb-address-postcode address)) (nth 0 (nth 1 (bbdb-address-postcode address))) (nth 1 (nth 1 (bbdb-address-postcode address)))) ;; if a cons cell with two numbers (if (and (integerp (car (bbdb-address-postcode address))) (integerp (car (cdr (bbdb-address-postcode address))))) (format "%05d-%04d" (car (bbdb-address-postcode address)) (car (cdr (bbdb-address-postcode address)))) ;; else a cons cell with a string an a number (possible error ;; if a cons cell with a number and a string -- note the ;; order!) (format "%s-%d" (car (bbdb-address-postcode address)) (car (cdr (bbdb-address-postcode address))))))) ;; if nil or zero (if (or (zerop (bbdb-address-postcode address)) (null (bbdb-address-postcode address))) "" ;; else a number, could be 3 to 5 digits (possible error: assuming ;; no leading zeroes in postcodes) (format "%d" (bbdb-address-postcode address))))))) (bbdb-address-set-postcode address postcode)) address) addresses)) (defun bbdb-migrate-change-dates (record) "Change date formats. Formats are changed in timestamp and creation-date fields from \"dd mmm yy\" to \"yyyy-mm-dd\"." (unless (stringp record) (mapc (lambda (rr) (when (memq (car rr) '(creation-date timestamp)) (bbdb-migrate-change-dates-change-field rr))) record) record)) (defun bbdb-migrate-change-dates-change-field (field) "Migrate the date field (the cdr of FIELD) from \"dd mmm yy\" to \"yyyy-mm-dd\"." (let ((date (cdr field)) parsed) ;; Verify and extract - this is fairly hideous (and (equal (setq parsed (timezone-parse-date (concat date " 00:00:00"))) ["0" "0" "0" "0" nil]) (equal (setq parsed (timezone-parse-date date)) ["0" "0" "0" "0" nil]) (cond ((string-match "^\\([0-9]\\{4\\}\\)[-/]\\([ 0-9]?[0-9]\\)[-/]\\([ 0-9]?[0-9]\\)" date) (setq parsed (vector (string-to-number (match-string 1 date)) (string-to-number (match-string 2 date)) (string-to-number (match-string 3 date)))) ;; This should be fairly loud for GNU Emacs users (bbdb-warn "BBDB is treating %s field value %s as %s %d %d" (car field) (cdr field) (upcase-initials (downcase (car (rassoc (aref parsed 1) timezone-months-assoc)))) (aref parsed 2) (aref parsed 0))) ((string-match "^\\([ 0-9]?[0-9]\\)[-/]\\([ 0-9]?[0-9]\\)[-/]\\([0-9]\\{4\\}\\)" date) (setq parsed (vector (string-to-number (match-string 3 date)) (string-to-number (match-string 1 date)) (string-to-number (match-string 2 date)))) ;; This should be fairly loud for GNU Emacs users (bbdb-warn "BBDB is treating %s field value %s as %s %d %d" (car field) (cdr field) (upcase-initials (downcase (car (rassoc (aref parsed 1) timezone-months-assoc)))) (aref parsed 2) (aref parsed 0))) (t ["0" "0" "0" "0" nil]))) ;; I like numbers (and (stringp (aref parsed 0)) (aset parsed 0 (string-to-number (aref parsed 0)))) (and (stringp (aref parsed 1)) (aset parsed 1 (string-to-number (aref parsed 1)))) (and (stringp (aref parsed 2)) (aset parsed 2 (string-to-number (aref parsed 2)))) ;; Sanity check (cond ((and (< 0 (aref parsed 0)) (< 0 (aref parsed 1)) (>= 12 (aref parsed 1)) (< 0 (aref parsed 2)) (>= (timezone-last-day-of-month (aref parsed 1) (aref parsed 0)) (aref parsed 2))) (setcdr field (format "%04d-%02d-%02d" (aref parsed 0) (aref parsed 1) (aref parsed 2))) field) (t (error "BBDB cannot parse %s header value %S for upgrade" field date))))) (defun bbdb-migrate-add-country-field (addrl) "Add a country field to each address in the address list." (mapcar (lambda (address) (vconcat address [""])) addrl)) (defun bbdb-migrate-streets-to-list (addrl) "Convert the streets to a list." (mapcar (lambda (address) (vector (aref address 0) ; tag (delq nil (delete "" ; nuke empties (list (aref address 1) ; street1 (aref address 2) ; street2 (aref address 3))));street3 (aref address 4) ; city (aref address 5) ; state (aref address 6) ; postcode (aref address 7))) ; country addrl)) (defun bbdb-migrate-xfields-to-list (xfields) "Migrate XFIELDS to list." (if (stringp xfields) (list (cons 'notes xfields)) xfields)) (defun bbdb-migrate-organization-to-list (organization) "Migrate ORGANIZATION to list." (if (stringp organization) (bbdb-split 'organization organization) organization)) ;;;###autoload (defun bbdb-undocumented-variables (&optional name-space message) "Return list of undocumented variables in NAME-SPACE. NAME-SPACE defaults to \"bbdb-\". Use a prefix arg to specify NAME-SPACE interactively. If MESSAGE is non-nil (as in interactive calls) display the list in the message area. This command may come handy to identify BBDB variables in your init file that are not used anymore by the current version of BBDB. Yet this fails for outdated BBDB variables that are set via your personal `custom-file'." (interactive (list (if current-prefix-arg (read-string "Name space: ")) t)) (let ((re (concat "\\`" (or name-space "bbdb-"))) list) (mapatoms (lambda (vv) (if (and (boundp vv) (string-match re (symbol-name vv)) (not (get vv 'variable-documentation))) (push vv list)))) (if message (if list (apply 'message (concat "Undocumented variables: " (mapconcat (lambda (m) "%s") list " ")) list) (message "No undocumented variables `%s...'" name-space))) list)) (provide 'bbdb-migrate) bbdb-3.1.2/lisp/bbdb-site.el.in0000644000175000017500000000234612310142360013055 00000000000000;;; bbdb-site.el.in --- site-specific variables for BBDB ;; Copyright (C) 2013-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Code: (defconst bbdb-version "@PACKAGE_VERSION@" "Version of BBDB.") (if (< emacs-major-version 23) (error "BBDB %s requires GNU Emacs 23 or later" bbdb-version)) (defconst bbdb-version-date "@PACKAGE_DATE@" "Version date of BBDB.") (defcustom bbdb-print-tex-path '("@pkgdatadir@") "List of directories with the BBDB tex files." :group 'bbdb-utilities-print :type '(repeat (directory :tag "Directory"))) (provide 'bbdb-site) bbdb-3.1.2/lisp/bbdb-rmail.el0000644000175000017500000001101112261714067012613 00000000000000;;; bbdb-rmail.el --- BBDB interface to Rmail ;; Copyright (C) 1991, 1992 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;;; This file contains the BBDB interface to Rmail. ;;; See the BBDB info manual for documentation. (require 'bbdb) (require 'bbdb-com) (require 'bbdb-mua) (require 'rmail) (require 'rmailsum) (require 'mailheader) (defcustom bbdb/rmail-update-records-p (lambda () (let ((bbdb-update-records-p (if (bbdb/rmail-new-flag) 'query 'search))) (bbdb-select-message))) "How `bbdb-mua-update-records' processes mail addresses in Rmail. This Rmail-specific variable is normally not used. It is a fallback if the generic (MUA-independent) variables `bbdb-mua-auto-update-p', `bbdb-update-records-p' or `bbdb-mua-update-interactive-p' result in a value of nil for the arg UPDATE-P of `bbdb-update-records'. Allowed values are: nil Do nothing. search Search for existing records. update Search for existing records, update if necessary. query Update existing records or query for creating new ones. create or t Update existing records or create new ones. a function This functions will be called with no arguments. It should return one of the above values." :group 'bbdb-mua-rmail :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" (lambda () (let ((bbdb-update-records-p 'search)) (bbdb-select-message)))) (const :tag "update existing records" (lambda () (let ((bbdb-update-records-p 'update)) (bbdb-select-message)))) (const :tag "query annotation of all messages" (lambda () (let ((bbdb-update-records-p 'query)) (bbdb-select-message)))) (const :tag "annotate (query) only new messages" (lambda () (let ((bbdb-update-records-p (if (bbdb/rmail-new-flag) 'query 'search))) (bbdb-select-message)))) (const :tag "annotate all messages" (lambda () (let ((bbdb-update-records-p 'create)) (bbdb-select-message)))) (const :tag "accept messages" bbdb-accept-message) (const :tag "ignore messages" bbdb-ignore-message) (const :tag "select messages" bbdb-select-message) (sexp :tag "user defined function"))) (defun bbdb/rmail-new-flag () "Returns t if the current message in buffer BUF is new." (rmail-message-labels-p rmail-current-message ", ?\\(unseen\\),")) (defun bbdb/rmail-header (header) "Pull HEADER out of Rmail header." (with-current-buffer rmail-buffer (if (fboundp 'rmail-get-header) ; Emacs 23 (rmail-get-header header) (save-restriction (with-no-warnings (rmail-narrow-to-non-pruned-header)) (mail-header (intern-soft (downcase header)) (mail-header-extract)))))) ;;;###autoload (defun bbdb-insinuate-rmail () "Hook BBDB into RMAIL. Do not call this in your init file. Use `bbdb-initialize'." ;; Do we need keybindings for more commands? Suggestions welcome. ;; (define-key rmail-mode-map ":" 'bbdb-mua-display-records) ;; (define-key rmail-mode-map "'" 'bbdb-mua-display-recipients) (define-key rmail-mode-map ":" 'bbdb-mua-display-sender) (define-key rmail-mode-map ";" 'bbdb-mua-edit-field-sender) ;; (define-key rmail-mode-map ";" 'bbdb-mua-edit-field-recipients) (define-key rmail-summary-mode-map ":" 'bbdb-mua-display-sender) (define-key rmail-summary-mode-map ";" 'bbdb-mua-edit-field-sender)) (provide 'bbdb-rmail) bbdb-3.1.2/lisp/Makefile.am0000644000175000017500000000647212311673751012351 00000000000000# lisp/Makefile.am for BBDB # # Copyright (C) 2010-2014 Roland Winkler # Author: Roland Winkler # Christian Egli # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . dist_lisp_LISP = \ bbdb.el \ bbdb-anniv.el \ bbdb-com.el \ bbdb-gnus.el \ bbdb-ispell.el \ bbdb-message.el \ bbdb-mhe.el \ bbdb-migrate.el \ bbdb-mua.el \ bbdb-pgp.el \ bbdb-print.el \ bbdb-rmail.el \ bbdb-sc.el \ bbdb-snarf.el \ bbdb-site.el if VM dist_lisp_LISP += bbdb-vm.el # We use the Automake variable AM_ELCFLAGS to include the VM lisp directory # in the Emacs load path when compiling BBDB with VM support. endif lisp_DATA = bbdb-loaddefs.el MOSTLYCLEANFILES = bbdb-loaddefs.el CLEANFILES = bbdb-site.el bbdb-pkg.el # The Emacs function define-package is not autoloaded. # So we assume we need not compile bbdb-pkg.el (which otherwise # results in a compiler warning that define-package is not defined). EXTRA_DIST = bbdb-site.el.in bbdb-pkg.el makefile-temp bbdb-loaddefs.el: $(dist_lisp_LISP) # 2011-12-11: We switched from bbdb-autoloads.el to bbdb-loaddefs.el. # If the user still has an old bbdb-autoloads.el in the BBDB # lisp directory (and keeps loading it from the emacs init file), # we might get strange error messages that things fail. # So we throw an error if these old files are found. @if test -f bbdb-autoloads.el -o -f bbdb-autoloads.elc; then \ (echo "*** ERROR: Old file(s) \`bbdb-autoloads.el(c)' found ***" ; \ echo "*** Delete these files; do not load them from your init file ***") && \ false ; \ fi @echo "(provide 'bbdb-loaddefs)" > $@; @echo "(if (and load-file-name (file-name-directory load-file-name))" >> $@; @echo " (add-to-list 'load-path (file-name-directory load-file-name)))" >> $@; @echo " " >> $@; # Generated autoload-file must have an absolute path, # $srcdir can be relative. $(EMACS) -batch -l autoload \ --eval '(setq generated-autoload-file "'$(abs_builddir)/$@'")' \ --eval '(setq make-backup-files nil)' \ -f batch-update-autoloads $(srcdir) # Generate bbdb-site.el here as pkgdatadir is only known at "make" time. # We protect the autoconf variables in the sed regular expressions # so as not to substitute them when processing Makefile.am. # Warning: the sed expressions will break if PACKAGE_VERSION, PACKAGE_DATE, # or pkgdatadir contain '='. bbdb-site.el: $(top_builddir)/config.status bbdb-site.el.in sed -e "s=[@]pkgdatadir[@]=$(pkgdatadir)=" \ -e "s=[@]PACKAGE_VERSION[@]=$(PACKAGE_VERSION)=" \ -e "s=[@]PACKAGE_DATE[@]=$(PACKAGE_DATE)=" \ < $@.in > $@ # Be sure bbdb-site.el exists early for "(require 'bbdb-site)" BUILT_SOURCES = bbdb-site.el bbdb-3.1.2/lisp/bbdb-sc.el0000644000175000017500000002124712261714066012127 00000000000000;;; bbdb-sc.el --- BBDB interface to Supercite ;; Copyright (C) 1991, 1992 Jamie Zawinski . ;; Copyright (C) 2010-2014 Roland Winkler ;; This file is part of the Insidious Big Brother Database (aka BBDB), ;; BBDB is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; BBDB is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with BBDB. If not, see . ;;; Commentary: ;; This file contains the BBDB interface to Supercite (sc) ;; This file was written by Martin Sjolin ;; based on the original code by Tom Tromey . ;; Thanks to Richard Stanton for ideas ;; for improvements and to Michael D. Carney ;; for testing and feedback. ;; This file adds the ability to define attributions for Supercite in BBDB ;; and it enables you to retrieve your standard attribution from BBDB. ;; If the From header in the mail message to which you are replying only ;; contains the mail address, the sender's name is looked up in BBDB. ;; The attribution is stored in the xfield `attribution' (unless you ;; have changed `bbdb-sc-attribution-field'). ;; To enable supercite support for BBDB, call `bbdb-initialize' with arg `sc'. ;; Also customize supercite as follows: ;; (1) Add element "sc-consult" to `sc-preferred-attribution-list' ;; (note that order matters!), e.g., ;; ;; (setq sc-preferred-attribution-list ;; '("sc-lastchoice" "x-attribution" "sc-consult" ;; "initials" "firstname" "lastname")) ;; ;; (2) The variable `sc-attrib-selection-list' should include an element ;; ;; (add-to-list 'sc-attrib-selection-list ;; '("from" ((".*" . (bbdb-sc-get-attrib ;; (sc-mail-field "from")))))) ;; ;; (3) Set `sc-mail-glom-frame' as follows to fetch the sender's name from BBDB ;; if there is only a plain mail address in the From field of the mail message, ;; e.g., ;; ;; (setq sc-mail-glom-frame ;; '((begin (setq sc-mail-headers-start (point))) ;; ("^From " (sc-mail-check-from) nil nil) ;; ("^x-attribution:[ \t]+.*$" (sc-mail-fetch-field t) nil t) ;; ("^\\S +:.*$" (sc-mail-fetch-field) nil t) ;; ("^$" (list 'abort '(step . 0))) ;; ("^[ \t]+" (sc-mail-append-field)) ;; (sc-mail-warn-if-non-rfc822-p (sc-mail-error-in-mail-field)) ;; (end (progn ;; (bbdb-sc-update-from) ;; (setq sc-mail-headers-end (point)))))) (require 'bbdb-com) (require 'bbdb-mua) (require 'supercite) (defcustom bbdb-sc-attribution-field 'attribution "The BBDB xfield used for Supercite attribution." :group 'bbdb-utilities-sc :type '(symbol :tag "Field name")) (define-obsolete-variable-alias 'bbdb/sc-attribution-field 'bbdb-sc-attribution-field) (defcustom bbdb-sc-update-records-p 'search "How `bbdb-sc-set-attrib' updates BBDB records automatically. This may take the same values as arg UPDATE-P of `bbdb-update-records'." :group 'bbdb-utilities-sc :type '(choice (const :tag "do nothing" nil) (const :tag "search for existing records" search) (const :tag "update existing records" update) (const :tag "query annotation of all messages" query) (const :tag "annotate all messages" create) (function :tag "User-defined function"))) (defcustom bbdb-sc-update-attrib-p 'query "How `bbdb-sc-set-attrib' updates the attribution field. Allowed values include nil Do not create or modify the attribution field query Query before creating or modifying the attribution field. t Create or modify the attribution field." :group 'bbdb-utilities-sc :type '(choice (const "Do nothing" nil) (const "Query before updating the attribution field" query) (const "Update the attribution field" t))) ;;; Internal variables (defvar bbdb-sc-last-attrib "" "Last attribution used by Supercite. Used to compare against citation selected by the user.") (defun bbdb-sc-get-attrib (mail) "Get the Supercite attribution from BBDB. MAIL is the mail address to look for in BBDB." ;; We could store in `sc-mail-info' from which record we grabbed ;; this attribution. Yet we do not know whether `bbdb-sc-set-attrib' ;; will want to use the same record. (let* ((address (bbdb-extract-address-components mail)) (record (bbdb-message-search (car address) (cadr address)))) ;; FIXME: What to do if we have multiple matching records? (when (cdr record) (message "Multiple records match %s" mail) (sit-for 1)) (if record (bbdb-record-field (car record) bbdb-sc-attribution-field)))) (define-obsolete-function-alias 'bbdb/sc-consult-attr 'bbdb-sc-get-attrib) (defun bbdb-sc-set-attrib () "Store attribution in BBDB." (let ((from (bbdb-extract-address-components (sc-mail-field "from"))) (attrib (sc-mail-field "sc-attribution")) bbdb-notice-mail-hook record) (when (and from attrib bbdb-sc-update-attrib-p (not (string-equal attrib bbdb-sc-last-attrib)) (setq record (bbdb-update-records (list from) bbdb-sc-update-records-p))) ;; FIXME: What to do if we have multiple matching records? (when (cdr record) (message "Multiple records match %s" from) (sit-for 1)) (setq record (car record)) (let ((old (bbdb-record-field record bbdb-sc-attribution-field))) ;; Do nothing if the new value equals the old value (when (and (not (and old (string-equal old attrib))) (or (not (eq bbdb-sc-update-attrib-p 'query)) (y-or-n-p (format (if (bbdb-record-field record bbdb-sc-attribution-field) "Change attribution for %s to %s?" "For %s add attribution %s?") (bbdb-record-name record) attrib)))) (bbdb-record-set-field record bbdb-sc-attribution-field attrib) (bbdb-change-record record)))))) (define-obsolete-function-alias 'bbdb/sc-set-attr 'bbdb-sc-set-attrib) ;;;###autoload (defun bbdb-sc-update-from () "Update the \"from\" field in `sc-mail-info'. If the \"from\" field in `sc-mail-info' contains only a plain mail address, complement the \"from\" field in `sc-mail-info' with the sender's name in BBDB." (let* ((from (sc-mail-field "from")) ;; Do not use `bbdb-extract-address-components' that can "invent" names. (address (and from (bbdb-decompose-bbdb-address from))) ;; FIXME: Should we always update the sender's name in `sc-mail-info' ;; if it does not agree with what BBDB says? (record (if (and (cadr address) (not (car address))) (bbdb-message-search nil (cadr address)))) ;; FIXME: What to do if we have multiple matching records? (_ (when (cdr record) (message "Multiple records match %s" from) (sit-for 1))) (name (and record (bbdb-record-name (car record))))) (if name (setcdr (assoc-string "from" sc-mail-info t) (format "%s <%s>" name (cadr address)))))) (define-obsolete-function-alias 'bbdb/sc-default 'bbdb-sc-update-from) ;; Insert our hooks ;; Dammit, supercite! It runs `sc-attribs-postselect-hook' in an ;; environment with the local variable `attribution' that we rely on. (with-no-warnings (defvar attribution)) ;;;###autoload (defun bbdb-insinuate-sc () "Hook BBDB into Supercite. Do not call this in your init file. Use `bbdb-initialize'. However, this is not the full story. See bbdb-sc.el for how to fully hook BBDB into Supercite." (add-hook 'sc-post-hook 'bbdb-sc-set-attrib) (add-hook 'sc-attribs-postselect-hook (lambda () (setq bbdb-sc-last-attrib (if sc-downcase-p (downcase attribution) attribution))))) (provide 'bbdb-sc) ;;; end of bbdb-sc.el bbdb-3.1.2/aclocal.m40000644000175000017500000007266712327261571011217 00000000000000# generated automatically by aclocal 1.14 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PATH_LISPDIR # --------------- AC_DEFUN([AM_PATH_LISPDIR], [AC_PREREQ([2.60])dnl # If set to t, that means we are running in a shell under Emacs. # If you have an Emacs named "t", then use the full path. test x"$EMACS" = xt && EMACS= AC_CHECK_PROGS([EMACS], [emacs xemacs], [no]) AC_ARG_VAR([EMACS], [the Emacs editor command]) AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path]) AC_ARG_WITH([lispdir], [AS_HELP_STRING([--with-lispdir], [override the default lisp directory])], [ lispdir="$withval" AC_MSG_CHECKING([where .elc files should go]) AC_MSG_RESULT([$lispdir])], [ AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [ if test $EMACS != "no"; then if test x${lispdir+set} != xset; then # If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly # Some emacsen will start up in interactive mode, requiring C-x C-c to exit, # which is non-obvious for non-emacs users. # Redirecting /dev/null should help a bit; pity we can't detect "broken" # emacsen earlier and avoid running this altogether. AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' conftest.out]) am_cv_lispdir=`sed -n \ -e 's,/$,,' \ -e '/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}' \ -e '/.*\/share\/x*emacs\/site-lisp$/{s,.*/share/\(x*emacs/site-lisp\),${datarootdir}/\1,;p;q;}' \ conftest.out` rm conftest.out fi fi test -z "$am_cv_lispdir" && am_cv_lispdir='${datadir}/emacs/site-lisp' ]) lispdir="$am_cv_lispdir" ]) AC_SUBST([lispdir]) ])# AM_PATH_LISPDIR # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/emacs_vm.m4]) m4_include([m4/package_date.m4]) bbdb-3.1.2/ChangeLog0000644000175000017500000022437012327260701011111 000000000000002014-04-27 Roland Winkler * configure.ac: Increase BBDB version number to 3.1.2. * NEWS: Update for release. 2014-04-12 Roland Winkler Be more careful that empty strings do not pollute the data base. * lisp/bbdb.el (bbdb-list-strings): New function. (bbdb-record-set-field): Use it. (bbdb-record-set-xfield): Clean up. * lisp/bbdb-com.el (bbdb-fix-records): New command. (bbdb-read-organization, bbdb-complete-mail): Check emacs version properly. 2014-04-12 Roland Winkler Check type of record data structures more carefully. * lisp/bbdb.el (bbdb-check-type): Simplify. New arg `extended'. * lisp/bbdb-com.el (bbdb-create-internal): Bug fix. 2014-04-12 Barak A. Pearlmutter * lisp/Makefile.am: Include makefile-temp in distribution. 2014-04-12 Roland Winkler * lisp/bbdb-site.el.in: Be more verbose about what we want. 2014-04-12 Roland Winkler * lisp/makefile-temp: Obey proper dependencies. Clean up. 2014-04-12 Roland Winkler * lisp/bbdb-vm.el, m4/emacs_vm.m4: Require vm-autoloads. 2014-04-12 Roland Winkler * lisp/bbdb.el (bbdb-separator-alist): Treat AKAs consistent with other fields. 2014-03-11 Barak A. Pearlmutter Generate lisp/bbdb-site.el via lisp/Makefile as pkgdatadir is only known at "make" time. * configure.ac: Remove lisp/bbdb-site.el from autoconfig files. Increase BBDB version number to 3.1.1 * lisp/Makefile.am: Generate lisp/bbdb-site.el. * lisp/bbdb-site.el.in: Initialize bbdb-print-tex-path with a placeholder for pkgdatadir. 2014-03-11 Barak A. Pearlmutter * Makefile.am: Install files COPYING, ChangeLog, AUTHORS, NEWS, README, and TODO in the doc directory. * doc/Makefile.am: Install bbdb.pdf in the doc directory. 2014-03-11 Barak A. Pearlmutter * m4/package_date.m4: Use "date -u" if "date --rfc-3339" fails. 2014-02-28 Roland Winkler * configure.ac: Increase BBDB version number to 3.1. * README: Update accordingly. Fix typos. * Makefile.am: Include autogen.sh in distribution. * lisp/Makefile.am: Include lisp/bbdb-pkg.el in distribution. * lisp/makefile-temp: Include lisp/bbdb-pkg.el. 2014-02-28 Roland Winkler Do not use `prompt' in a non-emacs sense. * lisp/bbdb.el: Do not autoload bbdb-search and bbdb-search-prompt when compiling. (bbdb-auto-revert, bbdb-silent, bbdb-default-domain) (bbdb-default-area-code, bbdb-offer-to-create) (bbdb-update-records-address): Fix docstring. * lisp/bbdb-com.el (bbdb-search-read): Renamed from bbdb-search-prompt. (bbdb, bbdb-search-name, bbdb-search-organization) (bbdb-search-address, bbdb-search-mail, bbdb-search-phone) (bbdb-search-xfields): Change accordingly. (bbdb-read-record, bbdb-create, bbdb-completing-read-records): Fix docstring. (bbdb-read-field): Renamed from bbdb-prompt-for-new-field. Use arg flag instead of current-prefix-arg. Add docstring. (bbdb-insert-field): Change accordingly. Fix docstring. (bbdb-edit-foo): Change accordingly. * lisp/bbdb-mua.el (bbdb-query-create): Renamed from bbdb-prompt-for-create. (bbdb-update-records) * lisp/bbdb.el (bbdb-insert-field-menu): Change accordingly. 2014-02-28 Roland Winkler * lisp/bbdb.el: Do not autoload bbdb-search and bbdb-search-prompt when compiling. (bbdb-address-format-list, bbdb-buffer, bbdb-revert-buffer) * lisp/bbdb-com.el (bbdb-complete-mail): Fix docstring. 2014-02-17 Roland Winkler * lisp/bbdb-mua.el (bbdb-update-records): If value of arg update-p is a function, evaluate it repeatedly as many times as needed. 2014-02-16 Roland Winkler * lisp/bbdb-mua.el (bbdb-update-records): Bug fix for previous commit. Allow value of update-p being create, too. 2014-02-15 Roland Winkler * lisp/bbdb-mua.el (bbdb-update-records): Always evaluate arg update-p twice if its value is a function. 2014-01-23 Roland Winkler * lisp/bbdb.el (bbdb-puthash, bbdb-record-set-xfield) (bbdb-record-set-field, bbdb-parse-records, bbdb-change-record): Bugfix, make 'eq the 4th arg of add-to-list. 2014-01-23 Stefan Monnier * lisp/bbdb.el (bbdb-read-string): In minibuffer-local-completion-map remove the binding of SPC to minibuffer-complete-word and of ? to minibuffer-completion-help. 2014-01-12 Roland Winkler * lisp/bbdb.el (bbdb-pop-up-window-simple): New function. (bbdb-pop-up-window): Use it. Make sure the *BBDB* buffer exists. Use display-buffer as an alternative to pop-up-buffer if the *BBDB* buffer is not selected. Use the tallest window even if bbdb-pop-up-window-size is 1.0. (bbdb-pop-up-window-size): Fix docstring accordingly. * lisp/bbdb-com.el (bbdb-complete-mail-cleanup): Do not call bbdb-pop-up-window before we created for sure the *BBDB* buffer. 2014-01-12 Roland Winkler Provide auto completion for streets and postcodes known to BBDB. * lisp/bbdb.el (bbdb-street-list, bbdb-postcode-list): New internal variables. (bbdb-record-set-xfield, bbdb-parse-records) * lisp/bbdb-com.el (bbdb-record-edit-address) (bbdb-edit-address-default): Use them. 2014-01-08 Roland Winkler * lisp/bbdb.el (bbdb-canonical-hosts, bbdb-canonicalize-mail-1) (bbdb-message-clean-name-default): Move here from bbdb-mua.el. 2014-01-08 Roland Winkler Provide auto completion for cities, states and countries known to BBDB. * lisp/bbdb.el (bbdb-city-list, bbdb-state-list) (bbdb-country-list): New internal variables. (bbdb-add-to-list): New function. (bbdb-puthash, bbdb-merge-concat-remove-duplicates) (bbdb-change-record): Use add-to-list. (bbdb-record-set-xfield, bbdb-parse-records): Use add-to-list and bbdb-add-to-list. Collect cities, states and countries known to BBDB. * lisp/bbdb-com.el (bbdb-record-edit-address) (bbdb-edit-address-default): Provide auto completion for cities, states and countries. 2014-01-03 Roland Winkler Update copyright year in all files. 2014-01-03 Roland Winkler Avoid hard-coded references to xfield notes. * lisp/bbdb.el (bbdb-default-xfield, bbdb-edit-foo) (bbdb-annotate-field, bbdb-mua-edit-field): New variables. (bbdb-auto-notes-rules): Fix docstring. * lisp/bbdb-com.el (bbdb-edit-foo): New command. (bbdb-search, bbdb-read-record): Use bbdb-default-xfield. (bbdb-insert-field): Do not handle initial value. (bbdb-prompt-for-new-field): Replace arg init by arg record to handle initial value here. * lisp/bbdb.el (bbdb-insert-field-menu): Change accordingly. * lisp/bbdb-mua.el (bbdb-annotate-record): Use bbdb-annotate-field. Allow empty strings for removing an xfield. (bbdb-mua-annotate-field-interactive): New function. (bbdb-mua-annotate-sender, bbdb-mua-annotate-recipients): Use it. New optional arg field. (bbdb-mua-edit-field-interactive, bbdb-mua-edit-field) (bbdb-mua-edit-field-sender, bbdb-mua-edit-field-recipients): Use variable bbdb-mua-edit-field. (bbdb-mua-edit-field-recipients): Use bbdb-default-xfield. * lisp/bbdb-snarf.el (bbdb-snarf-notes): Use bbdb-default-xfield. 2014-01-03 Roland Winkler After editing always update display in all BBDB buffers. * lisp/bbdb.el (bbdb-delete-record-internal): Rename optional arg remhash to completely. Undisplay record if non-nil. (bbdb-maybe-update-display): Update record in all BBDB buffers. (bbdb-change-record): Call it. (bbdb-redisplay-records): Remove. (bbdb-undisplay-records): New optional arg all-buffers. (bbdb-revert-buffer): Use it. * lisp/bbdb-com.el (bbdb-insert-field, bbdb-transpose-fields) (bbdb-delete-field-or-record, bbdb-delete-records) (bbdb-merge-records, bbdb-sort-addresses, bbdb-sort-phones) (bbdb-sort-xfields, bbdb-add-mail-alias) * lisp/bbdb-mua.el (bbdb-mua-edit-field): Do not call bbdb-maybe-update-display. * README: update accordingly. 2014-01-03 Roland Winkler Clean up supercite support. * lisp/bbdb.el (bbdb-utilities-sc): New custom group (bbdb-initialize): Update docstring. * lisp/bbdb-sc.el: Update doc. (bbdb-sc-attribution-field): Rename from bbdb/sc-attribution-field, keeping the old name as obsolete alias. (bbdb-sc-update-records-p): New variable. (bbdb-sc-update-attrib-p): Rename from bbdb/sc-replace-attr-p. (bbdb-sc-last-attrib): Rename from bbdb/sc-last-attribution. Make it internal variable. (bbdb-sc-set-attrib): Rename from bbdb/sc-set-attr, keeping the old name as obsolete alias. (bbdb-sc-update-from): Rename from bbdb/sc-default, keeping the old name as obsolete alias. 2014-01-03 Roland Winkler Overhaul lisp/bbdb-pgp.el for BBDB 3. * lisp/bbdb-pgp.el (bbdb-pgp-field): Rename from bbdb/pgp-field. (bbdb-pgp-default): Rename from bbdb/pgp-default-action. (bbdb-pgp-ranked-actions, bbdb-pgp-headers) (bbdb-pgp-method-alist): New variables. (bbdb/pgp-quiet): Obsolete. (bbdb-pgp-method): Rename from bbdb/pgp-method. Include support for PGP-auto format. (bbdb-read-xfield-pgp-mail): New function. (bbdb-pgp): Rename from bbdb/pgp-sign. Make it a command. Consider all message recipients in bbdb-pgp-headers. Use bbdb-pgp-ranked-actions, bbdb-pgp-headers, and bbdb-pgp-method-alist. * lisp/bbdb.el (bbdb-utilities-pgp): New custom group (bbdb-init-forms): Add init form for bbdb-pgp. (bbdb-initialize): Update docstring accordingly. * lisp/Makefile.am, lisp/makefile-temp: Support lisp/bbdb-pgp.el. 2014-01-03 Gijs Hillenius * lisp/bbdb-pgp.el: Adapt for BBDB 3. Remove outdated mailcrypt interface. (bbdb/pgp-method): New default mml-pgpmime. (bbdb/pgp-get-pgp): Use bbdb-message-search and bbdb-record-field. 2014-01-03 Kevin Davidson * lisp/bbdb-pgp.el: New file (taken from BBDB 2). 2014-01-03 Roland Winkler More flexible editing of xfields. * lisp/bbdb.el (bbdb-read-string): Rename optional arg default to init. New optional arg require-match. * lisp/bbdb-com.el (bbdb-read-organization) (bbdb-record-edit-address, bbdb-completing-read-mails): Rename optional arg default to init. (bbdb-insert-field): Simplify. (bbdb-read-xfield): New function. (bbdb-prompt-for-new-field, bbdb-edit-field): Use it. 2014-01-03 Roland Winkler * lisp/bbdb.el (bbdb-init-forms): Add init form for anniv. (bbdb-initialize): Update docstring accordingly. * lisp/bbdb-anniv.el: Update doc accordingly. 2014-01-03 Roland Winkler Clean up handling of redundant email addresses. * lisp/bbdb.el (bbdb-ignore-redundant-mails): Rename from bbdb-canonicalize-redundant-mails, keeping the latter as obsolete alias. (bbdb-add-mails, bbdb-canonicalize-mail-function): Fix docstring. * lisp/bbdb-com.el (bbdb-mail-redundant-re): New function (bbdb-delete-redundant-mails): Move here from lisp/bbdb-mua.el. Merge with command bbdb-delete-duplicate-mails and make the latter an obsolete alias. New optional args query and update. * lisp/bbdb-mua.el (bbdb-annotate-message): Use bbdb-mail-redundant-re and bbdb-delete-redundant-mails. (bbdb-mail-redundant-p): Remove. (bbdb-canonical-hosts): Update docstring. 2014-01-03 Roland Winkler Check more carefully/frequently that BBDB is editable. * lisp/bbdb.el (bbdb-editable): Move here from lisp/bbdb-com.el. Revert BBDB buffer if possible. * lisp/bbdb.el (bbdb-record-set-field) * lisp/bbdb-com.el (bbdb-read-record, bbdb-create-internal) (bbdb-merge-records, bbdb-sort-addresses, bbdb-sort-phones) (bbdb-sort-xfields) * lisp/bbdb-snarf.el (bbdb-snarf): Check that BBDB is editable. * lisp/bbdb-mua.el (bbdb-update-records): Obey bbdb-read-only. (bbdb-annotate-message): Ignore bbdb-read-only. (bbdb-auto-notes): Check that BBDB is editable. 2014-01-03 Roland Winkler * lisp/bbdb.el (bbdb-check-name, bbdb-extract-address-components): Fix docstring. * lisp/bbdb-com.el (bbdb-search-duplicates): Fix warning message. Sort records. * lisp/bbdb-mua.el (bbdb-auto-notes) (bbdb-mua-update-interactive-p): Fix docstring. 2014-01-03 Roland Winkler Display records for messages more flexibly. * lisp/bbdb-mua.el (bbdb-update-records, bbdb-mua-update-records): New optional arg sort. (bbdb-mua-display-records): New optional arg all. (bbdb-mua-display-all-records): New command. (bbdb-mua-display-all-recipients): Renamed from bbdb-display-all-recipients. 2014-01-03 Roland Winkler Handle new records more carefully. * lisp/bbdb.el (bbdb-empty-record): New function. (bbdb-change-record): Use bbdb-create-hook. Fix docstring. (bbdb-insert-record-internal, bbdb-overwrite-record-internal): Fix docstring. * lisp/bbdb-com.el (bbdb-create): Do not use bbdb-create-hook. (bbdb-create-internal): Make arg name optional and allow a nil value. Check validity of arguments only if new arg check is non-nil. (bbdb-merge-records): Return record. * lisp/bbdb-mua.el (bbdb-annotate-message): Use bbdb-empty-record. Handle case that arg create-p is a function. Do not use bbdb-create-hook. * lisp/bbdb-snarf.el (bbdb-snarf): Use bbdb-empty-record. Return record. Do not use bbdb-create-hook. 2014-01-03 Roland Winkler * lisp/bbdb-snarf.el (bbdb-snarf-rule-interactive): Use symbol-name. 2013-11-16 Roland Winkler * configure.ac: Increase BBDB version number to 3.0.50. 2013-11-16 Christian Egli * Makefile.am: New target elpa. * lisp/bbdb-pkg.el.in: New file for elpa. * configure.ac, .gitignore: Handle it. * lisp/Makefile.am: Define CLEANFILES and EXTRA_DIST. 2013-11-16 Roland Winkler * m4/package_date.m4: Use git log. 2013-11-16 Roland Winkler * lisp/bbdb-sc.el: Fix documentation. (bbdb/sc-consult-attr): Do not use car. (Bug#40398) 2013-11-16 Roland Winkler * lisp/bbdb.el (bbdb-field-menu): Use format. Call bbdb-browse-url for url xfields. (bbdb-mouse-menu): Use format. 2013-11-16 Roland Winkler * lisp/bbdb.el (bbdb-mua-update-interactive-p): Clarify doc string. 2013-11-16 Roland Winkler * lisp/bbdb.el (bbdb-file): Use locate-user-emacs-file. 2013-11-16 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Only complete inside a syntactically correct mail header. 2013-10-06 Roland Winkler * lisp/makefile-temp: Add commentary. Copy bbdb-site.el.in to bbdb-site.el. Clean up. * README: Clean up. 2013-07-28 Roland Winkler * doc/bbdb.texi: Add @dircategory and @direntry. (Bug#38794) 2013-07-28 Roland Winkler * m4/package_date.m4: Use more robust output redirection. (Bug#39579) 2013-07-28 Roland Winkler * m4/emacs_vm.m4: Fix typo. 2013-07-28 Roland Winkler * m4/emacs_vm.m4: Define conditional VM unconditionally. 2013-07-27 Roland Winkler * m4/emacs_vm.m4, m4/package_date.m4: New files. * configure.ac: Use them. Use brackets for AC_PREREQ. Define macro directory. Use Automake options -Wall and gnu. * autgogen.sh: Simplify. Use option --force. * lisp/bbdb-site.el.in: Renamed from lisp/bbdb-version.el.in. Define bbdb-print-tex-path. * lisp/bbdb.el, lisp/bbdb-print.el, lisp/Makefile.am: Update accordingly. * .gitignore: Cover more files. * INSTALL: Remove. Merge with README. * README: Update accordingly. 2013-07-18 Roland Winkler Clean up usage of automake and autoconf. * lisp/bbdb-version.el.in: New file. * lisp/bbdb.el, lisp/Makefile.am: Use it. * configure.ac: Use AC_CONFIG_SRCDIR. Require Automake 1.13. Test for presence of Emacs. Configure lisp/bbdb-version.el. * .gitignore: Ignore aclocal.m4, doc/texinfo.tex, install-sh, lisp/bbdb-version.el, and missing. * aclocal.m4, install-sh: Removed. 2013-07-17 Roland Winkler Use Automake. (Thanks to Christian Egli ) * Makefile.am, lisp/Makefile.am, doc/Makefile.am, tex/Makefile.am, autogen.sh, AUTHORS, NEWS: New files. * Makefile.in, lisp/Makefile.in, doc/Makefile.in, tex/Makefile.in: Removed. * configure.ac: Use automake. * INSTALL: Update accordingly. * .gitignore: Ignore Makefile.in. * lisp/bbdb-print.el (bbdb-print-tex-path): New variable. (bbdb-print): Use it. 2013-07-07 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-auto-update): Use bbdb-pop-up-layout. 2013-07-07 Roland Winkler * lisp/bbdb.el (bbdb-buffer): Simplify. Avoid creating auto-save files for bbdb-file till it contains at least one record. * lisp/bbdb.el (bbdb-revert-buffer): Handle the case that we did not yet create bbdb-file. 2013-07-07 Roland Winkler * lisp/bbdb.el (bbdb-update-records-p): Fix docstring. 2013-05-26 Roland Winkler * configure.ac: Remove option --enable-developer. * lisp/Makefile.in, lisp/makefile-temp: Remove HUSHMAKE and PUSHPATH. Use emacs options --quick and --directory. 2013-05-26 Roland Winkler * aclocal.m4: Convert VM path to absolute and canonicalize it. Use more verbose error message. 2013-05-26 Roland Winkler Use new function bbdb-extract-address-components which honors bbdb-message-clean-name-function and bbdb-canonicalize-mail-function. * lisp/bbdb.el (bbdb-clean-address-components) (bbdb-extract-address-components): New functions. (bbdb-decompose-bbdb-address): Renamed from bbdb-extract-address-components. (bbdb-puthash-mail): Use it. * lisp/bbdb-com.el (bbdb-message-search): Do nothing if both args are nil. (bbdb-complete-mail, bbdb-complete-mail-cleanup): Use bbdb-extract-address-components. * lisp/bbdb-mua.el (bbdb-get-address-components) (bbdb-mua-summary-unify, bbdb-mua-summary-mark): Use bbdb-extract-address-components. (bbdb-canonicalize-mail): Remove. * lisp/bbdb-snarf.el (bbdb-snarf-name-mail) (bbdb-snarf-mail-address): Use bbdb-extract-address-components. * lisp/bbdb-sc.el (bbdb/sc-consult-attr, bbdb/sc-default): Use bbdb-extract-address-components. * lisp/bbdb-vm.el (vm-summary-function-B): Simplify. (bbdb/vm-alternate-full-name): Use bbdb-extract-address-components. 2013-04-21 Leo Liu * lisp/bbdb-mua.el (bbdb-mua-summary-mark): Do not call bbdb-mua-summary-mark-field as a function if it is not a function. 2013-04-13 Roland Winkler * lisp/bbdb.el (bbdb-utilities-snarf): New custom group. * lisp/bbdb-snarf.el: New file. * lisp/Makefile.in, lisp/makefile-temp: Compile it. 2013-04-13 Roland Winkler * lisp/bbdb-com.el (bbdb-merge-records): Fix docstring. Merge also affixes. Do not enforce multi-line layout for display. 2013-04-13 Roland Winkler * lisp/bbdb.el (bbdb-format-address-default, bbdb-format-address): Allow city, postcode, state, and country to be nil. 2013-04-13 Roland Winkler * lisp/bbdb.el (bbdb-hash-record, bbdb-change-record): Fix docstring. 2013-04-13 Roland Winkler * lisp/bbdb.el (bbdb-new-mails-primary): Change default to query. 2013-04-13 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-summary-unify) (bbdb-mua-summary-mark): Allow bbdb-mua-summary-mark-field to be a function. * lisp/bbdb.el (bbdb-mua-summary-mark-field): Fix docstring. 2013-04-13 Roland Winkler * lisp/bbdb.el (bbdb-extract-address-components): New function. (bbdb-puthash-mail): Use it. * lisp/bbdb-com.el (bbdb-dwim-mail): Use it. 2013-04-13 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Simplify. Do not throw error messages that prevent other completion functions to take over. 2013-04-13 Roland Winkler * lisp/bbdb-vm.el (bbdb/vm-auto-folder-field) (bbdb/vm-virtual-folder-field, bbdb/vm-auto-folder) (bbdb/vm-auto-add-label-list, bbdb/vm-auto-add-label-field): Fix docstring. (bbdb/vm-virtual-folder): Check more carefully whether vm-virtual-folder-alist contains already what we want to add. Fix docstring. 2013-04-13 Roland Winkler * lisp/bbdb-sc.el (bbdb/sc-attribution-field): Fix docstring. 2013-04-13 Roland Winkler * tex/Makefile.in: Acknowledge DESTDIR. 2013-02-16 Roland Winkler * lisp/bbdb.el (bbdb-mail-name-format, bbdb-mail-name): New user variables. * lisp/bbdb-com.el (bbdb-dwim-mail): Use them. Always quote the name part of a mail address if necessary. (bbdb-quoted-string-syntax-table): New internal variable. (bbdb-complete-mail): Use it to find starting point for completion. Before proper cycling, reformat the original mail address to match an element of dwim-completions. Use completion-ignore-case instead of downcase. Do not use trimmed pattern. Issue warning message if attempting to create a *Completions* buffer with GNU Emacs older than 23.2. Use the default value of completion-list-insert-choice-function to locally bind this variable. (bbdb-complete-mail-cleanup): New arg beg. Use indent-relative. * lisp/bbdb-print.el (bbdb-print-name-format, bbdb-print-name): New user variables. (bbdb-print-record): Use them, 2013-02-16 Roland Winkler * lisp/bbdb-com.el (bbdb-mail-yank): Bind case-fold-search to t. 2013-02-15 Roland Winkler * lisp/bbdb-com.el (bbdb-delete-field-or-record): Handle multiple records. 2013-02-15 Roland Winkler * lisp/bbdb.el (bbdb-delete-record-internal) (bbdb-insert-record-internal, bbdb-overwrite-record-internal): Use inhibit-quit. 2013-02-15 Roland Winkler * lisp/bbdb.el (bbdb-changed-records, bbdb-hashtable): Doc fix. 2013-02-15 Roland Winkler * lisp/bbdb.el (bbdb-modified): Removed. (bbdb-buffer, bbdb-after-save, bbdb-delete-record-internal) (bbdb-insert-record-internal, bbdb-overwrite-record-internal) (bbdb-sort-records): Do not set bbdb-modified. (bbdb-mode): Use buffer-modified-p. 2013-02-02 Roland Winkler * lisp/bbdb.el (bbdb-mail-user-agent): Use non-nil default taken from mail-user-agent. (bbdb-lastname-re, bbdb-lastname-suffix-re): New user variables. (bbdb-divide-name): Use them. Pass first and last name through bbdb-string-trim. * lisp/bbdb-mua.el (bbdb-canonicalize-mail): Always pass mail through bbdb-string-trim. (bbdb-canonicalize-mail-1): Always pass mail through bbdb-string-trim. (bbdb-canonical-hosts): Use regxp-opt instead of regexp-quote. (bbdb-message-clean-name-default): Re-arrange clean-up steps. Use substring-no-properties. 2013-01-20 Roland Winkler * aclocal.m4: Do not throw an error if tex_dir does not exist. 2013-01-20 Roland Winkler * doc/Makefile.in, tex/Makefile.in: Provide the DESTDIR variable. (Bug#38124) 2013-01-13 Roland Winkler * lisp/bbdb.el (bbdb-parse-records): Set bbdb-xfield-labels-list and bbdb-organization-list to nil only once. 2013-01-13 Roland Winkler Update copyright year in all files. 2013-01-13 Roland Winkler * lisp/bbdb.el (bbdb-organization-list): New variable. (bbdb-record-set-field): Use it. Update bbdb-phone-label-list, bbdb-address-label-list, and bbdb-xfield-label-list. ((bbdb-set-xfield-labels): Removed (bbdb-record-set-xfield): Set bbdb-xfield-labels-list explicitly. (bbdb-label-completion-list): Removed. (bbdb-parse-records): Do not set bbdb-phone-label-list and bbdb-address-label-list in a circular way. Set bbdb-organization-list. * lisp/bbdb-com.el: Require crm. (bbdb-crm-local-completion-map): New variable. (bbdb-read-organization): New function. (bbdb-read-record, bbdb-prompt-for-new-field): Use it. Directly use bbdb-phone-label-list and bbdb-address-label-list. Do not call bbdb-set-xfield-labels, which was redundant. (bbdb-edit-field): Use bbdb-read-organization and bbdb-record-field. (bbdb-record-edit-address): Use bbdb-address-label-list directly. (bbdb-record-edit-phone): Use bbdb-phone-label-list directly. 2012-12-30 Roland Winkler * configure.ac: Option --with-tex-dir renamed from --with-texmf-dir. 2012-12-30 Roland Winkler * lisp/bbdb-sc.el: New file * lisp/Makefile.in, lisp/makefile-temp, lisp/bbdb.el (bbdb-init-forms, bbdb-initialize): Use it. 2012-12-30 Roland Winkler * INSTALL: List all BBDB configure options. * aclocal.m4, tex/Makefile.in: Option --with-tex-dir renamed from --with-texmf-dir. 2012-12-30 Roland Winkler * lisp/bbdb-gnus.el: Do not use eval-and-compile. (bbdb/gnus-split-myaddr-regexp): Do not use obsolete variable gnus-local-domain. (bbdb/gnus-split-private-field, bbdb/gnus-split-public-field): Fix docstring. * lisp/bbdb-vm.el, lisp/bbdb-message.el, lisp/bbdb-mhe.el: Do not use eval-and-compile. 2012-12-30 Roland Winkler * lisp/bbdb.el (bbdb-mua-summary-unification-list) (bbdb-mua-summary-mark-field, bbdb-mua-summary-mark) (bbdb-mua-summary-unify-format-letter) (bbdb-mua-summary-mark-format-letter): New user variables. * lisp/bbdb-mua.el (bbdb-mua-summary-unify) (bbdb-mua-summary-mark): New functions. * lisp/bbdb-gnus.el (bbdb/gnus-summary-mark-known-posters) (bbdb/gnus-mark-known-posters) (bbdb/gnus-summary-known-poster-mark) (bbdb/gnus-summary-show-bbdb-names) (bbdb/gnus-header-show-bbdb-names) (bbdb/gnus-summary-prefer-bbdb-data) (bbdb/gnus-summary-prefer-real-names) (bbdb/gnus-header-prefer-real-names) (bbdb/gnus-summary-user-format-letter) (bbdb/gnus-summary-in-bbdb-format-letter) (bbdb/gnus-message-marker-field, bbdb/gnus-summary-get-sender) (bbdb/gnus-summary-sender-in-bbdb): Removed. (bbdb-insinuate-gnus): Use bbdb-mua-summary-unify and bbdb-mua-summary-mark. 2012-12-27 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-wrapper): Add edebug support. Suggested by Leo . * lisp/bbdb-gnus (bbdb-insinuate-gnus): Fix keybindings for gnus-article-mode. Suggested by Leo . * lisp/bbdb-com.el (bbdb-grab-url): Fail early if no URL at point. Suggested by Leo . 2012-12-26 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Check every record from the completion list for each possible completion. 2012-12-26 Roland Winkler * lisp/bbdb.el (bbdb-dedicated-window): New user variable. (bbdb-mua-pop-up): Renamed from bbdb-message-pop-up. Doc fix. (bbdb-mua-pop-up-window-size): New variable. (bbdb-pop-up-window-size): Doc fix. Allow value t. (bbdb-pop-up-window): Use it. Simplify. Use display-buffer-record-window / set-window-dedicated-p so that the BBDB window is popped up such that quit-window can delete it. Suggested by Martin Rudalics. (bbdb-display-records): Clean up. * lisp/bbdb-mua.el (bbdb-mua-mode-alist): New variable. (bbdb-mua): Use it. (bbdb-mua-window-p): New function. (bbdb-mua-display-records, bbdb-mua-edit-field) (bbdb-mua-auto-update): Use it. 2012-12-25 Roland Winkler * lisp/bbdb-vm.el: (bbdb/vm-auto-add-label-list) (bbdb/vm-auto-add-label-field): Doc fix. (bbdb/vm-auto-add-label): Doc fix and cleanup. 2012-12-25 Roland Winkler * README: Minor docfix. 2012-12-25 Roland Winkler * lisp/bbdb.el, lisp/bbdb-com.el, lisp/bbdb-mua.el: * lisp/bbdb-print.el, lisp/bbdb-anniv.el, lisp/bbdb-ispell.el: * lisp/bbdb-migrate.el, lisp/bbdb-vm.el, lisp/bbdb-gnus.el: For the user-defined fields of a record replace the generic internal name `notes' by `xfield'. * lisp/bbdb.el (bbdb-layout-alist, bbdb-name-format, bbdb-image) (bbdb-default-domain, bbdb-auto-notes-rules) (bbdb-mail-alias-field, bbdb-name-face-alist, bbdb-record-type) (bbdb-timestamp, bbdb-creation-date) (bbdb-display-name-organization): Doc fix. (bbdb-xfields-sort-order): Renamed from bbdb-notes-sort-order (bbdb-merge-xfield-function-alist): Renamed from bbdb-merge-notes-function-alist (bbdb-xfield-label-list): Renamed from bbdb-notes-label-list. (bbdb-record-xfields): Renamed from bbdb-record-Notes. (bbdb-record-set-xfields): Renamed from bbdb-record-set-Notes. (bbdb-record-xfield): Renamed from bbdb-record-note. (bbdb-record-set-xfield): Renamed from bbdb-record-set-note. (bbdb-record-xfield-intern): Renamed from bbdb-record-note-intern. (bbdb-record-xfield-split): Renamed from bbdb-record-note-split (bbdb-set-xfield-labels): Renamed from bbdb-set-notes-labels (bbdb-merge-xfield): Renamed from bbdb-merge-note. * lisp/bbdb-com.el (bbdb-search, bbdb, bbdb-compare-records) (bbdb-create-internal, bbdb-edit-field): Doc fix. (bbdb-search-xfields): Renamed from bbdb-search-notes. (bbdb-message-search): Make search more robust. (bbdb-sort-xfields): Renamed from bbdb-sort-notes. 2012-12-25 Roland Winkler * lisp/bbdb.el (bbdb-parse-records): If multiple records have the same name, hash all these records. (bbdb-allow-duplicates): Doc fix. 2012-09-23 Roland Winkler Add more complete support for mail entries containing RFC-822 addresses such as "John Smith " in the record of Johnathan Smith. * lisp/bbdb.el (bbdb-defstruct): Doc fix. Improve doc string of functions defined via this macro. (bbdb-cache-mail-aka, bbdb-cache-mail-canon): New elements of bbdb-record-cache. (bbdb-record-mail-aka, bbdb-record-mail-canon): New functions. (bbdb-hash-p): New function. (bbdb-gethash): Use it. (bbdb-puthash-mail): New function. (bbdb-hash-record): Use it. (bbdb-record-field): Renamed from bbdb-record-get-field. New field values mail-canon, mail-aka and aka-all. Doc fix. (bbdb-record-get-field): Obsolete function alias. (bbdb-record-set-field): Doc fix. Update hash for mail entries such as "John Smith ". (bbdb-delete-record-internal): Use canonical mail addresses and all AKAs when cleaning up the hash. * lisp/bbdb-com.el (bbdb-search): Use bbdb-record-field. (bbdb-search-duplicates): Use bbdb-record-mail-canon. (bbdb-message-search): Simplify. (bbdb-edit-field): Doc fix. (bbdb-ident-point, bbdb-transpose-fields) (bbdb-delete-field-or-record): Use bbdb-record-field. (bbdb-completion-predicate): Use bbdb-hash-p. (bbdb-complete-mail): Compare with all AKAs. A plain message search should be sufficient. * lisp/bbdb-mual.el (bbdb-annotate-message): Compare with canonical mail addresses. * lisp/bbdb-ispell.el (bbdb-ispell-export): Use bbdb-record-field. * README: Notes for BBDB lisp hackers added. 2012-09-23 Roland Winkler * lisp/bbdb.el (bbdb-mua-auto-update-p): Doc fix. (bbdb-message-pop-up): Change default to t. * lisp/bbdb-mua.el (bbdb-mua-auto-update) (bbdb-mua-auto-update-init): Doc fix. (bbdb-mua-auto-update): Simplify. * README: Clarify usage of bbdb-mua-auto-update. 2012-09-09 Roland Winkler Provide unified scheme for customizing how BBDB analyzes messages. * lisp/bbdb.el (bbdb-add-name): Renamed from bbdb-accept-name-mismatch. (bbdb-add-aka): Renamed from bbdb-use-alternate-names. (bbdb-new-mails-primary): Renamed from bbdb-new-mails-always-primary. (bbdb-add-name, bbdb-add-aka, bbdb-add-mails) (bbdb-new-mails-primary): Unify set of allowed values. (bbdb-add-job, bbdb-eval-spec): New functions. (bbdb-mode): Update docstring. * lisp/bbdb-com.el (bbdb-merge-records): Use bbdb-add-aka. * lisp/bbdb-mua.el (bbdb-annotate-message): Use bbdb-add-name, bbdb-add-aka, bbdb-add-mails, and bbdb-new-mails-primary. 2012-09-08 Roland Winkler * lisp/bbdb-mua.el (bbdb-message-header): Use gnus-fetch-original-field so that bbdb-select-message does not get fooled by an apparent absence of some headers. 2012-09-07 Roland Winkler * lisp/bbdb.el (bbdb-accept-name-mismatch): Allow value being a regexp or function. * lisp/bbdb-mua.el (bbdb-annotate-message): Use these new values. 2012-09-01 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-edit-field): Bug fix. 2012-09-01 Roland Winkler * lisp/bbdb.el (bbdb-record-set-field): Bug fix. 2012-09-01 Roland Winkler * lisp/bbdb.el (bbdb-with-print-loadably): New macro. (bbdb-insert-record-internal, bbdb-overwrite-record-internal) (bbdb-sort-records): Use it. 2012-08-11 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail-cleanup): New function. (bbdb-complete-mail): Use it. In particular, clean up also when using *Completions* buffer. 2012-08-11 Roland Winkler Remove electric mode that was not providing any new functionality to BBDB. Also see GNU Emacs Bug#11983. * lisp/bbdb.el (bbdb-electric, bbdb-inside-electric-display) (bbdb-quit-window, bbdb-electric-display-records) (bbdb-electric-throw, bbdb-quit-window) (bbdb-display-records-internal): Remove. (bbdb-display-records): Remove arg electric. Merge with bbdb-display-records-internal. (bbdb-redisplay-records): Use bbdb-display-records. * lisp/bbdb-com.el (bbdb-mail, bbdb-mail-address, bbdb-info): Remove electricity. (bbdb-mail-abbrev-expand-hook): Use bbdb-display-records. * lisp/bbdb-mua.el (bbdb-mua-display-records) (bbdb-mua-auto-update): Use bbdb-display-records. 2012-08-09 Roland Winkler Remove message cache that was broken. There were two problems with it. The cache did not distinguish between records associated with the senders and recipients. So if a call of bbdb-mua-display-sender was followed by, say, a call of bbdb-mua-display-recipients the second call also returned the senders. Second, the cache used assq to identify message keys to operate fast. Yet most MUAs only provide strings as message keys. * lisp/bbdb.el (bbdb-message-all-addresses) (bbdb-notice-mail-hook, bbdb-notice-record-hook): Fix docstring. (bbdb-message-caching, bbdb-message-cache): Remove. (bbdb-buffer): Remove cache flushing. * lisp/bbdb-mua.el (bbdb-update-records): Remove arg msg-key. Remove caching of records. (bbdb-message-get-cache, bbdb-message-set-cache) (bbdb-message-rem-cache): Remove. (bbdb-mua-update-records): Remove arg msg-key from calls of bbdb-update-records. 2012-08-07 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Use quit-window instead of current-window-configuration and set-window-configuration. * lisp/bbdb.el (bbdb-complete-mail-saved-window-config): Remove. 2012-08-06 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Revert 2012-07-06 change. 2012-08-05 Roland Winkler * lisp/bbdb-mua.el (bbdb-annotate-message): Simplify. 2012-08-05 Roland Winkler * lisp/bbdb.el (bbdb-suppress-changed-records-recording): Remove. (bbdb-puthash, bbdb-gethash, bbdb-remhash): Ignore keys that are empty strings or nil. (bbdb-hash-record): Explicitly hash name. (bbdb-change-record, bbdb-delete-record-internal) (bbdb-insert-record-internal, bbdb-overwrite-record-internal): Operate on hash table and bbdb-changed-records list only when necessary. * lisp/bbdb-com.el (bbdb-delete-records): Remove record from hash table. (bbdb-merge-records): Do not add new-record to the list of changed records, which is done already by bbdb-change-record. 2012-08-05 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Do not call quit-window. Instead, rely on set-window-configuration that it does what we want. 2012-08-01 Roland Winkler * lisp/bbdb-com.el (bbdb-merge-records): Improve interactive call and docstring. 2012-08-01 Roland Winkler * lisp/bbdb.el (bbdb-allow-duplicates, bbdb-hash-update) (bbdb-record-set-field): Fix docstring. * lisp/bbdb-com.el (bbdb-merge-records): Do not through an error when merging the old and new record results in duplicate AKAs and email addresses. 2012-07-31 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): When a single record matches, analyze more carefully which mail address to use. Cycle even if the record contains only one mail address, yet bbdb-dwim-mail gives us something different from what we have. Search correctly for RFC 822 addresses containing a full name. 2012-07-20 Roland Winkler * lisp/bbdb-mua.el (bbdb-annotate-message): Simplify. Create new record if update-p has not value update. 2012-07-20 Roland Winkler * lisp/bbdb.el (bbdb-gethash): Allow value of t for arg predicate. 2012-07-20 Sam Steingold * lisp/bbdb-com.el (bbdb-message-search): Allow args name or mail to be nil. 2012-07-19 Roland Winkler * lisp/bbdb.el: Simplify previous patch. (bbdb-electric-execute, bbdb-electric-quit, bbdb-electric-quit): Remove. (bbdb-display-records): Simplify. (bbdb-electric-display-records): Fix docstring. Simplify. Remove optional args select and horiz-p that interfere with Electric-pop-up-window. 2012-07-18 Roland Winkler * lisp/bbdb.el (bbdb-electric-display-records): Fix previous patch. 2012-07-18 Roland Winkler * lisp/bbdb.el: Autoload bbdb-search and bbdb-search-prompt. (bbdb-display-records): Make records a required arg. Do not redefine keys. Pass optional args to bbdb-electric-display-records. (bbdb-electric-display-records): New optional args layout, append, select, and horiz-p. Make it a command. Redefine SPC key temporarily. Simplify. 2012-07-17 Roland Winkler * lisp/bbdb.el (bbdb-mua-update-interactive-p) (bbdb-mua-auto-update-p, bbdb-update-records-p): Update docstring. (bbdb-canonicalize-mail-function): Update docstring. (bbdb-message-caching): Use default nil till caching is fixed. (bbdb-cache-deleted-p, bbdb-cache-set-deleted-p) (bbdb-record-deleted-p, bbdb-record-set-deleted-p): Removed. (bbdb-display-name-organization): Use memq. * lisp/bbdb-mua.el (bbdb-mua, bbdb-message-header): Use memq. (bbdb-get-address-components): Allow mail to be nil. Use member-ignore-case. (bbdb-update-records): New value update for arg update-p. Use memq. (bbdb-message-get-cache): Simplify. (bbdb-message-set-cache): Remove old value from cache. (bbdb-annotate-message): New value update for arg update-p. Operate on all records found by bbdb-message-search. Return list of records. Use member-ignore-case. (bbdb-mua-update-records): Use memq. (bbdb-auto-notes): Use member-ignore-case and assoc-string. * lisp/bbdb-com.el (bbdb-read-name, bbdb-insert-field): Use memq. (bbdb-complete-mail): Use member-ignore-case. * lisp/bbdb-message.el (bbdb/message-update-records-p) * lisp/bbdb-rmail.el (bbdb/rmail-update-records-p) * lisp/bbdb-mhe.el (bbdb/mh-update-records-p) * lisp/bbdb-gnus.el (bbdb/gnus-update-records-p) * lisp/bbdb-vm.el (bbdb/vm-update-records-p): Update docstring. * lisp/bbdb-print.el (bbdb-print-record): Do not use bbdb-record-deleted-p. * README: Update usage of update-p. 2012-07-12 Roland Winkler * lisp/bbdb-mua.el (bbdb-get-address-components) (bbdb-message-get-cache, bbdb-message-set-cache) (bbdb-message-rem-cache, bbdb-mua-annotate-sender) (bbdb-mua-annotate-recipients, bbdb-mua-edit-field) (bbdb-canonical-hosts, bbdb-canonicalize-mail-1) (bbdb-mail-redundant-p, bbdb-delete-redundant-mails) (bbdb-message-clean-name-default): Fix docstring. 2012-07-09 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-annotate-sender) (bbdb-mua-annotate-recipients, bbdb-mua-edit-field) (bbdb-mua-edit-field-sender, bbdb-mua-edit-field-recipients): New arg update-p. (bbdb-mua-edit-field-interactive): Handle arg update-p. 2012-07-08 Roland Winkler * lisp/bbdb-mua.el (bbdb-update-records): Fix previous patch. 2012-07-08 Roland Winkler * lisp/bbdb-mua.el (bbdb-update-records): Make records a list ordered like address-list. 2012-07-06 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Use window-live-p. 2012-07-06 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-edit-field): Revert previous change. Do not use hard-coded bindings for user variables. 2012-07-06 Sam Steingold * lisp/bbdb-com.el (bbdb-complete-mail): Use `quit-window' instead of `bury-buffer' to get rid of *Completions*. 2012-07-06 Sam Steingold * lisp/bbdb-mua.el (bbdb-mua-edit-field): Edit THE record for THE sender, not all the relevant records. 2012-07-03 Roland Winkler * lisp/bbdb.el (bbdb-record-name, bbdb-record-name-lf): Fix docstring. * lisp/bbdb-com.el (bbdb-search): Also search last_first names. Fix docstring. (bbdb-message-search): Fix docstring. 2012-07-01 Sam Steingold * lisp/bbdb-mua.el (bbdb-get-address-components): name may be nil. 2012-07-01 Sam Steingold * .gitignore: ignore Makefiles and configure files; bbdb-autoloads.el -> bbdb-loaddefs.el. 2012-06-24 Sam Steingold * lisp/bbdb-mua.el (bbdb-update-records): Use bbdb-message-search instead of bbdb-search when `update-p' is `search' so that all senders are displayed. * lisp/bbdb-mua.el (bbdb-annotate-message): Do not offer to replace the name if it is already an AKA. * lisp/bbdb.el (bbdb-label-completion-list): Use symbol-value instead of eval for symbols. * lisp/bbdb-mua.el (bbdb-update-records): Ditto. 2012-06-24 Philip Hudson * lisp/bbdb.el (bbdb-read-only, bbdb-initialize-hook) (bbdb-mode-hook, bbdb-layout-alist, bbdb-case-fold-search) (bbdb-message-caching, bbdb-complete-mail-allow-cycling) (bbdb-after-save-hook, bbdb-completion-display-record) (bbdb-update-records-address, bbdb-warn, bbdb-split, bbdb-concat) (bbdb-read-string, bbdb-current-record, bbdb-debug) (bbdb-timestamp, bbdb-creation-date, bbdb-gethash) (bbdb-hash-record, bbdb-record-name, bbdb-record-name-lf) (bbdb-record-sortkey, bbdb-record-set-sortkey, bbdb-record-marker) (bbdb-record-set-marker, bbdb-record-deleted-p) (bbdb-record-set-deleted-p, bbdb-merge-concat) (bbdb-merge-string-least, bbdb-merge-string-most) (bbdb-phone-string, bbdb-error-retry, bbdb-display-list) (bbdb-display-record-one-line, bbdb-display-record-multi-line) (bbdb-display-records, bbdb-display-records-internal) (bbdb-redisplay-record, bbdb-pop-up-window) (bbdb-electric-display-records, bbdb-electric-throw) (bbdb-electric-quit, bbdb-quit-window, bbdb-mouse-menu, bbdb-save) (bbdb-offer-to-create bbdb-lastname-suffixes) (bbdb-update-records-p, bbdb-new-mails-always-primary): Fix docstring. (bbdb-mail-user-agent): Untabify. 2012-06-24 Roland Winkler Update copyright notices. * lisp/bbdb.el (bbdb-allow-duplicates): Rename from bbdb-no-duplicates to match the unchanged docstring of this variable. (bbdb-record-Notes): Rename from bbdb-record-notes to avoid name clashes. (bbdb-puthash): Do not hash empty strings. (bbdb-gethash): New arg predicate. (bbdb-check-name): New function. (bbdb-record-set-name): For args first and last allow new value t. Use bbdb-check-name. (bbdb-record-name, bbdb-record-name-lf): Use it. (bbdb-record-set-field): Use it. Simplify. (bbdb-label-completion-default, bbdb-data-completion-list) (bbdb-data-completion-default): Remove unused function. (bbdb-buffer): Handle here that bbdb-file might have changed on disk and auto-save file could be newer than bbdb-file instead of bbdb-records doing this. (bbdb-revert-buffer): Fix docstring. Use prefix arg as in revert-buffer. Use variable bbdb-buffer instead of function bbdb-buffer to avoid recursion. (bbdb-parse-records): Rename from bbdb-parse-internal. Add docstring. Do not polute buffer-undo-list when reading bbdb-file. Use unwind-protect. Merge with bbdb-parse-frobnicate. Handle bbdb-allow-duplicates properly. (bbdb-with-db-buffer): Add docstring. (bbdb-display-record-one-line, bbdb-display-record-multi-line): Simplify. (bbdb-pop-up-window): Fix docstring. (bbdb-sendmail-menu): Add docstring. (bbdb-electric-quit): Rename from bbdb-electric-done. (bbdb-electric-display-records): Simplify. * lisp/bbdb-com.el (bbdb-editable): Fix docstring. Check more carefully without reverting. (bbdb-message-search): Use bbdb-buffer. (bbdb-read-record): Use bbdb-buffer and bbdb-check-name. (bbdb-create-internal): Fix docstring. Use bbdb-check-name. (bbdb-edit-field): Merge with bbdb-record-edit-name. (bbdb-record-edit-name): Remove. (bbdb-completion-predicate): Bug fix. (bbdb-complete-mail): Use bbdb-buffer and bbdb-completion-predicate. (bbdb-search-duplicates, bbdb-message-search) (bbdb-create-internal): Use arg predicate of bbdb-gethash. * lisp/bbdb.el (bbdb-gethash): New arg predicate. (bbdb-check-name, bbdb-record-set-field, bbdb-parse-records) Use it. * lisp/bbdb-com.el (bbdb-search-duplicates, bbdb-message-search) (bbdb-create-internal): Use it. * lisp/bbdb-mua.el (bbdb-message-get-cache): Use bbdb-buffer. * lisp/bbdb.el (bbdb-message-clean-name-function) (bbdb-message-mail-as-name): New variables. * lisp/bbdb-mua.el (bbdb-get-address-components) (bbdb-annotate-message): Use them. (bbdb-message-clean-name-default): Rename from bbdb-message-clean-name. Clean names properly, too. * tex/Makefile.in (install-TeX): Bug fix (Bug#108041). 2012-01-02 Sam Steingold * lisp/bbdb.el (bbdb-auto-notes-rules): Use :set keyword to reset `bbdb-auto-notes-rules-expanded' when `bbdb-auto-notes-rules' is set. 2012-01-02 Roland Winkler * lisp/bbdb-anniv.el (bbdb-anniv-list): Clarify docstring. 2012-01-02 Roland Winkler * lisp/bbdb.el: Do not use custom-loads for bbdb-mua.el and bbdb-com.el. Use symbols for custom-loads. (bbdb-utilities-ispell): Group renamed and moved here from bbdb-ispell.el. (bbdb-utilities-print): Group renamed from bbdb-print. (bbdb-utilities-dialing): Group renamed from bbdb-dialing. * lisp/bbdb-ispell.el, lisp/bbdb-print.el: Updated accordingly. 2011-12-18 Roland Winkler * lisp/bbdb-anniv.el (bbdb-anniv-diary-entries): Remove leading and trailing whitespace in text properly. 2011-12-18 Roland Winkler * lisp/Makefile.in: Do not create backup file for bbdb-loaddefs.el. 2011-12-18 Roland Winkler * lisp/bbdb-anniv.el (bbdb-anniv-alist): New format specification `%t'. (bbdb-anniv-diary-entries): Use it. Handle diary's backup forms in a better way. 2011-12-11 Roland Winkler * INSTALL, Makefile.in, aclocal.m4, configure.ac, install-sh: * lisp/Makefile.in, doc/Makefil.in, doc/bbdb.texi: * doc/doclicense.texi, doc/gpl.texi, tex/Makefile.in: * tex/bbdb-cols.tex, tex/bbdb-print-brief.tex, tex/bbdb-print.tex: New files. * lisp/makefile-temp: Renamed from lisp/Makefile. * README: Updated. * lisp/bbdb-ispell.el: Header updated. Prefix bbdb-spell replaced by bbdb-ispell. (bbdb-ispell): New custom group. (bbdb-ispell-dictionary-list): Renamed from bbdb-spell-dictionary. (bbdb-ispell-field-list): Renamed from bbdb-spell-field. (bbdb-ispell-export): Merged with bbdb-spell-add-word. (bbdb-ispell-collect-words): Renamed from bbdb-spell-export-field. Merged with bbdb-spell-append-word. 2011-12-11 Ivan Kanis * lisp/bbdb-ispell.el: New file 2011-11-27 Roland Winkler * README: Updated. * lisp/bbdb.el: Revert change from 2011-10-11. Loading bbdb-autoloads.el is sufficient. * lisp/Makefile: It no longer supports VM by default, but you need to enable it. 2011-11-27 Leo * lisp/bbdb.el (bbdb-image-suffixes): Fix typo. 2011-11-20 Roland Winkler * README: Updated. * lisp/bbdb.el (bbdb-message-try-all-headers) (bbdb-user-mail-address-re): Clarify doc string. (bbdb-defstruct): Do not update bbdb-mail-aliases-need-rebuilt. (bbdb-record-set-note): Update bbdb-mail-aliases-need-rebuilt. (bbdb-record-set-name): Update name in cache and hash. (bbdb-record-unset-name): Removed (obsolete). (bbdb-hash-update): New function. (bbdb-record-set-field): Use it. (bbdb-records): Initiate variable bbdb-records. (bbdb-parse-internal): Use bbdb-goto-first-record. (bbdb-goto-first-record): Move backward only if we found a first record. * lisp/bbdb-com.el (bbdb-insert-field) (bbdb-delete-field-or-record): Use bbdb-record-set-field. (bbdb-edit-field): New optional arg value. Handle affix, organization, mail, aka, and note fields directly. (bbdb-record-edit-affix, bbdb-record-edit-organziation) (bbdb-record-edit-mail, bbdb-record-edit-aka) (bbdb-record-edit-note): Removed. * lisp/bbdb.el (bbdb-mail-avoid-redundancy) Renamed from bbdb-mail-allow-redundancy. * lisp/bbdb-com.el (bbdb-dwim-mail): Update it accordingly. * lisp/bbdb.el (bbdb-update-records-p): Change default to less agressive `search'. (bbdb-mua-auto-update-p): New variable * lisp/bbdb-mua.el (bbdb-mua-auto-update): Use it. (bbdb-update-records): Resolve arg update-p up to two times. * lisp/bbdb-message.el (bbdb/message-update-records-p) * lisp/bbdb-rmail.el (bbdb/rmail-update-records-p) * lisp/bbdb-gnus.el (bbdb/gnus-update-records-p) * lisp/bbdb-mhe.el (bbdb/mh-update-records-p) * lisp/bbdb-vm.el (bbdb/vm-update-records-p): Doc fix. * lisp/bbdb-mua.el (bbdb-annotate-record): Convert annotation into list if field is affix, organization, mail or aka. (bbdb-mua-edit-field-interactive): New function. (bbdb-mua-edit-field): New command. (bbdb-mua-edit-field-sender, bbdb-mua-edit-field-recipients): Use it. * lisp/bbdb.el (bbdb-image, bbdb-image-path, bbdb-image-suffixes): New variables. (bbdb-display-name-organization): Use them to display images for BBDB records. Suggested by Ivan Kanis . * lisp/bbdb-migrate.el (bbdb-undocumented-variables): New command. 2011-10-11 Teodor Zlatanov * lisp/bbdb.el: Autoload `bbdb-insinuate-gnus' from bbdb-gnus.el so `bbdb-initialize' won't throw an error when passed 'gnus. Ditto 'message, 'rmail, 'vm, and 'mh-e. 2011-10-10 Roland Winkler * lisp/bbdb.el (bbdb-name-format, bbdb-read-name-format) (bbdb-name-face-alist): New user variables. (bbdb-record-name-lf): New function. (bbdb-display-name-organization): Use bbdb-name-format for customizable display of name. Use note field name-face for customizable font-locking of name of a record. (bbdb-layout-list): Omit name-format and name-face for multi-line and pop-up-multi-line format. (bbdb-separator-alist): New default values for name-first-last and name-last-first. (bbdb-record-set-name): Use them. * lisp/bbdb-com.el (bbdb-read-name): New function. (bbdb-read-record, bbdb-record-edit-name): Use it. New optional arg first-and-last. * lisp/bbdb.el: (bbdb-merge-notes-function): Removed (obsolete). (bbdb-record-type): New internal variable. (bbdb-check-type): Moved here from lisp/bbdb-com.el. Use the pseudo-code of bbdb-record-type. (bbdb-record-get-field, bbdb-merge-concat) (bbdb-merge-concat-remove-duplicates, bbdb-merge-string-least) (bbdb-merge-string-most, bbdb-merge-lists, bbdb-divide-name) (bbdb-parse-postcode): Moved here from lisp/bbdb-com.el. (bbdb-merge-note): Rewrite. (bbdb-record-set-field): Moved here from lisp/bbdb-com.el. New optional args check and merge. (bbdb-record-note-intern): New function. (bbdb-record-set-note): Throw error if the name of a note field equals the name of any other record field. (bbdb-parse-frobnicate): Include all note fields in bbdb-notes-label-list. * lisp/bbdb-com.el (bbdb-create-internal): Use bbdb-check-type. (bbdb-merge-records-internal): Removed (merged with bbdb-merge-records). (bbdb-merge-records): Use bbdb-record-set-field. * lisp/bbdb-mua.el (bbdb-annotate-record): Renamed from bbdb-annotate-note. Use bbdb-record-set-field. * lisp/bbdb.el (bbdb-initialize): Do not require bbdb-autoloads. * lisp/bbdb.el (bbdb-phone-string): Fix error message. * lisp/bbdb.el (bbdb-error-retry): Use progn. * lisp/bbdb.el (bbdb-message-try-all-headers): New user variable. * lisp/bbdb-mua.el (bbdb-get-address-components): Use it. * lisp/bbdb-print.el (bbdb-print): Do not use \catcode. 2011-09-22 Leo * lisp/bbdb.el (bbdb-pop-up-window): Remove Gnus-specific code which is not required anymore by recent versions of Gnus. 2011-09-21 Leo * lisp/bbdb-com.el (bbdb-browse-url): Fix usage of prefix arg. 2011-09-19 Leo * lisp/bbdb-com.el (bbdb-add-mail-alias): Fix completion list used in interactive calls for deleting an alias. 2011-09-19 Roland Winkler * lisp/bbdb.el (bbdb-mode-map): Use / as search prefix. 2011-09-19 Abhi Yerra * lisp/bbdb.el (bbdb-dial-function): New variable. (bbdb-sound-player, bbdb-sound-files, bbdb-modem-dial) (bbdb-modem-device, bbdb-sound-volume): Removed (obsolete). * lisp/bbdb-com.el (bbdb-dial-number): Use browse-url and bbdb-dial-function. (bbdb-play-sound): Removed (obsolete) 2011-09-19 Roland Winkler * lisp/bbdb-com.el (bbdb-dial): First remove extension. Simplify. 2011-09-19 Roland Winkler * lisp/bbdb.el (bbdb-version): Do not use interactive-p. * lisp/bbdb-message.el: Require sendmail for mail-mode-map. * lisp/bbdb-anniv.el (number): Use with-no-warnings. * lisp/bbdb-com.el (bbdb-divide-name): Fix regexp for matching last name prefixes. 2011-05-11 Roland Winkler * lisp/bbdb-mua.el (bbdb-update-records): Fix previous patch. (bbdb-prompt-for-create): Use special-mode. 2011-05-11 Roland Winkler * lisp/bbdb.el (bbdb-notice-mail-hook): Rename from bbdb-notice-hook. (bbdb-notice-record-hook): New variable. (bbdb-notice-hook-pending): Update doc string. * lisp/bbdb-mua.el (bbdb-update-records): Call bbdb-notice-record-hook. (bbdb-annotate-message): Use bbdb-notice-mail-hook. * lisb/bbdb-vm.el (bbdb/vm-auto-add-label): Update doc string. 2011-05-08 Roland Winkler * lisp/bbdb-com.el (bbdb-display-all-records): Use redisplay. Why needed? 2011-05-08 Leo * lisp/bbdb-com.el (bbdb-merge-records-internal): Fix typo 2011-05-08 Leo * lisp/bbdb-mua.el (bbdb-auto-notes): Fix typo 2011-05-07 Roland Winkler * lisp/bbdb-com.el (bbdb-display-current-record): New command. (bbdb-display-all-records): Improve docstring. * lisp/bbdb.el (bbdb-mode-map): Key bindings for bbdb-display-all-records and bbdb-display-current-record. 2011-04-29 Barak A. Pearlmutter * lisp/bbdb.el (bbdb-init-forms): Fix typo. (bbdb-parse-internal): Clarify error message. 2011-04-29 Barak A. Pearlmutter * lisp/bbdb-migrate.el (bbdb-peel-the-onion): New function. (bbdb-migrate): Use it for cleaning up corrupted BBDB files. 2011-04-29 Barak A. Pearlmutter * lisp/Makefile: Use option --batch. New target TAGS. 2011-04-29 Roland Winkler * lisp/bbdb.el, lisp/bbdb-com.el, lisp/bbdb-migrate.el, lisp/bbdb-print.el: Rename degree field to affix. 2011-04-29 Roland Winkler * lisp/bbdb.el (bbdb-display-name-organization): Include name in text property. (bbdb-scan-property): New function. (bbdb-next-record, bbdb-prev-record): Use it. (bbdb-next-field, bbdb-prev-field): New commands bound to "N" and "P". 2011-04-23 Roland Winkler * lisp/bbdb.el (bbdb-pop-up-window): Rename from bbdb-pop-up-buffer. * lisp/bbdb.el (bbdb-display-records-internal) * lisp/bbdb-com.el (bbdb-complete-mail): Use new name. 2011-04-23 Leo * lisp/bbdb.el (bbdb-pop-up-buffer): Distinguish 1 and 1.0 in bbdb-pop-up-window-size. 2011-04-23 Roland Winkler * lisp/bbdb-message.el (bbdb-insinuate-message) (bbdb-insinuate-mail) * lisp/bbdb-rmail.el (bbdb-insinuate-rmail) * lisp/bbdb-gnus.el (bbdb-insinuate-gnus) * lisp/bbdb-mhe.el (bbdb-insinuate-mh) * lisp/bbdb-vm.el (bbdb-insinuate-vm): Fix docstring. 2011-04-23 Roland Winkler * lisp/bbdb.el (bbdb-mode-map): Do no call set-keymap-parent which is done already by define-derived-mode. Reported by Sam Steingold . Add menu binding for revert-buffer. 2011-04-16 Roland Winkler * lisp/bbdb.el (bbdb-create-hook, bbdb-change-hook): Use defvar. 2011-04-16 Roland Winkler * lisp/bbdb.el (bbdb-time-stamp-format): Includes timezone info. 2011-04-16 Roland Winkler * TODO: New file. 2011-04-16 Roland Winkler * lisp/bbdb.el (bbdb-faces): Group of faces used by BBDB. (bbdb-name, bbdb-organization, bbdb-field-name): New faces. (bbdb-display-name-organization, bbdb-display-record-one-line) (bbdb-display-record-multi-line): Use them. 2011-04-16 Roland Winkler * lisp/bbdb.el (bbdb-mode-map): Inherit from special-mode-map. (bbdb-quit-window): Renamed from bbdb-bury-buffer. Use quit-window. (bbdb-mode): Use define-derived-mode. 2011-04-16 Roland Winkler * lisp/bbdb.el (bbdb-indent-string): New function. (bbdb-display-record-multi-line): Use it. (Bug#33101) 2011-04-16 Roland Winkler * lisp/bbdb-com.el: Autoload browse-url-url-at-point. 2011-04-16 Roland Winkler * lisp/bbdb.el (bbdb-create-hook, bbdb-change-hook): Call add-hook for the default hook functions. 2011-04-11 Roland Winkler * lisp/bbdb-com.el (bbdb-complete-mail): Ensure initialization of the database. 2011-04-10 Roland Winkler * lisp/bbdb.el (bbdb-utilities-anniv): New customization group. (bbdb-create-hook, bbdb-change-hook) (bbdb-after-change-hook, bbdb-notice-hook) (bbdb-default-separator): Improve doc string. (bbdb-separator-alist): Improve doc string. Include entries for anniversaries. (bbdb-records): Use make-variable-buffer-local. (bbdb-current-field): Do not remove field-name. (bbdb-record-note): Simplified. (bbdb-record-note-n): Removed. (bbdb-record-note-split): New function. (bbdb-record-set-note): Improved documentation. (bbdb-format-note, bbdb-record-format-note): New function. (bbdb-display-text): Renamed from bbdb-format-text. (bbdb-display-list): Renamed from bbdb-format-list. (bbdb-display-name-organization): Renamed from bbdb-format-name-organization. (bbdb-display-record-one-line): Renamed from bbdb-format-record-one-line. Unify text properties. (bbdb-display-record-multi-line): Renamed from bbdb-format-record-multi-line. Unify text properties. (bbdb-display-record-full-multi-line): Renamed from bbdb-format-record-full-multi-line. (bbdb-display-record-pop-up-multi-line): Renamed from bbdb-format-record-pop-up-multi-line. (bbdb-display-record): Renamed from bbdb-format-record. (bbdb-parse-internal, bbdb-parse-frobnicate): Simplified search for first record. (bbdb-delete-record-internal, bbdb-overwrite-record-internal): Disentangle code. * lisp/bbdb-com.el (bbdb-editable): Throw error if *BBDB* buffer is out of sync with database. (bbdb-search): Use suffix -re for all args that are regular expressions. (bbdb-delete-duplicate-mails, bbdb-sort-addresses) (bbdb-sort-phones, bbdb-sort-notes): New optional arg update. (bbdb-record-edit-note): Renamed from bbdb-record-edit-notes. (bbdb-list-transpose, bbdb-ident-point): New functions. (bbdb-transpose-fields): Use them. Make code more robust such that it can be applied to any subfields of the same type. (bbdb-field-equal, bbdb-next-field): Removed (obsolete). (bbdb-mail-aliases, bbdb-get-mail-aliases, bbdb-add-mail-alias) (bbdb-browse-url): Use bbdb-record-note-split. * lisp/bbdb-mua.el (bbdb-mua-wrapper): Do not use rmail-select-summary. (bbdb-mua-auto-update): Bug fix. * lisp/bbdb-rmail.el (bbdb-insinuate-rmail) * lisp/bbdb-mhe.el (bbdb-insinuate-mh): Bind to bbdb-mua-edit-notes-sender. * lisp/bbdb-vm.el (bbdb/vm-auto-folder, bbdb/vm-virtual-folder) (bbdb/vm-auto-add-label): Use bbdb-record-note-split. * lisp/bbdb-print.el (bbdb-print-omit-fields): Remove `omit'. * lisp/bbdb-anniv.el: New file. * lisp/Makefile: Honor lisp/bbdb-anniv.el. 2011-03-05 Roland Winkler * lisp/bbdb.el (bbdb-modeline-info): New variable. (bbdb-mode): Use it. (bbdb-mode-map): Unify keybindings for search commands. (bbdb-sort-records): Update marker positions correctly. * lisp/bbdb-com.el (bbdb-append-display-p, bbdb-append-display) (bbdb-search-invert-p, bbdb-search-invert): Use bbdb-modeline-info. (bbdb-search): Also search for addresses. Simplify codde. (bbdb-search-address): New command. (bbdb-search-phone): Fix prompt. * lisp/bbdb-mua.el (bbdb-mua-wrapper): Simplify code. (bbdb-mua-auto-update-init): Doc fix. * lisp/bbdb-message.el (bbdb/message-update-records-p) * lisp/bbdb-rmail.el (bbdb/rmail-update-records-p) * lisp/bbdb-gnus.el (bbdb/gnus-update-records-p) * lisp/bbdb-mhe.el (bbdb/mh-update-records-p) * lisp/bbdb-vm.el (bbdb/vm-update-records-p): Doc fix. 2011-02-27 Roland Winkler * lisp/bbdb.el (bbdb-address-format-list): New variable for customization of address formatting and editing. (renamed from bbdb-address-format-alist). (bbdb-format-address): Use it. (bbdb-format-record-one-line, bbdb-format-record-multi-line): Use bbdb-format-address. (bbdb-address-edit-function, bbdb-format-streets) (bbdb-format-address-continental): Removed. Obsolete because of bbdb-address-format-list. (bbdb-format-record): Use funcall instead of eval. (bbdb-continental-postcode-regexp): Renamed from bbdb-continental-zip-regexp. (bbdb-check-postcode): Renamed from bbdb-check-zip. (bbdb-legal-postcodes): Renamed from bbdb-legal-zip-codes. (bbdb-expand-mail-aliases): Removed. (bbdb-notes-label-list): Renamed from bbdb-notes-names. (bbdb-parse-frobnicate): Calculate value of bbdb-notes-label-list instead of reading it. Use memq instead of member. (bbdb-set-notes-labels): Renamed from bbdb-set-notes-names. Do not write value of bbdb-notes-label-list. (bbdb-set-eq): Removed (obsolete). (bbdb-defstruct): Use defsubst. (bbdb-record-unset-name): Clarify code. (bbdb-initialize): Doc fix. * lisp/bbdb-com.el (bbdb-message-search): Use name only if mail address does not match. (bbdb-parse-postcode): Renamed from bbdb-parse-zip. (bbdb-insert-field): In interactive calls ignore fields that are already present. (bbdb-record-edit-phone): Convert format of phone number if old and new format are different. (bbdb-edit-field): Use new bbdb-record-edit-phone. (bbdb-record-edit-address): Use bbdb-address-format-list. (bbdb-edit-address-street): Renamed from bbdb-address-edit-street. Take arg street instead of address. (bbdb-edit-address-default): Renamed from bbdb-address-edit-default. (bbdb-address-edit-continental): Removed (obsolete). (bbdb-complete-mail-cleanup): Removed. Code merged with bbdb-complete-mail. (bbdb-complete-mail): Return non-nil if valid completion exists. Simplify code. * lisp/bbdb-mua.el (bbdb-annotate-message): Use bbdb-string=. (bbdb-mua-wrapper): Also handle mail and message mode. (bbdb-mua-auto-update): Renamed from bbdb-mua-pop-up-bbdb-buffer. Perform auto update even if bbdb-message-pop-up is nil. (bbdb-mua-auto-update-init): Renamed from bbdb-mua-pop-up-init. Doc fix. Use memq instead of member. (bbdb-force-record-create): Removed (obsolete). * lisp/bbdb-migrate.el (bbdb-migrate-postcodes-to-strings): Renamed from bbdb-migrate-zip-codes-to-strings. * lisp/bbdb-print.el (bbdb-print-tex-quote-alist): Fix regexp. (bbdb-print-address-format-list): Renamed from bbdb-print-address-format-alist. Use bbdb-address-format-list as default. (bbdb-print): Use bbdb-format-address. (bbdb-print-address-continental): Removed. 2011-01-17 Roland Winkler * lisp/Makefile: Do not attempt to add empty line to bbdb-autloads.el. 2011-01-16 Roland Winkler * README: Updated. * lisp/Makefile: In bbdb-autloads.el, add BBDB lisp directory to load-path. * lisp/bbdb.el (bbdb-pop-up-buffer): Use condition-case, in case split-window fails. (bbdb-records, bbdb-mode, bbdb-version, bbdb-initialize): Add autoload cookie. 2011-01-15 Roland Winkler * lisp/bbdb-mua.el (bbdb-mua-update-records): For Gnus use gnus-article-buffer. (bbdb-mua-wrapper): New macro. (bbdb-mua-display-records, bbdb-mua-annotate-sender) (bbdb-mua-annotate-recipients, bbdb-mua-edit-notes-sender) (bbdb-mua-edit-notes-recipients): Use it. (bbdb-mua-update-mua): Removed (obsolete because of bbdb-mua-wrapper). * lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Code doc updated. * lisp/bbdb-com.el (bbdb-complete-name): Obsolete alias for bbdb-complete-mail. 2011-01-06 Roland Winkler * lisp/bbdb.el (bbdb-message-headers, bbdb-accept-name-mismatch) (bbdb-use-alternate-names): Fix docstring. (bbdb-auto-notes-rules): Renamed from bbdb-auto-notes-alist. New format. (bbdb-auto-notes-ignore-messages): Renamed from bbdb-auto-notes-ignore-all. (bbdb-auto-notes-ignore-headers): Renamed from bbdb-auto-notes-ignore. (bbdb-pop-up-window-size): Fix docstring. (bbdb-horiz-pop-up-window-size): New variable. (bbdb-pop-up-buffer): Use it. (bbdb-auto-notes-rules-expanded): New variable. * lisp/bbdb-com.el: Use eval-and-compile. (bbdb-subint): Moved here from lisp/bbdb.el. Simplified. (bbdb-parse-phone): Return value always includes extension. (bbdb-read-record): Simplified accordingly. (bbdb-prompt-for-new-field): Use phone number style as returned from bbdb-parse-phone. * lisp/bbdb-mua.el: Use eval-and-compile. (bbdb-update-records): Avoid name clash with function search in cl-seq.el. (bbdb-message-header-re): New function. (bbdb-accept-message): Use it. (bbdb-get-address-components): Also return MUA. (bbdb-annotate-message): Bug fix. Simplify. (bbdb-mua-pop-up-init): New function. (bbdb-auto-notes): Complete re-write. * lisp/bbdb-message.el (bbdb-insinuate-message) (bbdb-insinuate-mail) * lisp/bbdb-rmail.el (bbdb-insinuate-rmail) * lisp/bbdb-gnus.el (bbdb-insinuate-gnus) * lisp/bbdb-mhe.el (bbdb-insinuate-mh) * lisp/bbdb-vm.el (bbdb-insinuate-vm): Do not hook in bbdb-mua-pop-up-bbdb-buffer. (Use instead bbdb-mua-pop-up-init.) 2010-12-15 Roland Winkler * lisp/bbdb.el (bbdb-mua-message): New customization group. (bbdb-update-records-p): Value may also be a function. (bbdb-mua-update-interactive-p): New variable. (bbdb-init-forms): Add message and mail mode support. Sendmail is deprecated (use mail instead). Remove outdated support for reportmail, supercite and w3. (bbdb-initialize): Updated accordingly. Do not test presence of features (which is not needed). (bbdb-insinuate-sendmail): Removed (use bbdb-insinuate-mail). ( bbdb-insinuate-message): Moved to bbdb-message.el. * lisp/bbdb-com.el (bbdb-mail, bbdb-mail-address): Simplified. * lisp/bbdb-mua.el (bbdb-mua, bbdb-message-header): New functions. (bbdb-get-address-components): Use bbdb-message-header. Simplified. (bbdb-update-records): New arg msg-key. Handle message cache. Arg update-p may also be a function. (bbdb-mua-update-records, bbdb-mua-update-mua) (bbdb-mua-update-interactive-p, bbdb-mua-pop-up-bbdb-buffer): New functions. (bbdb-mua-display-records, bbdb-mua-display-sender) (bbdb-mua-display-recipients, bbdb-mua-annotate-sender) (bbdb-mua-annotate-recipients, bbdb-mua-edit-notes-sender) (bbdb-mua-edit-notes-recipients): New commands. * lisp/bbdb-vm.el (bbdb/vm-header): Remove MIME decoding. (bbdb/vm-update-records, bbdb/vm-pop-up-bbdb-buffer) (bbdb/vm-show-records, bbdb/vm-show-sender) (bbdb/vm-show-recipients, bbdb/vm-annotate-sender) (bbdb/vm-edit-notes): Obsolete. Use instead generic functions in bbdb-mua.el. (bbdb-insinuate-vm): Use generic commands. * lisp/bbdb-gnus.el (bbdb/gnus-update-records) (bbdb/gnus-pop-up-bbdb-buffer, bbdb/gnus-show-records) (bbdb/gnus-show-sender, bbdb/gnus-show-recipients) (bbdb/gnus-annotate-sender, bbdb/gnus-edit-notes) (bbdb/gnus-summary-show-all-recipients): Obsolete. Use instead generic functions in bbdb-mua.el. (bbdb-insinuate-gnus): Use generic commands. (bbdb/gnus-lines-and-from-length): Removed as gnus-optional-headers appears to be obsolete, too. (bbdb/gnus-message-marker-field): New variable. (bbdb-message-marker-field): Declared obsolete. (bbdb/gnus-summary-get-sender, bbdb/gnus-summary-sender-in-bbdb) (bbdb/gnus-nnimap-folder-list-from-bbdb): Simplified. * lisp/bbdb-rmail.el (bbdb/rmail-update-records) (bbdb/rmail-pop-up-bbdb-buffer, bbdb/rmail-show-records) (bbdb/rmail-show-sender, bbdb/rmail-show-recipients) (bbdb/rmail-annotate-sender, bbdb/rmail-edit-notes) (bbdb/rmail-summary-show-all-recipients): Obsolete. Use instead generic functions in bbdb-mua.el. (bbdb-insinuate-rmail): Use generic commands. Remove defadvice which has become obsolete because header Messge-ID is used for message caching. * lisp/bbdb-mhe.el, lisp/bbdb-message.el: New files. * lisp/Makefile: Updated to compile also the new files. 2010-11-30 Roland Winkler * lisp/bbdb.el (bbdb-update-records-p): Fix docstring. (bbdb-message-pop-up): Change default to a less aggressive nil. (bbdb-format-record-one-line): Remove linebreaks from multi-line notes. * lisp/bbdb-com.el (bbdb-delete-duplicate-mails) (bbdb-display-records-completely) (bbdb-display-records-with-layout, bbdb-copy-records-as-kill): Doc fix. (bbdb-search-duplicates): Improved interactive spec. New arg records. Doc fix (bbdb-delete-field-or-record): Make records a required arg. New arg fields. Doc fix. (bbdb-delete-records, bbdb-toggle-records-layout) (bbdb-sort-addresses, bbdb-sort-phones, bbdb-sort-notes) (bbdb-add-mail-alias): Make records a required arg. Doc fix. (bbdb-mail-address): New command bound to M. (bbdb-mail): Use it. New arg verbose. Fix interactive spec. (bbdb-mail-yank): Renamed from bbdb-yank-addresses. Bug fix. (bbdb-yank-addresses): Declared obsolete. (bbdb-browse-url): Simplify. Doc fix. (bbdb-grab-url): Simplify. * lisp/bbdb-vm.el (bbdb/vm-update-records-p) * lisp/bbdb-gnus.el (bbdb/gnus-update-records-p) * lisp/bbdb-rmail.el (bbdb/rmail-update-records-p): Improved default. 2010-11-01 Roland Winkler * lisp/bbdb.el (bbdb-wrap-column): New variable. (bbdb-format-list): Use bbdb-wrap-column and bbdb-separator-alist. (bbdb-layout-alist, bbdb-format-address-continental) (bbdb-format-address-default, bbdb-format-record-multi-line): Change value of indentation such that it becomes the total indentation. * lisp/bbdb-com.el (bbdb-dwim-mail): Fix typo. 2010-10-17 Roland Winkler * lisp/bbdb.el (bbdb-mail-allow-redundancy): Doc fix. (bbdb-mode-map): Include bbdb-do-all-records in "Use database" submenu. * lisp/bbdb-com.el (bbdb-record-list): Doc fix. (bbdb-dwim-mail): Arg MAIL may be a number, which will pick the MAILth mail address. (bbdb-mail): New optional arg N to pick Nth mail address. 2010-09-30 Roland Winkler * lisp/bbdb.el (bbdb-insert-record-internal): Handle empty database properly. * lisp/bbdb-com.el (bbdb-dwim-mail): Cleanup code. 2010-09-19 Roland Winkler * lisp/bbdb-mua.el (bbdb-prompt-for-create): Quit with C-g. (bbdb-annotate-message) Call UPDATE-P only if record is not yet defined. 2010-08-28 Roland Winkler * Relicense all BBDB files to GPLv3 or later. Update email address to winkler@gnu.org. * lisp/bbdb.el (bbdb-completion-list): Element name replaced by fl-name and lf-name. * lisp/bbdb-com.el (bbdb-insert-field): Use remq instead of delq. (bbdb-complete-mail): Do not use trimmed version of the pattern for partial completion. Distinguish fl-name and lf-name. 2010-08-01 Roland Winkler * lisp/bbdb.el (bbdb-message-caching): Renamed from bbdb-message-caching-enabled. (bbdb-create-hook): Renamed from bbdb-create-hooks. (bbdb-change-hook): Renamed from bbdb-change-hooks. (bbdb-after-change-hook): Renamed from bbdb-after-change-hooks. (bbdb-notice-hook): Renamed from bbdb-notice-hooks. (bbdb-accept-message-alist): Renamed from bbdb-accept-messages-alist. (bbdb-ignore-message-alist): Renamed from bbdb-ignore-messages-alist. (bbdb-update-records-p): New user var. (bbdb-notice-hook-pending): Renamed from bbdb-inside-notice-hooks. (bbdb-user-mail-address-re): Renamed from bbdb-user-mail-names. (bbdb-mail-allow-redundancy): Renamed from bbdb-dwim-mail-allow-redundancy. (bbdb-check-auto-save-file): Renamed from bbdb-notice-auto-save-file. (bbdb-completion-list): Renamed from bbdb-completion-alist. (bbdb-mail-alias): Renamed from bbdb-mail-alias-mode. (bbdb-mail-user-agent): Replacement for bbdb-user-style. (bbdb-compose-mail): Renamed from bbdb-mail-internal. (bbdb-default-separator): Renamed from bbdb-notes-default-separator. (bbdb-separator-alist): Renamed from bbdb-notes-separator-alist. (bbdb-concat): Renamed from bbdb-join. * lisp/bbdb-com.el (bbdb-grab-url): Renamed from bbdb-url-grab-url. * lisp/bbdb-mua.el: New file. Content merged from bbdb-com.el and bbdb-hooks.el (bbdb-get-address-components): Changed calling sequence. (bbdb-message-header): Renamed from bbdb-message-field. (bbdb-accept-message): Renamed from bbdb-ignore-most-messages. (bbdb-ignore-message): Renamed from bbdb-ignore-some-messages. (bbdb-select-message): Renamed from bbdb-ignore-selected-messages-hook. (bbdb-auto-notes): Renamed from bbdb-auto-notes-hook. (bbdb-canonicalize-mail-1): Renamed from bbdb-sample-canonicalize-mail-function. * lisp/bbdb-print.el (bbdb-print-file): Renamed from bbdb-print-file-name. (bbdb-print-tex-quote-alist): New var. (bbdb-print-address-format-alist): Renamed from bbdb-address-print-format-alist. (bbdb-print-record): Renamed from bbdb-print-format-record. (bbdb-print-address-continental): Renamed from bbdb-print-format-address-continental. (bbdb-print-address-default): Renamed from bbdb-print-format-address-default. (bbdb-print-phone): Renamed from bbdb-print-phone-string. * lisp/bbdb-vm.el (bbdb/vm-auto-folder): Renamed from bbdb/vm-auto-folder-alist. (bbdb/vm-virtual-folder): Renamed from bbdb/vm-virtual-folder-alist. ;; Local Variables: ;; coding: utf-8 ;; End: Copyright (C) 2010-2014 Roland Winkler This file is part of the Insidious Big Brother Database (aka BBDB), BBDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. BBDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with BBDB. If not, see . bbdb-3.1.2/README0000644000175000017500000002164212277757553010240 00000000000000Copyright (C) 2010-2014 Roland Winkler See the end of the file for license conditions. BBDB is the Insidious Big Brother Database for GNU Emacs. It provides an address book for email and snail mail addresses, phone numbers and the like. It can be linked with various Emacs mail clients (Message and Mail mode, Rmail, Gnus, MH-E, and VM). BBDB is fully customizable. BBDB is available at http://savannah.nongnu.org/projects/bbdb/ To check it out, use git clone git://git.savannah.nongnu.org/bbdb.git Questions, comments, suggestions, and bug reports may be directed to the BBDB mailing list at bbdb-info@lists.sourceforge.net. To subscribe, send mail to bbdb-info-request@lists.sourceforge.net, with 'subscribe' as the subject. ================================================================== Installation: (see also the generic file INSTALL) To compile and install BBDB with `make': 0) (BBDB development version only) Configure the configure process: Run `autogen.sh' in the top directory of the BBDB code. This creates the `configure' script required for step 1). 1) Configure the build process: Run the `configure' script in the top directory of the BBDB code. This performs a number of checks on your system and generates the Makefiles accordingly. You need at least GNU Emacs 23. The `configure' script comes with various options: `--with-vm-dir=DIR' specifies the path where VM can be found. Without this option the resulting BBDB build does not support VM. `--with-lispdir=DIR' specifies where to install the lisp files. Use `configure --help' to see all available options. 2) Build BBDB: To build BBDB type 'make'. If you use the BBDB development version, but you do not have autoconf, go to the lisp directory and type 'make --makefile=./makefile-temp'. 3) Install BBDB: To install BBDB type `make install'. This installs all files in their usual system directories. You can override these defaults via respective options for the configure script. The TeX files in the tex directories are installed in ${datadir} which defaults to /usr/local/share/bbdb/. These files are only used by BBDB. They need not be made known to your local TeX installation. See the user variable bbdb-print-tex-path below. `make install' is not required to run BBDB. 4) Activate BBDB: i) If the BBDB lisp files are in a directory "/path/to/bbdb/lisp" you can use in your emacs init file (require 'bbdb-loaddefs "/path/to/bbdb/lisp/bbdb-loaddefs.el") This adds "/path/to/bbdb/lisp" to the load-path; so it is all you need to make BBDB known to your Emacs. ii) The user variable bbdb-print-tex-path should point to the directory where the BBDB TeX files reside (default /usr/local/share/bbdb). =============================================================================== Usage notes BBDB 3.1 is the first release of BBDB after a long time. It requires GNU Emacs 23 or newer. Its code is still under development. While it should work reliably, users of previous versions of BBDB are advised that the format of the BBDB database file has changed. Migration to the new format should happen automatically. Yet it is recommended to make a copy of the old file, in case something unexpected happens or you might want to go back. As compared with BBDB 2.xx, many variables, functions, and commands have changed in BBDB 3. Most likely you will have to review your customizations carefully. You may want to call bbdb-undocumented-variables to identify outdated (i.e., now usually undocumented) variables in your init file. All user variables for the core of BBDB 3 are listed at the beginning of bbdb.el. Some extensions of BBDB 3 define their user variables at the beginning of the respective files. Generally the default values for user variables are chosen such that they make BBDB the least aggressive. You can customize this behavior in many ways. See below for an overview. The BBDB info manual is still awaiting a more complete overhaul. BBDB interface with mail user agents (MUAs) =========================================== BBDB can interface with various mail user agents (MUAs). These include Rmail, Gnus, VM, MH-E, Message and Mail mode. This lets you - display the BBDB records for the sender and/or recipients of a message you are viewing - create or update the BBDB records for the sender and/or recipients of a message - add annotations to the BBDB records for the sender and/or recipients of a message There are two ways for BBDB to interface with MUAs: Interactive commands -------------------- Call bbdb-initialize (usually in your init file) to initialize the MUA interfaces based on interactive commands MUA commands include bbdb-mua-display-records, bbdb-mua-display-sender, bbdb-mua-display-recipients bbdb-annotate-record, bbdb-mua-annotate-sender, bbdb-mua-annotate-recipients bbdb-mua-edit-field, bbdb-mua-edit-field-sender, bbdb-mua-edit-field-recipients These MUA commands operate either on existing records only. Or they can create new records. They are all controlled by bbdb-mua-update-interactive-p. This is a cons pair (WITHOUT-PREFIX . WITH-PREFIX). The car is used if the command is called without a prefix. The cdr is used if the command is called with a prefix (and if the prefix is not used for another purpose). WITHOUT-PREFIX and WITH-PREFIX may take the values (here ADDRESS is an email address found in a message): nil Do nothing. search Search for existing records matching ADDRESS. update Search for existing records matching ADDRESS; update name and mail field if necessary. query Search for existing records matching ADDRESS; query for creation of a new record if the record does not exist. create or t Search for existing records matching ADDRESS; create a new record if it does not yet exist. a function This functions will be called with no arguments. It should return one of the above values (see below). read Read the value interactively. BBDB 2 also used MUA-specific variables bbdb/MUA-update-records-mode to control its interfaces with MUAs. In BBDB 3 the variables bbdb/MUA-update-records-p are only used as fallback if the generic (MUA-independent) variables bbdb-mua-update-interactive-p, bbdb-update-records-p or bbdb-mua-auto-update-p result in a value of nil for the arg UPDATE-P of bbdb-update-records. Noninteractive functions ------------------------ Call bbdb-mua-auto-update-init (usually in your init file) to hook BBDB's hook function bbdb-mua-auto-update into the MUAs. bbdb-mua-auto-update automatically updates the BBDB records for the sender and/or recipients of a message. If bbdb-mua-pop-up is non-nil, the matching records are also displayed in a continuously updated BBDB window, The behavior of bbdb-mua-auto-update is controlled by bbdb-mua-auto-update-p. This may take the same values as bbdb-mua-update-interactive-p (except read). Binding this to a function is often most helpful for noninteractive use. For example, you may want to bind bbdb-mua-auto-update-p to the function bbdb-select-message, see bbdb-accept-message-alist and bbdb-ignore-message-alist. If a message is accepted by bbdb-select-message, the actual action performed by BBDB (i.e., the return value of bbdb-select-message) is given by bbdb-update-records-p. ================================================================== Notes for BBDB lisp hackers: ---------------------------- If you write your own functions and commands to modify BBDB records, do not call the low-level functions bbdb-record-set-* such as bbdb-record-set-aka, bbdb-record-set-mail etc. The recommended sequence of calls is - one or multiple calls of bbdb-record-set-field for the respective fields to be changed. This not only sets the fields, but it also ensures the integrity of the database. Also, this makes your code more robust with respect to possible future changes of BBDB's innermost internals. - a call of bbdb-change-record which updates the database after a change of record and redisplays the records. - To display newly created records call bbdb-display-records. ================================================================== Copyright (C) 2010-2014 Roland Winkler This file is part of the Insidious Big Brother Database (aka BBDB), BBDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. BBDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with BBDB. If not, see . bbdb-3.1.2/tex/0000755000175000017500000000000012327261605010213 500000000000000bbdb-3.1.2/tex/bbdb-cols.tex0000644000175000017500000001636111404222100012471 00000000000000%%% bbdb-cols.tex - multiple columns per page, multiple pages per sheet. %%% Authors: Luigi Semenzato %%% Boris Goldowsky %%% Copyright (C) 1993 Boris Goldowsky %%% Version: 3.92; 5Jan95 %%% Commentary: %%% %%% Put \input bbdb-cols.tex %%% at the beginning of your TeX file. %%% Then \twocol, \threecol, or \fourcol for multi-column output %%% or \gridformat (4x3 grid of small credit-card-sized pages) %%% or \quadformat{xsize}{ysize} for four 2-column pages per sheet. %%% In any case you will need to put \endcol at the end of the %%% document, before \bye. %%% For instructions on using this format file with BBDB, see bbdb-print.el %%% which should have come bundled with this file. The complete bbdb-print %%% package is also available via anonymous ftp at: %%% /cs.rochester.edu:/pub/u/boris/bbdb-print.tar.gz %%% This file is part of the bbdb-print extensions to the Insidious %%% Big Brother Database, which is for use with GNU Emacs. %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as %%% published by the Free Software Foundation; either version 1, or %%% (at your option) any later version. %%% %%% This program is distributed in the hope that it will be useful, %%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %%% General Public License for more details. %%% %%% You should have received a copy of the GNU General Public License %%% along with GNU Emacs; see the file COPYING. If not, write to %%% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \newdimen\colshsize \colshsize=\hsize \newdimen\columngutter \columngutter=.2in % space between columns \newbox\columnA \newbox\columnB \newbox\columnC \newdimen\FULLHSIZE \newdimen\FULLVSIZE \newbox\quadrantbox \newbox\firstquadrant \newbox\secondquadrant \newbox\thirdquadrant \newbox\fourthquadrant \newbox\row \newbox\page \def\columnbox{\leftline{\pagebody}} \def\colsline{\hbox to \colshsize} \newcount\NROW \NROW=3 % for grid format. are these really variables \newcount\NCOL \NCOL=4 % that can be changed? should they be set % from lisp? I'm not sure. \newcount\rowindex \newcount\colindex \def\onecol % for consistency---or maybe one could use it for switching back. { \output={\shipout\vbox{\makeheadline\colsline{\columnbox}\makefootline} \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} \def\endcol{} }% end onecol \def\twocol { \advance\hsize by -\columngutter \divide\hsize 2 \let\column=A \output={\if A\column \global\setbox\columnA=\columnbox \global\let\column=B \else \shipout\vbox{\makeheadline \colsline{\box\columnA\hfil\columnbox} \makefootline} \advancepageno \global\let\column=A \fi \ifnum\outputpenalty>-20000 \else\dosupereject\fi} \def\endcol { \vfill\supereject\if A\column \else\null\vfill\eject\fi } } % end twocol \def\threecol { \advance\hsize -\columngutter \advance\hsize -\columngutter \divide\hsize 3 \let\column=A \output={\if A\column \global\setbox\columnA=\columnbox \global\let\column=B \else \if B\column \global\setbox\columnB=\columnbox \global\let\column=C \else \shipout\vbox{\makeheadline \colsline{\box\columnA\hfil\box\columnB \hfil\columnbox} \makefootline} \advancepageno \global\let\column=A \fi\fi \ifnum\outputpenalty>-20000 \else\dosupereject\fi} \def\endcol { \if A\column \null\vfill\eject\null\vfill\eject \else\if B\column \null\vfill\eject \fi\fi \vfill\supereject } } % end threecol \def\fourcol { \advance\hsize -3\columngutter \divide\hsize 4 \let\column=A \output={\if A\column \global\setbox\columnA=\columnbox \global\let\column=B \else \if B\column \global\setbox\columnB=\columnbox \global\let\column=C \else \if C\column \global\setbox\columnC=\columnbox \global\let\column=D \else \shipout\vbox { \makeheadline \colsline{\box\columnA\hfil\box\columnB\hfil \box\columnC\hfil\columnbox} \makefootline} \advancepageno\global\let\column=A \fi\fi\fi \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \def\endcol { \vfill\supereject \if A\column \else\null\vfill\eject\fi \if B\column \else\null\vfill\eject\fi \if C\column \else\null\vfill\eject\fi } } % end fourcol \def\quadformat#1#2 { \FULLHSIZE=\hsize \FULLVSIZE=\vsize \colshsize=#1 \vsize=#2 \hsize=\colshsize \advance\hsize by -.15in \divide\hsize 2 \let\lr=L \let\quadrant=A \output={\if L\lr \global\setbox\columnA=\columnbox \global\let\lr=R \else \global\setbox\quadrantbox=\vbox{\colsline {\box\columnA\hfil\columnbox}} \global\let\lr=L \quadrantformat \fi \ifnum\outputpenalty>-20000 \else\dosupereject\fi} \def\quadrantformat {\if A\quadrant \global\setbox\firstquadrant=\box\quadrantbox \global\let\quadrant=B \else \if B\quadrant \global\setbox\secondquadrant=\box\quadrantbox \global\let\quadrant=C \else \if C\quadrant \global\setbox\thirdquadrant=\box\quadrantbox \global\let\quadrant=D \else {\shipout \vbox to \FULLVSIZE {\FULLLINE{\box\firstquadrant\hfil\box\secondquadrant} \vfill \FULLLINE{\box\thirdquadrant\hfil\box\quadrantbox}}} \global\let\quadrant=A \advancepageno \fi\fi\fi} \def\FULLLINE{\hbox to \FULLHSIZE} \def\endcol{\supereject\if R\lr \null\vfill\eject\fi} } % end of quadformat \def\grid { \def\rowspace{\vbox to 0.2in{}} \def\colspace{\hbox to 0.2in{}} \hsize=1.5in \vsize=2.9in \rowindex=0 \colindex=0 \setbox\row=\null \setbox\page=\null \output={\global\advance\colindex by 1 \ifnum\colindex>\NCOL \global\colindex=1 \global\setbox\page=\vbox{\box\page\rowspace\box\row} \global\setbox\row=\null \global\advance\rowindex by 1 \ifnum\rowindex=\NROW \global\rowindex=1 \shipout\box\page \global\setbox\page=\null \advancepageno \fi \fi \global\setbox\row=\hbox{\box\row\colspace\columnbox}} \def\columnbox{\leftline{\pagebody}} \def\endcol{\vfill\supereject \ifnum\colindex=1\null\vfill\eject\fi} } % end of grid. %%% bbdb-cols.tex ends here. bbdb-3.1.2/tex/Makefile.in0000644000175000017500000003306212327261573012210 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # tex/Makefile.am for BBDB # # Copyright (C) 2013 Christian Egli # Copyright (C) 2013-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = tex DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_pkgdata_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/emacs_vm.m4 \ $(top_srcdir)/m4/package_date.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(dist_pkgdata_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_ELCFLAGS = @AM_ELCFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EMACS = @EMACS@ EMACSLOADPATH = @EMACSLOADPATH@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_DATE = @PACKAGE_DATE@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ dist_pkgdata_DATA = \ bbdb-cols.tex \ bbdb-print-brief.tex \ bbdb-print.tex all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tex/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tex/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_pkgdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_pkgdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_pkgdataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_pkgdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bbdb-3.1.2/tex/bbdb-print-brief.tex0000644000175000017500000001144511404224241013760 00000000000000%%% bbdb-print-brief.tex - for formatting address lists, one line per entry. %%% Authors: Luigi Semenzato %%% Boris Goldowsky %%% Copyright (C) 1993 Boris Goldowsky %%% Version: 3.91; 19Dec94 %%% For instructions on using this format file with BBDB, see bbdb-print.el %%% which should have come bundled with this file; or write to %%% boris@cs.rochester.edu. %%% This file is part of the bbdb-print extensions to the Insidious %%% Big Brother Database, which is for use with GNU Emacs. %%% %%% The Insidious Big Brother Database is free software; you can redistribute %%% it and/or modify it under the terms of the GNU General Public License as %%% published by the Free Software Foundation; either version 1, or (at your %%% option) any later version. %%% %%% BBDB is distributed in the hope that it will be useful, but WITHOUT ANY %%% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS %%% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more %%% details. %%% %%% You should have received a copy of the GNU General Public License %%% along with GNU Emacs; see the file COPYING. If not, write to %%% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. %%% The address-list file should look something like this: %%% \input file % this format file's filename %%% \setsize{6} % point size of type to use %%% % or \setpssize{6} to use PostScript fonts. (optional) %%% \setseparator{3} % which style of separators, 0-7 %%% %%% \separator{A} % include a separator here %%% %%% \beginrecord % and start a record %%% \name{A. Name} %%% \phone{location: (xxx) xxx-xxxx} %%% \address{1234 Main Street\\ %%% Anytown, XX 00000\\} %%% \note{note name}{note text} %%% \notes{blah blah} %%% \endrecord %%% %%% \endaddresses % done %%% \bye \nopagenumbers \raggedright \tolerance=10000 \hbadness=10000 \parskip 0pt \parindent=0pt % was 10pt %%% %%% Fonts %%% \def\setsize#1{ \font\rm=ecrm#1 \font\bf=ecbx#1 \font\it=\ifnum #1=6 ecti7 \else ecti#1 \fi \font\tt=ectt#1 \font\bigbf=ecbx#1 scaled \magstep3 \rm \baselineskip=#1pt \ifnum #1>9 \advance\baselineskip by 1pt \fi } \def\setpssize#1{ \font\rm=ptmr at #1pt \font\bf=ptmb at #1pt \font\it=ptmri at #1pt \font\tt=pcrr at #1pt {\dimen0=#1pt\global\font\bigbf=ptmb at 1.8\dimen0} \rm \baselineskip=#1pt } %%% %%% Define separator types %%% \def\setseparator#1{ \ifnum #1=1 \def\sep##1{\line{\hrulefill}\smallskip\mark{##1}} \else \ifnum #1=2 \def\sep##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip \centerline{\bf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule \mark{##1}}} \else \ifnum #1=3 \def\sep##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip \centerline{\bigbf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule} \medskip\mark{##1}} \else \ifnum #1=4 \def\sep##1{\smallskip\centerline{\bigbf{##1}}\medskip\mark{##1}} \else \ifnum #1=5 \def\sep##1{\hrule\smallskip \centerline{\bigbf{##1}}\smallskip\hrule\medskip\mark{##1}} \else \ifnum #1=6 \def\cute{$\sya\syb\syc\syd$} \def\revcute{$\syd\syc\syb\sya$} \let\sya=\heartsuit\let\syb=\spadesuit \let\syc\diamondsuit\let\syd=\clubsuit \def\cycle{\let\tmp=\sya\let\sya=\syb \let\syb=\syc\let\syc=\syd\let\syd=\tmp} \def\sep##1{\smallskip \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil} \cycle\medskip\mark{##1}} \else \ifnum #1=7 \def\cute{$\sya\syb\syc\syd$} \def\revcute{$\syd\syc\syb\sya$} \let\sya=\heartsuit\let\syb=\spadesuit \let\syc=\diamondsuit\let\syd=\clubsuit \def\cycle{\let\tmp=\sya\let\sya=\syb\let\syb=\syc\let\syc=\syd \let\syd=\tmp} \def\sep##1{\hbox{\vrule\vbox{\hrule\smallskip \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil} \smallskip\hrule}\vrule}\medskip\cycle\mark{##1}} \else \def\sep##1{\mark{##1}} \fi\fi\fi\fi\fi\fi\fi \def\separator##1{\noalign{\sep##1}} } % end setseparator %%% %%% Macros for formatting the entries. %%% \def\\{} \def\firstline#1#2{% the name and (maybe) the first phone number. {\bf #1}\hfil&\hfil#2&\hskip0pt} \def\name#1{\firstline{#1}{}} % for backwards compatibility \def\phone#1{\hfil#1&\hskip0pt} \def\address#1{#1\hfil&\hskip0pt} \def\comp#1{\hskip0pt} \def\email#1{\hskip0pt} \def\note#1#2{\hskip0pt} \def\notes#1{\hskip0pt} \def\beginrecord{\relax} \def\endrecord{\cr} \def\beginaddresses{\halign\bgroup&##\quad\cr} \def\endaddresses{\egroup} \def\today{\number\day\space \ifcase\month\or Jan\or Feb\or Mar\or Apr \or May\or June\or Jul\or Aug\or Sept\or Oct\or Nov\or Dec\fi \space\number\year} %%% bbdb-print-brief.tex ends here. bbdb-3.1.2/tex/bbdb-print.tex0000644000175000017500000001212611404222113012664 00000000000000%%% bbdb-print.tex - for formatting address lists. %%% Authors: Luigi Semenzato %%% Boris Goldowsky %%% Copyright (C) 1993 Boris Goldowsky %%% Version: 3.92; 5Jan95 %%% For instructions on using this format file with BBDB, see bbdb-print.el %%% which should have come bundled with this file. The complete bbdb-print %%% package is also available via anonymous ftp at: %%% /cs.rochester.edu:/pub/u/boris/bbdb-print.tar.gz %%% This file is part of the bbdb-print extensions to the Insidious %%% Big Brother Database, which is for use with GNU Emacs. %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as %%% published by the Free Software Foundation; either version 1, or %%% (at your option) any later version. %%% %%% This program is distributed in the hope that it will be useful, %%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %%% General Public License for more details. %%% %%% You should have received a copy of the GNU General Public License %%% along with GNU Emacs; see the file COPYING. If not, write to %%% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. %%% The address-list file should look something like this: %%% \input file % this format file's filename %%% \setsize{6} % point size of type to use %%% % or \setpssize{6} to use PostScript fonts. (optional) %%% \setseparator{3} % which style of separators, 0-7 %%% %%% \separator{A} % include a separator here %%% %%% \beginrecord % and start a record %%% \name{A. Name} %%% \phone{location: (xxx) xxx-xxxx} %%% \address{1234 Main Street\\ %%% Anytown, XX 00000\\} %%% \note{note name}{note text} %%% \notes{blah blah} %%% \endrecord %%% %%% \endaddresses % done %%% \bye \raggedright \tolerance=10000 \hbadness=10000 \parskip 0pt \parindent=0pt \footline{\hfil} %%% %%% Fonts %%% \def\setsize#1{ \font\rm=ecrm#1 \font\bf=ecbx#1 \font\it=\ifnum #1=6 ecti7 \else ecti#1 \fi \font\tt=ectt#1 \font\bigbf=ecbx#1 scaled \magstep3 \rm \baselineskip=#1pt \ifnum #1>9 \advance\baselineskip by 1pt \fi } \def\setpssize#1{ \font\rm=ptmr at #1pt \font\bf=ptmb at #1pt \font\it=ptmri at #1pt \font\tt=pcrr at #1pt {\dimen0=#1pt\global\font\bigbf=ptmb at 1.8\dimen0} \rm \baselineskip=#1pt } %%% %%% Define separator types %%% \def\setseparator#1{ \ifnum #1=1 \def\separator##1{\hrule\smallskip\mark{##1}} \else \ifnum #1=2 \def\separator##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip \centerline{\bf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule \mark{##1}}} \else \ifnum #1=3 \def\separator##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip \centerline{\bigbf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule} \medskip\mark{##1}} \else \ifnum #1=4 \def\separator##1{\smallskip\centerline{\bigbf{##1}}\medskip\mark{##1}} \else \ifnum #1=5 \def\separator##1{\hrule\smallskip \centerline{\bigbf{##1}}\smallskip\hrule\medskip\mark{##1}} \else \ifnum #1=6 \def\cute{$\sya\syb\syc\syd$} \def\revcute{$\syd\syc\syb\sya$} \let\sya=\heartsuit\let\syb=\spadesuit \let\syc\diamondsuit\let\syd=\clubsuit \def\cycle{\let\tmp=\sya\let\sya=\syb \let\syb=\syc\let\syc=\syd\let\syd=\tmp} \def\separator##1{\smallskip \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil} \cycle\medskip\mark{##1}} \else \ifnum #1=7 \def\cute{$\sya\syb\syc\syd$} \def\revcute{$\syd\syc\syb\sya$} \let\sya=\heartsuit\let\syb=\spadesuit \let\syc=\diamondsuit\let\syd=\clubsuit \def\cycle{\let\tmp=\sya\let\sya=\syb\let\syb=\syc\let\syc=\syd \let\syd=\tmp} \def\separator##1{\hbox{\vrule\vbox{\hrule\smallskip \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil} \smallskip\hrule}\vrule}\medskip\cycle\mark{##1}} \else \def\separator##1{\mark{##1}} \fi\fi\fi\fi\fi\fi\fi } % end setseparator %%% %%% Macros for formatting the entries. %%% \def\beginaddresses{} \def\endaddresses{ \bigskip\hrule\smallskip \noindent {\bf Printed \today}\vfill\endcol} \def\beginrecord{\bigbreak} \def\endrecord{\bigbreak} \def\\{\par} \def\dots{\leaders\hbox to 0.6em{\hss.\hss}} \def\firstline#1#2{% the name and (maybe) the first phone number. \hyphenpenalty=10000\rightskip=0pt plus 1fil \noindent{\bf #1}\dotfill\penalty-1\hbox{}\dotfill{#2}\\ } \def\name#1{\firstline{#1}{}} % for backwards compatibility \def\comp#1{#1\\} \def\phone#1{\hfill#1\\} \def\email#1{\smallbreak{\tt#1}\\} \def\address#1{\smallbreak#1\smallbreak} \def\note#1#2{{\smallbreak\leftskip=2em\parindent=-1em \noindent\hskip-\leftskip{\it#1: } #2\\ }} \def\notes#1{\smallbreak{\it(#1)}\\ } \def\today{\number\day\space \ifcase\month\or Jan\or Feb\or Mar\or Apr \or May\or June\or Jul\or Aug\or Sept\or Oct\or Nov\or Dec\fi \space\number\year} %%% bbdb-print.tex ends here. bbdb-3.1.2/tex/Makefile.am0000644000175000017500000000163712261715215012174 00000000000000# tex/Makefile.am for BBDB # # Copyright (C) 2013 Christian Egli # Copyright (C) 2013-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . dist_pkgdata_DATA = \ bbdb-cols.tex \ bbdb-print-brief.tex \ bbdb-print.tex bbdb-3.1.2/configure0000754000175000017500000032754512327261572011264 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for bbdb 3.1.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: bbdb-info@lists.sourceforge.net about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bbdb' PACKAGE_TARNAME='bbdb' PACKAGE_VERSION='3.1.2' PACKAGE_STRING='bbdb 3.1.2' PACKAGE_BUGREPORT='bbdb-info@lists.sourceforge.net' PACKAGE_URL='http://savannah.nongnu.org/projects/bbdb/' ac_unique_file="lisp/bbdb.el" ac_subst_vars='LTLIBOBJS LIBOBJS AM_ELCFLAGS VM_FALSE VM_TRUE lispdir EMACSLOADPATH EMACS PACKAGE_DATE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules with_lispdir with_vm_dir ' ac_precious_vars='build_alias host_alias target_alias EMACS EMACSLOADPATH' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures bbdb 3.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/bbdb] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of bbdb 3.1.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-lispdir override the default lisp directory --with-vm-dir=DIR where to find VM lisp directory Some influential environment variables: EMACS the Emacs editor command EMACSLOADPATH the Emacs library search path Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . bbdb home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF bbdb configure 3.1.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by bbdb $as_me 3.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # We need GNU Automake 1.13 for AM_ELCFLAGS. am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='bbdb' VERSION='3.1.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi if git log -1 > /dev/null 2>&1; then PACKAGE_DATE="$(git log -1 --format=format:'%ci')" elif date --rfc-3339=seconds > /dev/null 2>&1; then PACKAGE_DATE="$(date --rfc-3339=seconds)" elif date -u > /dev/null 2>&1; then PACKAGE_DATE="$(date -u)" else PACKAGE_DATE="$(date)" fi # Checks for programs. # Search for Emacs # If set to t, that means we are running in a shell under Emacs. # If you have an Emacs named "t", then use the full path. test x"$EMACS" = xt && EMACS= for ac_prog in emacs xemacs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_EMACS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$EMACS"; then ac_cv_prog_EMACS="$EMACS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_EMACS="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi EMACS=$ac_cv_prog_EMACS if test -n "$EMACS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EMACS" >&5 $as_echo "$EMACS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$EMACS" && break done test -n "$EMACS" || EMACS="no" # Check whether --with-lispdir was given. if test "${with_lispdir+set}" = set; then : withval=$with_lispdir; lispdir="$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: checking where .elc files should go" >&5 $as_echo_n "checking where .elc files should go... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lispdir" >&5 $as_echo "$lispdir" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking where .elc files should go" >&5 $as_echo_n "checking where .elc files should go... " >&6; } if ${am_cv_lispdir+:} false; then : $as_echo_n "(cached) " >&6 else if test $EMACS != "no"; then if test x${lispdir+set} != xset; then # If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly # Some emacsen will start up in interactive mode, requiring C-x C-c to exit, # which is non-obvious for non-emacs users. # Redirecting /dev/null should help a bit; pity we can't detect "broken" # emacsen earlier and avoid running this altogether. { { $as_echo "$as_me:${as_lineno-$LINENO}: \$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) \"\\n\")) (setq load-path (cdr load-path)))' conftest.out"; } >&5 ($EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' conftest.out) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } am_cv_lispdir=`sed -n \ -e 's,/$,,' \ -e '/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}' \ -e '/.*\/share\/x*emacs\/site-lisp$/{s,.*/share/\(x*emacs/site-lisp\),${datarootdir}/\1,;p;q;}' \ conftest.out` rm conftest.out fi fi test -z "$am_cv_lispdir" && am_cv_lispdir='${datadir}/emacs/site-lisp' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_lispdir" >&5 $as_echo "$am_cv_lispdir" >&6; } lispdir="$am_cv_lispdir" fi if test "$EMACS" = no; then : as_fn_error $? "cannot find Emacs" "$LINENO" 5 fi # Checks for libraries. # Check whether --with-vm-dir was given. if test "${with_vm_dir+set}" = set; then : withval=$with_vm_dir; # if VM was requested, make sure we have access to the source if test "x$with_vm_dir" != xno -a "x$with_vm_dir" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VM files" >&5 $as_echo_n "checking for VM files... " >&6; } # convert path to absolute and canonicalize it. VMDIR=$(${EMACS} -batch --quick -eval "(message \"%s\" (expand-file-name \"${with_vm_dir}\"))" 2>&1) VM_LOCATE=$(${EMACS} -batch --quick --directory="${VMDIR}" -eval "(if (locate-library \"vm-autoloads\") (message \"vm\"))" 2>&1) if test "x$VM_LOCATE" = "x"; then as_fn_error $? "*** VM vm-autoloads.el must exist in directory passed to --with-vm-dir." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VMDIR" >&5 $as_echo "$VMDIR" >&6; } # append VMDIR to AM_ELCFLAGS AM_ELCFLAGS="--directory=$VMDIR $AM_ELCFLAGS" fi fi # New conditional VM if test x$VMDIR != x; then VM_TRUE= VM_FALSE='#' else VM_TRUE='#' VM_FALSE= fi # Generate lisp/bbdb-site.el via lisp/Makefile as pkgdatadir is only known # at "make" time. ac_config_files="$ac_config_files Makefile lisp/Makefile lisp/bbdb-pkg.el doc/Makefile tex/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${VM_TRUE}" && test -z "${VM_FALSE}"; then as_fn_error $? "conditional \"VM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by bbdb $as_me 3.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to . bbdb home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ bbdb config.status 3.1.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; "lisp/bbdb-pkg.el") CONFIG_FILES="$CONFIG_FILES lisp/bbdb-pkg.el" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "tex/Makefile") CONFIG_FILES="$CONFIG_FILES tex/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi bbdb-3.1.2/NEWS0000644000175000017500000000226712327255374010047 00000000000000BBDB NEWS -- history of user-visible changes. Copyright (C) 2013-2014 Roland Winkler See the end of the file for license conditions. This file is about changes in BBDB version 3. * BBDB 3.1.2 ** Bug fix release ** New command bbdb-fix-records * BBDB 3.1.1 ** Updated autoconf and automake scripts ** Lisp code in 3.1.1 is identical to lisp code in 3.1. * BBDB 3.1 Initial release ---------------------------------------------------------------------- This file is part of the Insidious Big Brother Database (aka BBDB), BBDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. BBDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with BBDB. If not, see . Local variables: mode: outline paragraph-separate: "[ ]*$" end: bbdb-3.1.2/Makefile.am0000644000175000017500000000266012307506562011375 00000000000000# main Makefile.am for BBDB # # Copyright (C) 2013 Christian Egli # Copyright (C) 2013-2014 Roland Winkler # # This file is part of the Insidious Big Brother Database (aka BBDB), # # BBDB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # BBDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with BBDB. If not, see . SUBDIRS = lisp doc tex doc_DATA = COPYING ChangeLog AUTHORS NEWS README TODO EXTRA_DIST = autogen.sh BBDB_ELPA_FILES = README COPYING lisp/*.el doc/bbdb.info doc/dir tex/*.tex BBDB_ELPA_PACKAGE = bbdb-$(PACKAGE_VERSION).tar # doc/dir is needed for the ELPA package doc/dir: doc/bbdb.info install-info $< $@ CLEANFILES = doc/dir # Package everything in a form suitable for ELPA. elpa: $(BBDB_ELPA_FILES) $(AMTAR) --transform='s:\(lisp\|doc\|tex\)/::' \ --transform='s::bbdb-$(PACKAGE_VERSION)/:' \ --exclude=bbdb-loaddefs.el \ -cf $(BBDB_ELPA_PACKAGE) $(BBDB_ELPA_FILES) @echo "Created $(BBDB_ELPA_PACKAGE)" bbdb-3.1.2/m4/0000755000175000017500000000000012327261604007732 500000000000000bbdb-3.1.2/m4/package_date.m40000644000175000017500000000241412307507561012510 00000000000000### package_date.m4 ## Copyright (C) 2013-2014 Roland Winkler ## ## This file is part of the Insidious Big Brother Database (aka BBDB), ## ## BBDB is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## BBDB is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with BBDB. If not, see . # Figure out timestamp information, for substitution. # If we are in a git repo, use the timestamp of the # most recent commit. Otherwise, use the current time. AC_DEFUN([AC_PACKAGE_DATE], [ if git log -1 > /dev/null 2>&1; then PACKAGE_DATE="$(git log -1 --format=format:'%ci')" elif date --rfc-3339=seconds > /dev/null 2>&1; then PACKAGE_DATE="$(date --rfc-3339=seconds)" elif date -u > /dev/null 2>&1; then PACKAGE_DATE="$(date -u)" else PACKAGE_DATE="$(date)" fi AC_SUBST([PACKAGE_DATE]) ]) bbdb-3.1.2/m4/emacs_vm.m40000644000175000017500000000320412314133413011675 00000000000000### emacs_vm.m4 ## Copyright (C) 2013-2014 Roland Winkler ## ## This file is part of the Insidious Big Brother Database (aka BBDB), ## ## BBDB is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## BBDB is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with BBDB. If not, see . AC_DEFUN([EMACS_VM], [ AC_ARG_WITH([vm-dir], AS_HELP_STRING([--with-vm-dir=DIR], [where to find VM lisp directory]), # if VM was requested, make sure we have access to the source [if test "x$with_vm_dir" != xno -a "x$with_vm_dir" != "x"; then AC_MSG_CHECKING([for VM files]) # convert path to absolute and canonicalize it. VMDIR=$(${EMACS} -batch --quick -eval "(message \"%s\" (expand-file-name \"${with_vm_dir}\"))" 2>&1) VM_LOCATE=$(${EMACS} -batch --quick --directory="${VMDIR}" -eval "(if (locate-library \"vm-autoloads\") (message \"vm\"))" 2>&1) if test "x$VM_LOCATE" = "x"; then AC_MSG_ERROR([*** VM vm-autoloads.el must exist in directory passed to --with-vm-dir.]) fi AC_MSG_RESULT($VMDIR) # append VMDIR to AM_ELCFLAGS AM_ELCFLAGS="--directory=$VMDIR $AM_ELCFLAGS" fi]) # New conditional VM AM_CONDITIONAL([VM], [test x$VMDIR != x]) ])