;ELC ;;; Compiled by proclus@darwintel on Tue Jan 1 13:53:22 2008 ;;; from file /mnt/gmirror/ports/databases/bbdb/work/bbdb-2.34/lisp/bbdb-hooks.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-hooks.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\301\302!\210\301\303!\210\304B\305B\301\207" [current-load-list require bbdb bbdb-com rmail-buffer mh-show-buffer] 2) #@27 The internal date format. (defvar bbdb-time-internal-format "%Y-%m-%d" (#$ . 772)) #@228 For use as a `bbdb-change-hook'; maintains a notes-field called `timestamp' for the given record which contains the time when it was last modified. If there is such a field there already, it is changed, otherwise it is added. (defalias 'bbdb-timestamp-hook #[(record) "\302\303\304 \305 \"#\207" [record bbdb-time-internal-format bbdb-record-putprop timestamp format-time-string current-time] 6 (#$ . 862)]) #@110 For use as a `bbdb-create-hook'; adds a notes-field called `creation-date' which is the current time string. (defalias 'bbdb-creation-date-hook #[(record) "\302\303\304 \305 \"#\207" [record bbdb-time-internal-format bbdb-record-putprop creation-date format-time-string current-time] 6 (#$ . 1279)]) #@132 Returns a marker at the beginning of the header block of the current message. This will not necessarily be in the current buffer. (defalias 'bbdb-header-start #[nil "\306>\203 \203 q\210\307\n@!\207\310>\203(\311\303!\203% \203% q\210\312 \207\313>\2034\fq\210\312 \207\314=\203C\315 \210 q\210\312 \207\312 \207" [major-mode vm-mail-buffer vm-message-pointer rmail-buffer gnus-article-buffer mh-show-buffer (vm-presentation-mode vm-mode vm-summary-mode) vm-start-of (rmail-mode rmail-summary-mode) boundp point-min-marker (gnus-Group-mode gnus-Subject-mode gnus-Article-mode) mh-folder-mode mh-show] 2 (#$ . 1587)]) #@397 Given the name of a field (like "Subject") this returns the value of that field in the current message, or nil. This works whether you're in GNUS, Rmail, or VM. This works on multi-line fields, but if more than one field of the same name is present, only the last is returned. It is expected that the current buffer has a message in it, and (point) is at the beginning of the message headers. (defalias 'bbdb-extract-field-value #[(field-name) "\303!\304P\305\306 \204C\307\310!\204Cm\204C\307!\203=\311\225b\210`\306\210`{\307\312!\203= \313\311\225\314\210`{Q\202)\315y\210\202\n *\207" [field-name done case-fold-search regexp-quote "[ ]*:[ ]*" t nil looking-at "\n" 0 "\n[ ]" " " 2 1] 4 (#$ . 2225)]) #@556 *An alist describing which messages to automatically create BBDB records for. This only works if bbdb/news-auto-create-p or bbdb/mail-auto-create-p (or both) is 'bbdb-ignore-most-messages-hook. The format of this alist is (( HEADER-NAME . REGEXP ) ... ) for example, (("From" . "@.*\.maximegalon\.edu") ("Subject" . "time travel")) will cause BBDB entries to be made only for messages sent by people at Maximegalon U., or (that's *or*) people posting about time travel. See also bbdb-ignore-some-messages-alist, which has the opposite effect. (custom-declare-variable 'bbdb-ignore-most-messages-alist ''nil '(#$ . -2959) :group 'bbdb-noticing-records :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regex to match on header value")))) #@614 *An alist describing which messages *not* to automatically create BBDB records for. This only works if bbdb/news-auto-create-p or bbdb/mail-auto-create-p (or both) is 'bbdb-ignore-some-messages-hook. The format of this alist is (( HEADER-NAME . REGEXP ) ... ) for example, (("From" . "mailer-daemon") ("To" . "mailing-list-1\\|mailing-list-2") ("CC" . "mailing-list-1\\|mailing-list-2")) will cause BBDB entries to not be made for messages from any mailer daemon, or messages sent to or CCed to either of two mailing lists. See also bbdb-ignore-most-messages-alist, which has the opposite effect. (custom-declare-variable 'bbdb-ignore-some-messages-alist ''nil '(#$ . -3728) :group 'bbdb-noticing-records :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regex to match on header value")))) #@211 For use as the value of bbdb/news-auto-create-p or bbdb/mail-auto-create-p. This will automatically create BBDB entries for messages which match the bbdb-ignore-most-messages-alist (which see) and *no* others. (defalias 'bbdb-ignore-most-messages-hook #[(&optional invert-sense) "\203 \202 \n\306\307p\310 \307\211\211\f \311\f!q\210\214~\210\203Z\204Z\fb\210@@@A\312 !\211\203Q\313\f \"\203Q\306A\211\204,) q\210\203i?\202k.\207" [invert-sense bbdb-ignore-some-messages-alist bbdb-ignore-most-messages-alist fieldval regexp field t nil bbdb-header-start marker-buffer bbdb-extract-field-value string-match marker b done case-fold-search rest] 9 (#$ . 4555)]) #@151 *If bbdb-ignore-selected-messages-hook is used as an auto-create-hook, this variable governs whether you are prompted for creation of BBDB entries. (defvar bbdb-ignore-selected-messages-confirmation nil (#$ . -5270)) #@501 For use as a bbdb/news-auto-create-hook or bbdb/mail-auto-create-hook. This will automatically create BBDB entries for messages based on a combination of bbdb-ignore-some-messages-alist and bbdb-ignore-most-messages-alist. It first looks at the SOME list. If that doesn't disqualify a message, then it looks at the MOST list. If that qualifies the message, the record is auto-created, but a confirmation is conditionally sought, based on the value of `bbdb-ignore-selected-messages-confirmation'. (defalias 'bbdb-ignore-selected-messages-hook #[nil "\305 \2059\306 \2059\2038\307\310 \311\211\212\312 !q\210\214~\210 b\210\313\314!*\315 !\211\2066\316\317 \320Q!,\207\307\207" [bbdb-ignore-selected-messages-confirmation from record-exists marker case-fold-search bbdb-ignore-some-messages-hook bbdb-ignore-most-messages-hook t bbdb-header-start nil marker-buffer bbdb-extract-field-value "FROM" bbdb-annotate-message-sender y-or-n-p "Create BBDB record from " "? "] 5 (#$ . 5496)]) #@205 For use as a `bbdb/news-auto-create-hook' or `bbdb/mail-auto-create-hook'. This will automatically create BBDB entries for messages which do *not* match the `bbdb-ignore-some-messages-alist' (which see). (defalias 'bbdb-ignore-some-messages-hook #[nil "\300\301!\207" [bbdb-ignore-most-messages-hook t] 2 (#$ . 6500)]) #@2871 *An alist which lets you have certain pieces of text automatically added to the BBDB record representing the sender of the current message based on the subject or other header fields. This only works if `bbdb-notice-hook' contains `bbdb-auto-notes-hook'. The format of this alist is ((HEADER-NAME [ADDRESS-CLASS-LIST] (REGEXP . STRING) ... ) ... ) 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 record corresponding to anyone you get mail from via one of the VM mailing lists. If, that is, `bbdb/mail-auto-create-p' is set such that the record would have been created, or the record already existed. A ADDRESS-CLASS-LIST is optional and by default actions will be performed only for records of authors of a message. However, by giving an list of classes specified in `bbdb-get-addresses-headers'. Actions will then only be performed if the currently processed email is of a class listed in ADDRESS-CLASS-LIST. ADDRESS-CLASS-LIST might also be an alist with elements of the form (CLASS . HEADER) which allows actions only when the current address matches one of the elemets. The format of elements of this list may also be (REGEXP FIELD-NAME STRING) or (REGEXP FIELD-NAME STRING REPLACE-P) instead of (REGEXP . STRING) meaning add the given string to the named field. The field-name may not be name, address, phone, or net (builtin fields) but must be either ``notes,'' ``company,'' or the name of a user-defined note-field. ("pattern" . "string to add") is equivalent to ("pattern" notes "string to add") STRING can contain \& or \N escapes like in function `replace-match'. For example, to automatically add the contents of the "organization" field of a message to the "company" field of a BBDB record, you can use this: ("Organization" (".*" company "\\&")) (Note you need two \ to get a single \ into a lisp string literal.) If STRING is an integer N, the N'th matching subexpression is used, so the above example could be written more efficiently as ("Organization" (".*" company 0)) If STRING is neither a string or an integer, it should be a function, which will be called with the contents of the field. The result of that function call is used as the field value (the returned value must be a string.) If REPLACE-P is t, the string replaces the old contents instead of being appended to it. If multiple clauses match the message, all of the corresponding strings will be added. This works for news as well. You might want to arrange for this to have a different value when in mail as when in news. See also variables `bbdb-auto-notes-ignore' and `bbdb-auto-notes-ignore-all'. (custom-declare-variable 'bbdb-auto-notes-alist 'nil '(#$ . -6827) :group 'bbdb-noticing-records :type '(repeat (bbdb-alist-with-header (string :tag "Header name") (repeat (choice (cons :tag "Address Class" (repeat (choice (const authors) (const recipients)))) (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 "Notes") (const company :tag "Company") (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)))))))) #@429 Alist of headers and regexps to ignore in `bbdb-auto-notes-hook'. Each element looks like (HEADER . REGEXP) For example, ("Organization" . "^Gatewayed from\\|^Source only") would exclude the phony `Organization:' headers in GNU mailing-lists gatewayed to gnu.* newsgroups. Note that this exclusion applies only to a single field, not to the entire message. For that, use the variable `bbdb-auto-notes-ignore-all'. (custom-declare-variable 'bbdb-auto-notes-ignore 'nil '(#$ . 10504) :group 'bbdb-noticing-records :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regexp to match on header value")))) #@402 Alist of headers and regexps which cause the entire message to be ignored in `bbdb-auto-notes-hook'. Each element looks like (HEADER . REGEXP) For example, ("From" . "BLAT\\.COM") would exclude any notes recording for message coming from BLAT.COM. Note that this is different from `bbdb-auto-notes-ignore', which applies only to a particular header field, rather than the entire message. (custom-declare-variable 'bbdb-auto-notes-ignore-all 'nil '(#$ . 11137) :group 'bbdb-noticing-records :type '(repeat (cons (string :tag "Header name") (regexp :tag "Regexp to match on header value")))) #@287 For use as a `bbdb-notice-hook'. This might automatically add some text to the notes field of the BBDB record corresponding to the current record based on the header of the current message. See the documentation for the variables `bbdb-auto-notes-alist' and `bbdb-auto-notes-ignore'. (defalias 'bbdb-auto-notes-hook #[(record) "?\2052 \n\306p\307 \310\211\211\211\211\211\211\211\211 !\"#$%&'()\311%!q\210\214~\210%b\210\312\313!\211!\203Y\314*\206S\315\316\317 !\315Q\211*!\"\204,(\203\225$\204\225%b\210(@@#(@A \312#!\211!\203\214\314 !\"\203\214\306$\202Y(A\211(\204^$\204,)\203,%b\210)@@#)@A\"\312#!\211!\203#\"\211+@@)9\204\321\"\211+@@)<\203,\"@>\204\362\320,\"@\"\203\372-\320,\"@\"A\230\203\372\"A\"\202\310\"\202,\321=\203\314\313-\"\204\310\"\"\203#\"@@ \"@A\211:\203:@\3228A@\202>\304\310\323. \"\314 !\"\205f\320#/\"A\2110\203d\3140!\"?\202e\306)\2111\203\257\250\203~!\224\225O\202\255;\203\215\324!\"\202\255%b\210!!\2112;\204\2522\203\252\325\3262#\2102)1\203\203\f\203\307\314\316!\f\"\204 \203\3663\204\346 \304=\203\337\327\330\"\210\202\346\327\331 #\210\332. #\210\333.!\210\2023\204 \304=\203\n\327\334\"\210\202\327\335 #\210\336. #\210)\"A\211\"\204)A\211)\204\237)&q.\207" [bbdb-readonly-p bbdb-auto-notes-alist bbdb-auto-notes-ignore-all replace-p notes notes-field-name t bbdb-header-start nil marker-buffer bbdb-extract-field-value "From" string-match "\\b" regexp-quote user-login-name assoc authors 2 bbdb-record-getprop bbdb-auto-expand-newtext error "%s returned %s: not a string" message "Replacing with note \"%s\"" "Replacing field \"%s\" with \"%s\"" bbdb-record-putprop bbdb-maybe-update-display "Adding note \"%s\"" "Adding \"%s\" to field \"%s\"" bbdb-annotate-notes string regexp fieldval pairs field ignore marker b case-fold-search ignore-all rest bbdb-user-mail-names x bbdb-update-address-class bbdb-update-address-header record bbdb-auto-notes-ignore re did-match s bbdb-silent-running] 15 (#$ . 11747)]) (defalias 'bbdb-auto-expand-newtext #[(string newtext) "\306G\307\211\nW\203g  H\211\310U\203Z T\211H\211\311U\203. \306\224\306\225O\202]\f\312Y\203T\f\313X\203T\f\314Z\211\224\203O \224\225O\202P\307)\202]\315\f!\202]\315\f!)P T\211\202 +\207" [newtext expanded-newtext len pos c string 0 "" 92 38 49 57 48 char-to-string n] 5]) #@245 Certain sites have a single mail-host; for example, all mail originating at hosts whose names end in ".cs.cmu.edu" can (and probably should) be addressed to "user@cs.cmu.edu" instead. This variable lists other hosts which behave the same way. (custom-declare-variable 'bbdb-canonical-hosts '(mapconcat 'regexp-quote '("cs.cmu.edu" "ri.cmu.edu" "edrc.cmu.edu" "andrew.cmu.edu" "mcom.com" "netscape.com" "cenatls.cena.dgac.fr" "cenaath.cena.dgac.fr" "irit.fr" "enseeiht.fr" "inria.fr" "cs.uiuc.edu" "xemacs.org") "\\|") '(#$ . 14268) :group 'bbdb :type '(regexp :tag "Regexp matching sites")) (defalias 'bbdb-match-substring '(macro . #[(string match) "\302\303 D\304 DF\207" [string match substring match-beginning match-end] 5])) (defalias 'sample-bbdb-canonicalize-net-hook #[(addr) "\302\303\304Q \"\203 \305\224\305\225O \306\224\306\225OP\207\302\307 \"\203. \305\224\305\225O\310 \306\224\306\225OQ\207\302\311 \"\203D \305\224\305\225O\310 \306\224\306\225OQ\207\302\312 \"\203R \306\224\306\225O\207\302\313 \"\203h \306\224\306\225O\310 \305\224\305\225OQ\207\302\314 \"\203~ \305\224\305\225O\310 \306\224\306\225OQ\207\302\315 \"\203\214 \305\224\305\225O\207\302\316 \"\203\234 \317\211\224TO\320P\207 \207" [bbdb-canonical-hosts addr string-match "\\`\\([^@%!]+@\\).*\\.\\(" "\\)\\'" 1 2 "\\`\\([^@%!]+\\)%[^@%!.]+@\\(lucid\\.com\\)\\'" "@" "\\`\\([^@%]+\\)%\\([^@%!]+\\)\\(@lucid\\.com\\)?\\'" "\\`\\([^@%!]+\\)!\\([^@%!]+[@%]\\1\\)\\'" "\\`\\([^@%!.]+\\.[^@%!]+\\)!\\([^@%]+\\)\\'" "\\`\\([^@!]+\\)%\\([^@%!]+\\)@hplb\\.hpl\\.hp\\.com\\'" "\\`\\([^@%!]+\\)[@%][^@%!.]+\\'" ".%uunet\\.uu\\.net@[^@%!]+\\'" 0 "@UUNET.UU.NET"] 5]) #@109 Deletes redundant network addresses. For use as a value of `bbdb-change-hook'. See `bbdb-net-redundant-p'. (defalias 'bbdb-delete-redundant-nets #[(record) "\306H\211\307\307\307\n\203,\n@\310 \"\203! B\202% \fB\nA\211\204 \205C\311\312\313\314 \237\315#\"\210\f\237\306\fI\210\316-\207" [record nets rest net new redundant 6 nil bbdb-net-redundant-p message "Deleting redundant nets %s..." mapconcat identity ", " t] 7 (#$ . 15929)]) #@193 Force automatic creation of a BBDB records for the current message. You might add this to the reply hook of your MUA in order to automatically get records added for those people you reply to. (defalias 'bbdb-force-record-create #[nil "\306\211\307\310\211\211\211\212\311\235\203\312 \202=\313\235\203(\314 \202=\315\235\2034\316 \202=\317\235\205=\314 .\207" [bbdb/vm-update-records-mode bbdb/mhe-update-records-mode bbdb/rmail-update-records-mode bbdb/gnus-update-records-mode bbdb-message-caching-enabled bbdb/news-auto-create-p t nil annotating (vm-mode vm-virtual-mode vm-summary-mode vm-presentation-mode) bbdb/vm-pop-up-bbdb-buffer (gnus-summary-mode gnus-article-mode gnus-tree-mode) bbdb/gnus-pop-up-bbdb-buffer (rmail-mode rmail-summary-mode) bbdb/rmail-pop-up-bbdb-buffer (mhe-mode mhe-summary-mode) bbdb/mail-auto-create-p major-mode] 7 (#$ . 16392) nil]) (provide 'bbdb-hooks)