;ELC   
;;; Compiled by nelhage@localhost.localdomain on Tue Dec 13 12:19:26 2005
;;; from file /home/nelhage/Desktop/bbdb-2.34/lisp/bbdb-print.el
;;; in Emacs version 22.0.50.7
;;; with all optimizations.

;;; This file contains multibyte non-ASCII characters
;;; and therefore cannot be loaded into Emacs 19.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "20")))
    (error "`bbdb-print.el' was compiled for Emacs 20 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\207" [require bbdb bbdb-com] 2)
#@52 *Default file name for printouts of BBDB database.
(custom-declare-variable 'bbdb-print-file-name '"~/bbdb.tex" '(#$ . -668) :group 'bbdb-utilities-print :type 'file)
#@76 *List of fields NOT to print in address list.
See also bbdb-print-require.
(custom-declare-variable 'bbdb-print-omit-fields ''(omit tex-name aka mail-alias) '(#$ . -841) :group 'bbdb-utilities-print :type '(repeat (symbol :tag "Field to exclude")))
#@823 *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, company, net, 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 simple examples:

  Print only people whose phone numbers are known:
    (setq bbdb-print-require 'phone)
  Print people whose names AND companies are known:
    (setq bbdb-print-require '(and name company))
  Print people whose names, and either addresses OR phone numbers are known:
    (setq bbdb-print-require '(and name (or address phone))).
(custom-declare-variable 'bbdb-print-require ''(or address phone) '(#$ . -1097) :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))))
(defalias 'bbdb-print-field-shown-p #[(field) "	>?\207" [field bbdb-print-omit-fields] 2])
(byte-code "\301\302\303\304\305\306\307\310\311\312\313\314\315\316\250\203 \317!\202 \320\321QB\322BBBBB\323BBBBC%\207" [bbdb-default-area-code 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 "^(" int-to-string "000" ") " ((const :tag "Omit certain area codes" omit-area-code) (regexp :tag "Pattern to omit")) ((cons :tag "Phone number location" :value (phone-on-first-line . t) (const :tag "Phone number location" phone-on-first-line) (choice (const :tag "First home number on same line as name" t) (const :tag "Don't put the phone number on the name line" nil) (regexp :tag "Use phone number whose location 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) (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) (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) (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) (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) (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) (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)")))] 16)
#@1887 *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 "location" 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".
(custom-declare-variable '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 . "^[ 	]*$") (ps-fonts) (font-size . 6) (quad-hsize . "3.15in") (quad-vsize . "4.5in")) '(#$ . -5735) :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget)
#@155 *Extra options for `bbdb-print' non-brief format.
These supplement or override entries in `bbdb-print-alist'; see description
of possible contents there.
(custom-declare-variable 'bbdb-print-full-alist ''((columns . 3) (separator . 2) (include-files "bbdb-print" "bbdb-cols")) '(#$ . -7981) :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget)
#@152 *Extra Options for `bbdb-print', brief format.
These supplement or override entries in `bbdb-print-alist'; see description
of possible contents there.
(custom-declare-variable 'bbdb-print-brief-alist ''((columns . 1) (separator . 1) (n-phones . 2) (n-addresses . 1) (include-files "bbdb-print-brief" "bbdb-cols")) '(#$ . -8340) :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget)
#@54 Example setup for making pages for a Filofax binder.
(defconst bbdb-print-filofax-alist (append '((font-size . 12) (columns . 2) (voffset . "-2cm") (hoffset . "-2cm") (vsize . "27cm")) bbdb-print-full-alist) (#$ . 8735))
#@71 *TeX statements to include at the beginning of the `bbdb-print' file.
(custom-declare-variable 'bbdb-print-prolog '(concat "%%%% ====== Phone/Address list in -*-TeX-*- Format =====\n" "%%%%        produced by bbdb-print, version 3.0\n\n") '(#$ . -8962) :group 'bbdb-utilities-print :type '(text :format "%t:\n%v"))
#@65 *TeX statements to include at the end of the `bbdb-print' file.
(custom-declare-variable 'bbdb-print-epilog '"\\endaddresses\n\\bye\n" '(#$ . -9283) :group 'bbdb-utilities-print :type '(text :format "%t:\n%v"))
#@180 *Indicates whether only the primary or all email addresses are printed.
Symbol `primary' means print the primary email address only.
Symbol `all' means print all email addresses.
(custom-declare-variable 'bbdb-print-net ''primary '(#$ . -9501) :group 'bbdb-utilities-print :type '(choice (const primary) (const all)))
#@156 If STRING is not null, then return it concatenated
with rest of arguments.  If it is null, then all arguments are
ignored and the null string is returned.
(defalias 'bbdb-print-if-not-blank #[(string &rest more) "\203\n \302\232\203\f \303\207\304\305	#\207" [string more "" "" apply concat] 4 (#$ . 9826)])
(put 'bbdb-print-if-not-blank 'byte-optimizer 'byte-compile-inline-expand)
#@504 Make a TeX file for printing out the bbdb database.\<bbdb-mode-map>
If "\[bbdb-apply-next-command-to-all-records]\[bbdb-print]" is used instead of simply "\[bbdb-print]", then includes only the
people currently in the *BBDB* buffer.  With a prefix argument, makes
a brief (one-line-per-entry) printout.

There are various variables for customizing the content & format of
the printout, notably the variables `bbdb-print-alist' and
`bbdb-print-require'.  See the file bbdb-print.el for more information.
(defalias 'bbdb-print #[(visible-records to-file brief) "\306!\307\n\203 \202 \f\"34\204 \310 \202% 5q\210\311\312\"6\313\3143\"A\2034 \315\2025 \3167\313\3173\"A\3208\313\3213\"A9\313\3223\"A\313\3233\"A\324	!\210~\210\325 \210:c\210\326\327;\211<\203\222 \313<@3\"A\211;\203\211 \330\331<@;#c\210<A\211<\204q *\313\3323\"A\211=\203\260 \330\333=@\"c\210=A\211=\204\237 )\330\3347\313\3353\"A#\330\336\313\3373\"A\"\340=\203\336 \330\341\313\3423\"A\313\3433\"A#\202\344=\203\351 \345\202\346U\203\364 \347\202\350U\203\377 \351\202\352U\203\n\353\202\354U\205\3557\356\232\203\357\202\360\361\261\2106\203A\3626@8\n9&86A\2116\204'>c\210eb.\207" [to-file bbdb-print-file-name brief bbdb-print-brief-alist bbdb-print-full-alist bbdb-print-alist expand-file-name append bbdb-records mapcar car assoc ps-fonts "ps" "" columns t phone-on-first-line n-phones n-addresses find-file erase-buffer (hsize vsize hoffset voffset) nil format "\\%s=%s\n" include-files "\\input %s\n" "\n\\set%ssize{%d}\n" font-size "\\setseparator{%d}\n" separator quad "\\quadformat{%s}{%s}" quad-hsize quad-vsize grid "\\grid" 4 "\\fourcol" 3 "\\threecol" 2 "\\twocol" 1 "\\onecol" "ps" "\n\n" "\n\n\\catcode`=\\active\\chardef=\"FF" "\n\n\\beginaddresses\n" bbdb-print-format-record alist visible-records bbdb-buffer-name records psstring current-letter pofl bbdb-print-prolog val dimens infiles bbdb-print-epilog] 9 (#$ . 10219) (list (bbdb-do-all-records-p) (read-file-name "Print To File: " (file-name-directory bbdb-print-file-name) bbdb-print-file-name nil (file-name-nondirectory bbdb-print-file-name)) current-prefix-arg)])
#@617 Alist of address identifying and address formatting functions for printing.
The key is an identifying function which accepts an address.  The
associated value is a formatting function which inserts the formatted
address in the current buffer.  If the identifying function returns
non-nil, the formatting function is called.  The nil key is a default
value will allways calls the associated formatting function.  Therefore
you should always have (nil . bbdb-print-format-address-default) as the
last element in the alist.

The functions must take one argument, the address.

See also `bbdb-address-formatting-alist'.
(defvar bbdb-address-print-formatting-alist '((bbdb-address-is-continental . bbdb-print-format-address-continental) (nil . bbdb-print-format-address-default)) (#$ . 12433))
#@294 Insert formated continental address ADDR in current buffer for printing.
This format is used in western Europe, for example.

This function is a possible formatting function for
`bbdb-address-print-formatting-alist'.

The result looks like this:
 street
 street
 ...
 zip city, state
 country
(defalias 'bbdb-print-format-address-continental #[(addr) "\306\307\310\203\206 \311\312\313H\314#\315H\316H\317H\211G\320V\204/ 	G\320V\204/ \nG\320V\203e 	\211G\320V\203B G\320V\203B \321\202C \322	G\320V\204R G\320V\203] \nG\320V\203] \323\202^ \324\n\325\260\202f \326+\327H\330C\211\203x \331\232\203| \332\202\201 \333\334\f#*Q\202\207 \335!\"c\207" [addr z s c more string format "\\address{%s}\n" bbdb-print-tex-quote mapconcat #[(str) "\302\303	\"\203 	\304\225\305O\302\306	\"\203 	\304\211\224O\307\304	G\305	$\210	)G\304U?\2050 \310P\207" [str string string-match "\\`[ 	\n]+" 0 nil "[ 	\n]+\\'" set-text-properties "\\\\\n"] 5] 1 "" 2 3 4 0 " " "" ", " "" "\\\\\n" "" 5 "\\\\\n" "" "" apply concat ""] 11 (#$ . 13229)])
#@294 Insert formated address ADDR in current buffer for printing.
This is the default format; it is used in the US, for example.

This function is a possible formatting function for
`bbdb-address-print-formatting-alist'.

The result looks like this:
 street
 street
 ...
 city, state  zip
 country
(defalias 'bbdb-print-format-address-default #[(addr) "\306\307\310\203\206 \311\312\313H\314#\315H\316H\317H\211G\320V\204/ 	G\320V\204/ \nG\320V\203e \211G\320V\203B \nG\320V\203B \321\202C \322\nG\320V\204R \nG\320V\203] 	G\320V\203] \323\202^ \324	\325\260\202f \326+\327H\330C\211\203x \331\232\203| \332\202\201 \333\334\f#*Q\202\207 \335!\"c\207" [addr z s c more string format "\\address{%s}\n" bbdb-print-tex-quote mapconcat #[(str) "\302\303	\"\203 	\304\225\305O\302\306	\"\203 	\304\211\224O\307\304	G\305	$\210	)G\304U?\2050 \310P\207" [str string string-match "\\`[ 	\n]+" 0 nil "[ 	\n]+\\'" set-text-properties "\\\\\n"] 5] 1 "" 2 3 4 0 ", " "" "  " "" "\\\\\n" "" 5 "\\\\\n" "" "" apply concat ""] 11 (#$ . 14286)])
#@462 Insert the bbdb RECORD in TeX format.
Second arg 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 produces a heading.
3rd argument BRIEF is for 1-line-per-record printouts.
Args 3-5 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.
(defalias 'bbdb-print-format-record #[(record current-letter brief pofl n-phones n-addresses) "\203 \306\n\307H\310H\203 \311\312!\210)\313\n!\314P\315\316O\317\304!\205. \320\n\321\"\206. \322\323\n!!\317\305!\2058 \n\310H\317\324!\205B \n\325H\317\326!\205M \n\327H\317\330!\205X \n\331H\n\332H6\333;!\203\365<\203{ <\230\204{ \334\335\322\226!\"c\210\336c\210\f\204\214 \203\214 \322!\337\340=\203\310 >\306=\203\252 \341@!=A\202\310 >;\203\310 \342\343\"\211?\203\307 \341?@!=?A)\334\344\f\322=!#c\210)\203\337 \334\345\322!\"c\210@\203\371 \346@>\203\360 \316\202\361 \315ZA#\203N@\203@@\315H\341@!BC\334\347\322C\350CD\211E\203(E\351\232\203,\352\2023\353\354ED#*!\322B!#c\210*\202E\334\355!c\210A\211\204\376 \203|F\356=\203a@C\202nF\357=\203m\202n\337G\334\360\361\362G\363#\"c\210)H\203\213\346HA#\203\240\364@\365\"\210A\211\204\2206;\203\255\3666BC66\203\3576@I\317I@!\203\345I@\366=\203\324\334\367\322IA!\"c\210\202\345\334\370\322\371I@!!\322IA!#c\210)6A\2116\204\262\372c\210<.<\207" [bbdb-debug debug-on-error record first-letter name company t 8 3 error "plus ungood: tex formatting deleted record" bbdb-record-sortkey "?" 0 1 bbdb-print-field-shown-p bbdb-record-getprop tex-name bbdb-print-tex-quote bbdb-record-name net 6 phone 4 address 5 7 eval format "\\goodbreak\n\\separator{%s}\n%%\n" "\\beginrecord\n" nil "" bbdb-print-phone-string bbdb-print-front-if #[(ph) "\302	\303H\"\207" [pofl ph string-match 0] 4] "\\firstline{%s}{%s}\n" "\\comp{%s}\n" bbdb-print-firstn "\\phone{%s%s}\n" ": " "" "" apply concat "\\phone{}\n" primary all "\\email{%s}\n" mapconcat #[(net-addr) "\302!\303\304\305	#\203# \303\211\224O\306\303\225\307OQ\303\225\310\\\202 )\207" [net-addr start bbdb-print-tex-quote 0 string-match "\\." ".\\-" nil 2] 5] ", " bbdb-format-address printing notes "\\notes{%s}\n" "\\note{%s}{%s}\n" symbol-name "\\endrecord\n%\n" bbdb-print-require current-letter rightside pofl p n-phones brief number place more string bbdb-print-net net-addrs n-addresses thisnote] 8 (#$ . 15341)])
#@145 Format PHONE-NUMBER as a string, obeying omit-area-code setting.
Omit-area-code is one of the allowed symbols in `bbdb-print-alist', which see.
(defalias 'bbdb-print-phone-string #[(phone) "\304!\305\306	\"A\n\203 \307\n\"\203 \310\225\311O\202 *\207" [phone bbdb-print-alist omit str bbdb-phone-string assoc omit-area-code string-match 0 nil] 4 (#$ . 17975)])
#@228 Move first elt of LIST satisfying FUNC to front.
The car of the returned list is the first element that returned nonnil;
The cdr is the rest of the list.
But if the FUNC returns nil for every elements of the LIST, returns nil.
(defalias 'bbdb-print-front-if #[(func list) "\204 \303\207	@!\203 \207\304	A\"\211\205! \n@@\nABB)\207" [list func rest nil bbdb-print-front-if] 4 (#$ . 18352)])
#@156 The first N elements of LIST.
If 3rd arg FORCE is nonnil, will extend the list to length N if necessary, by
adding nil's.  If N is nil, just returns LIST.
(defalias 'bbdb-print-firstn #[(n list force) "\204 	\207	\204 \n\205% \303\304\"\207\305X\203 \304\207	@\306S	A\n#B\207" [n list force make-list nil 0 bbdb-print-firstn] 5 (#$ . 18757)])
#@167 Quote any unquoted TeX special characters that appear in STRING.
In other words, # alone will be replaced by \#, but \^ will be left for
TeX to process as an accent.
(defalias 'bbdb-print-tex-quote #[(string) "\205x \212\301\302!q\210\303 \210c\210eb\210m\204u \304\305!\203$ \306\307!\210\202 \304\310!\203; `Sf\311=\204; \312c\210\313u\210\202 \304\314!\203U `Sf\311=\204U \315c\210\313u\210\316c\210\202 \304\317!\203o `Sf\311=\204o \320c\210\313u\210\321c\210\202 \313u\210\202 \322 )\207" [string get-buffer-create " bbdb-print-tex-quote" erase-buffer looking-at "[<>=]+" replace-match "$\\&$" "[#$%&_]" 92 "\\" 1 "~" "\\" "{}" "[{}]" "$\\" "$" buffer-string] 2 (#$ . 19114)])
(provide 'bbdb-print)
