;ELC ;;; Compiled by proclus@darwintel on Tue Jan 1 13:53:25 2008 ;;; from file /mnt/gmirror/ports/databases/bbdb/work/bbdb-2.34/lisp/bbdb-print.el ;;; in Emacs version 21.2.1 ;;; with bytecomp version 1.1.1.4 ;;; 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" '(#$ . -704) :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) '(#$ . -877) :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) '(#$ . -1133) :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")) '(#$ . -5771) :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")) '(#$ . -8017) :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")) '(#$ . -8376) :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) (#$ . 8771)) #@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") '(#$ . -8998) :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" '(#$ . -9319) :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 '(#$ . -9537) :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\302\207\303\304 #\207" [string more "" apply concat] 4 (#$ . 9862)]) (put 'bbdb-print-if-not-blank 'byte-optimizer 'byte-compile-inline-expand) #@504 Make a TeX file for printing out the bbdb database.\ 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 \"23\204\310 \202%4q\210\311\312\"5\313\3142\"A\2034\315\2025\3166\313\3172\"A\3207\313\3212\"A8\313\3222\"A\313\3232\"A\324 !\210~\210\325 \2109c\210\326\327:\211;\203\222\313;@2\"A\211:\203\211\330\331;@:#c\210;A\211;\204q*\313\3322\"A\211<\203\260\330\333<@\"c\210\203\371\346><\203\360\316\202\361\315Z?#\203N@\203@@\315H\341@!@A\334\347\322A\350CB\211C\203(C\340\232\203,\340\2023\351\352CB#*!\322@!#c\210*\202E\334\353!c\210A\211\204\376\203|D\354=\203a@C\202nD\355=\203m\202n\337E\334\356\357\360E\361#\"c\210)F\203\213\346F?#\203\240\362@\363\"\210A\211\204\2204;\203\255\3644BC44\203\3574@G\317G@!\203\345G@\364=\203\324\334\365\322GA!\"c\210\202\345\334\366\322\367G@!!\322GA!#c\210)4A\2114\204\262\370c\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 (#$ . 15315)]) #@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 (#$ . 17943)]) #@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 (#$ . 18320)]) #@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 @\306S A\n#B\207" [n list force make-list nil 0 bbdb-print-firstn] 5 (#$ . 18725)]) #@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 \210c\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\312c\210\313u\210\315c\210\202\304\316!\203o`Sf\311=\204o\317c\210\313u\210\320c\210\202\313u\210\202\321 )\207" [string get-buffer-create " bbdb-print-tex-quote" erase-buffer looking-at "[<>=]+" replace-match "$\\&$" "[#$%&_]" 92 "\\" 1 "~" "{}" "[{}]" "$\\" "$" buffer-string] 2 (#$ . 19082)]) (provide 'bbdb-print)