;ELC ;;; compiled by ocschwar@mint-square.mit.edu on Fri Jun 16 17:21:25 2000 ;;; from file /var/tmp/bbdb-2.00.06/lisp/bbdb-print.el ;;; emacs version 21.1 (patch 4) "Arches" XEmacs Lucid. ;;; bytecomp version 2.25 XEmacs; 22-Mar-96. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 19. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "20"))) (error "`bbdb-print.el' was compiled for Emacs 20")) (or (boundp 'current-load-list) (setq current-load-list nil)) (byte-code "!!" [require bbdb bbdb-com] 2) (custom-declare-variable 'bbdb-print-file-name '"~/bbdb.tex" "*Default file name for printouts of BBDB database." :group 'bbdb-utilities-print :type 'file) (custom-declare-variable 'bbdb-print-elide ''(tex-name aka mail-alias) "*List of fields NOT to print in address list.\nSee also bbdb-print-require." :group 'bbdb-utilities-print :type '(repeat (symbol :tag "Field to exclude"))) (custom-declare-variable 'bbdb-print-require ''(or address phone) "*What fields are required for printing a record.\nThis is evaluated for each record, and the record will be printed only\nif it returns non-nil. The symbols name, company, net, phone,\naddress, and notes will be set to appropriate values when this is\nevaluated; they will be nil if the field does not exist or is elided.\n\nThe value of this variable can be any lisp expression, but typically\nit will be used for a boolean combination of the field variables, as\nin the following simple examples:\n\n Print only people whose phone numbers are known:\n (setq bbdb-print-require 'phone)\n Print people whose names AND companies are known:\n (setq bbdb-print-require '(and name company))\n Print people whose names, and either addresses OR phone numbers are known:\n (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)))) (byte-code "!QBBBBBBBBBBC%" [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 "^(" bbdb-default-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) (custom-declare-variable 'bbdb-print-alist '(backquote ((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"))) "*Formatting options for bbdb-print, all formats.\nThis is an alist of the form ((option1 . value1) (option2 . value2) ...)\n\nYou can have separate settings for brief and non-brief printouts;\nsee the variables `bbdb-print-brief-alist' and `bbdb-print-full-alist'.\nSettings there will override the common settings in this variable.\n\nThe possible options and legal values are:\n - columns: 1, 2, 3, 4 or 'quad (4 little 2-column pages per sheet)\n or 'grid (12 credit-card-sized pages per sheet).\n - separator: 0-7, the style of heading for each letter.\n 0=none, 1=line, 2=boxed letters, 3=large boxed letters, 4=large letters,\n 5=letters with lines, 6=letters with suits, 7=boxed letters with suits.\n - omit-area-code: a regular expression matching area codes to omit.\n - phone-on-first-line: t means to put first phone number on the same\n line with the name, nil means just the name. A string means to\n use the first phone number whose \"location\" matches that string,\n which should be a valid regular expression.\n - n-phones: maximum number of phone numbers to include.\n - n-addresses: maximum number of addresses to include.\n - include-files: list of TeX files to \\input. If these filenames are not\n absolute, the files must be located somewhere that TeX will find them.\n - ps-fonts: nonnil means to use them, nil to use standard TeX fonts.\n - font-size: in points, any integer (assuming fonts in that size exist!).\n - hsize, vsize: horizontal dimension of pages. String value can be any valid\n TeX dimension, or nil to use TeX's default.\n - hoffset, voffset: shift TeX's output rightward (downward) by this distance\n (any TeX dimension). Nil or 0 uses TeX's default positioning. \n - quad-hsize, quad-vsize: for the quad format, horizontal and\n vertical size of the little pages. These must be strings which\n are valid TeX dimensions, eg \"10cm\"." :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget) (custom-declare-variable 'bbdb-print-full-alist ''((columns . 3) (separator . 2) (include-files "bbdb-print" "bbdb-cols")) "*Extra options for bbdb-print non-brief format.\nThese supplement or override entries in `bbdb-print-alist'; see description\nof possible contents there." :group 'bbdb-utilities-print :type 'bbdb-print-alist-widget) (custom-declare-variable '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.\nThese supplement or override entries in `bbdb-print-alist'; see description\nof possible contents there." :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) (#$ . 8471)) (custom-declare-variable '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")) (custom-declare-variable '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")) #@157 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) "k #" [string "" apply concat more] 4 (#$ . 9197)]) (byte-code "Ns\"#" [bbdb-print-if-not-blank byte-optimizer (nil byte-compile-inline-expand) error "%s already has a byte-optimizer, can't make it inline" put byte-compile-inline-expand] 4) #@505 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) " ! \"  q\n\"\"AѪ\"A\"A\"A\"A\n!~ c !!@\"A !@ #c!A!a*\"A%%@\"c%A%p)\"A#\"A\"a\"A\"A#aUUUU@ &Ag;ceb." [expand-file-name to-file bbdb-print-file-name append brief bbdb-print-brief-alist bbdb-print-full-alist bbdb-print-alist alist visible-records bbdb-records bbdb-buffer-name mapcar car records assoc ps-fonts "ps" "" psstring columns t current-letter phone-on-first-line pofl n-phones n-addresses find-file erase-buffer bbdb-print-prolog (hsize vsize hoffset voffset) nil val dimens format "\\%s=%s\n" include-files infiles "\\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" "\n\n\\beginaddresses\n" bbdb-print-format-record bbdb-print-epilog] 9 (#$ . 9685) (list (bbdb-do-all-records-p) (read-file-name "Print To File: " bbdb-print-file-name) current-prefix-arg)]) #@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) " HH!) !PO ?a a s?) \" !! ?a a s?) H ?a a s?) H ?a a s?) H ?a a s?) H H` !D!!!\"cc!'()a@!(A);\"''@!('A)(!#c*!\"c//)ͪZ1#@@H@!233C677k檇76#*!2!#c*!cA6@!;<<;#<̉O<̕OQ<̕@\\;]A<\"c*BB1#@CDCCHEC677k檇76#*C@HEC677k檇76#*CHEC677k檇76#*CHCHk?CHk?FCHGC677k檇76#*HC!I!\"c)A;BC@J@ ?a a s?)J@aKJA!\"cLӁMJ@!!JA!#c)A*Nc!. !" [bbdb-debug t debug-on-error record 8 3 error "plus ungood: tex formatting deleted record" bbdb-print-elide bbdb-elided-display bbdb-record-sortkey "?" 0 1 first-letter name field bbdb-record-getprop tex-name bbdb-print-tex-quote bbdb-record-name company net 6 phone 4 address 5 7 notes begin eval bbdb-print-require current-letter format "\\separator{%s}\n%%\n" "\\beginrecord\n" nil "" p rightside pofl bbdb-print-phone-string bbdb-print-front-if #[(ph) " \nH\"" [string-match pofl ph 0] 4] "\\firstline{%s}{%s}\n" "\\comp{%s}\n" n-phones bbdb-print-firstn brief number place "\\phone{%s%s}\n" ": " more string apply concat "\\phone{}\n" start net-addr string-match "\\." ".\\-" 2 "\\email{%s}\n" n-addresses addr "\\address{%s}\n" "\\\\\n" ", " " " bbdb-address-zip-string "\\\\" thisnote "\\notes{%s}\n" "\\note{%s}{%s}\n" symbol-name "\\endrecord\n%\n"] 13 (#$ . 11381)]) #@143 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) " ! \"A \"ȕO*" [bbdb-phone-string phone assoc omit-area-code bbdb-print-alist omit str string-match 0 nil] 4 (#$ . 13675)]) #@230 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) "\n@!\nA\" @@ ABB)" [list nil func bbdb-print-front-if rest] 4 (#$ . 14016)]) #@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) " \n\"Xć @S A\n#B" [n list force make-list nil 0 bbdb-print-firstn] 5 (#$ . 14393)]) #@168 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) "!q cebm!!r!`Sfacu^!`SfacucG!`Sfacuc0u+ )" [string get-buffer-create " bbdb-print-tex-quote" erase-buffer looking-at "[<>=]+" replace-match "$\\&$" "[#$%&_]" ?\\ "\\" 1 "~" "{}" "[{}]" "$\\" "$" buffer-string] 2 (#$ . 14707)]) (provide 'bbdb-print)