From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/2548 Path: news.gmane.org!not-for-mail From: Michael R. Wolf Newsgroups: gmane.emacs.gnus.user Subject: Re: would like inverse of bbdb/mail-auto-create-p Date: Mon, 26 May 2003 14:03:56 -0700 Organization: LCL Software & Training, Inc. Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138668942 15533 80.91.229.2 (31 Jan 2006 00:55:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:55:42 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:30:52 2006 Original-Path: quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: sense-sea-megasub-1-477.oz.net Original-X-Trace: quimby.gnus.org 1053983742 30865 216.39.145.223 (26 May 2003 21:15:42 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 26 May 2003 21:15:42 GMT User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (windows-nt) Cancel-Lock: sha1:2r39IGYn+c6eZ4Ka0mx7KIzRan0= Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:2688 Original-Lines: 41 X-Gnus-Article-Number: 2688 Tue Jan 17 17:30:52 2006 Xref: news.gmane.org gmane.emacs.gnus.user:2548 Archived-At: Michael R. Wolf writes: [...] > Here's the working code.... [...] With just one more tweak. ;;; It works. ;;; TODO -- remove the mapconcat addition of commas, that get removed by m-t-h (defun wolf3-bbdb-add-recipients-to-bbdb () "Add all recipients to BBDB, using this list of headers: from, sender, to, cc, bcc, resent-from, resent-to, resent-cc, resent-bcc." (let ((fields '("from" "sender" "to" "cc" "bcc" "resent-from" "resent-to" "resent-cc" "resent-bcc"))) (mapc (lambda (address) (bbdb-annotate-message-sender address t t t)) (save-restriction (message-narrow-to-headers) (message-tokenize-header (mapconcat 'message-fetch-field fields ",")))))) ;;; Could go into many hooks: ;;; message-send-mail-hook ;;; message-send-news-hook ;;; message-send-hook ;;; message-sent-hook (add-hook 'message-send-hook 'wolf3-bbdb-add-recipients-to-bbdb) -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net