;ELC ;;; Compiled by proclus@darwintel on Tue Jan 1 13:53:26 2008 ;;; from file /mnt/gmirror/ports/databases/bbdb/work/bbdb-2.34/lisp/bbdb-sc.el ;;; in Emacs version 21.2.1 ;;; with bytecomp version 1.1.1.4 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`bbdb-sc.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\207" [require bbdb supercite] 2) #@172 t if you like to create a new BBDB entry when entering a non-default attribution, 'ask if the user should be asked before creation and NIL if we never create a new entry. (custom-declare-variable 'bbdb/sc-replace-attr-p 't '(#$ . 700) :group 'bbdb-utilities-supercite :type '(choice (const "Create a new BBDB entry" t) (const "Confirm new record creation" ask) (const "Don't create a new entry" nil))) #@60 The BBDB field used for Supercite attribution information. (custom-declare-variable 'bbdb/sc-attribution-field ''attribution '(#$ . 1108) :group 'bbdb-utilities-supercite :type '(symbol :tag "Field name")) #@117 Default attribution return by the SuperCite citation engine, used to compare against citation selected by the user. (custom-declare-variable 'bbdb/sc-last-attribution '"" '(#$ . 1321) :group 'bbdb-utilities-supercite :type '(string :tag "Default citation" "")) #@110 Extract citing information from BBDB using sc-consult where FROM is user e-mail address to look for in BBDB. (defalias 'bbdb/sc-consult-attr #[(from) "\203\306 \206\307\310\311 !\307Q\211\"\203%\312\313\314!\206!A@\202&\205M\315\211G\316=\2038\315 G\316=\203A\315\317\320!\210\f\205\224\321\f\227r\322 q\210\317\315\320\"\210 )\"J\315\203\221@\f\227\323!\206z\324H\206z\325\227\230\203\210\326C\"A)\202_* ;\203\255\321 \227r\322 q\210\317\315\320\"\210 )\"J\202\327\315 \203\324\204\324\321 @\227r\322 q\210\317\315\320\"\210 )\"J A\211\204\264)\315\211\203\347\204\375\203\362@\206?\205?@\202?\203=@\203/@=\203&\315\315\202 A\211\204\2039A*\202\375-\211 \205L\327 !\"))\207" [from bbdb-user-mail-names check net name bbdb-hashtable string-match "\\b" regexp-quote user-login-name mail-extract-address-components sc-mail-field "to" nil 0 bbdb-records t intern-soft bbdb-buffer bbdb-record-name 3 "" append bbdb-record-getprop answer recs n-rec ret net-recs name-recs nets name-rec record bbdb/sc-attribution-field] 8 (#$ . 1589)]) #@24 Add attribute to BBDB. (defalias 'bbdb/sc-set-attr #[nil "\306\307!\306\310!\306\311!\211\205u\205u \205u\f\230?\205u\312 \206-\313\314\315 !\313Q\211 \"?\205u\316\317\n\320\321!\320$\211\205t\322\323\"\211\205T\230?\205s \324=\203f\325\326P!\205s\327#\210\330\316\")*+\207" [attr address from bbdb/sc-replace-attr-p bbdb/sc-last-attribution bbdb-user-mail-names sc-mail-field "from" "sc-from-address" "sc-attribution" string-match "\\b" regexp-quote user-login-name nil bbdb-annotate-message-sender t bbdb-invoke-hook-for-value bbdb-record-getprop attribution ask y-or-n-p "Change attribution " bbdb-record-putprop bbdb-change-record bbdb-notice-hook bbdb/mail-auto-create-p record old bbdb/sc-attribution-field] 6 (#$ . 2765)]) #@167 If the current "from" field in `sc-mail-info' alist contains only an e-mail address, lookup e-mail address in BBDB, and prepend a new "from" field to `sc-mail-info'. (defalias 'bbdb/sc-default #[nil "\306\307!\211\205 \310!\211\205E @?\205E\311 A@\211G\312=\203%\311\nG\312=\203.\311\313\314!\210 \205~\315 \227r\316 q\210\313\311\314\"\210\f)\"J\311\203|@ \227\317!\206f\320H\206f\321\227\230\203s\322C\"A)\202K *\n;\203\227\315\n\227r\316 q\210\313\311\314\"\210\f)\"J\202\275\311\n\203\273 \204\273\315\n@\227r\316 q\210\313\311\314\"\210\f)\"J\nA\211\204\235 )\311\211\203\315\204\343\203\330@\206%\205%@\202%\203#@\203@=\203\f\311\311\202\361A\211\204\366\203A*\202\343-\211\2050\317!\211\205D\307\323\324 A@ #BB\211**\207" [from pair net name bbdb-hashtable answer sc-mail-field "from" mail-extract-address-components nil 0 bbdb-records t intern-soft bbdb-buffer bbdb-record-name 3 "" append format "%s (%s)" recs n-rec ret net-recs name-recs nets name-rec record sc-mail-info] 8 (#$ . 3540)]) #@463 Set up the various Supercite variables for the BBDB. `sc-preferred-attribution-list', `sc-attrib-selection-list', and `sc-mail-glom-frame' are set, but only if they have not previously been defined. It is strongly suggested that you not call this function directly, but that you use this function (specifically the settings contained herein) as an example. In other words, set these variables yourself, either in your Emacs configuration file or using Custom. (defalias 'bbdb/sc-setup-variables #[nil "\303\300!\203\304\235\204\305\306!\210\202\303\300!\204\307\303\301!\204#\310\303\302!\204+\311\302\207" [sc-preferred-attribution-list sc-attrib-selection-list sc-mail-glom-frame boundp "sc-consult" bbdb-warn "\"sc-consult\" not included in sc-preferred-attribution-list. Attributions cannotbe gathered from the BBDB without \"sc-consult\"in sc-preferred-attribution-list" ("sc-lastchoice" "x-attribution" "sc-consult" "initials" "firstname" "lastname") (("sc-from-address" ((".*" bbdb/sc-consult-attr (sc-mail-field "sc-from-address"))))) ((begin (setq sc-mail-headers-start (point))) ("^x-attribution:[ ]+.*$" (sc-mail-fetch-field t) nil t) ("^\\S +:.*$" (sc-mail-fetch-field) nil t) ("^$" (progn (bbdb/sc-default) (list 'abort '(step . 0)))) ("^[ ]+" (sc-mail-append-field)) (sc-mail-warn-if-non-rfc822-p (sc-mail-error-in-mail-field)) (end (setq sc-mail-headers-end (point))))] 2 (#$ . 4673)]) (byte-code "\301B\302\301!\204\f\303\303\207" [current-load-list attribution boundp nil] 2) #@49 Call this function to hook BBDB into Supercite. (defalias 'bbdb-insinuate-sc #[nil "\300\301\302\"\210\300\303\304\"\207" [add-hook sc-post-hook bbdb/sc-set-attr sc-attribs-postselect-hook #[nil "\203 \227\202\n \211\207" [sc-downcase-p attribution bbdb/sc-last-attribution] 2]] 3 (#$ . 6195)]) (provide 'bbdb-sc)