From: Dave Goldberg <david.goldberg6@verizon.net>
Subject: Re: add a gcc field according to bbdb entry
Date: Thu, 25 May 2006 22:57:43 -0400 [thread overview]
Message-ID: <x7slmx5w7s.fsf@davestoy.homelinux.org> (raw)
In-Reply-To: <87ac96s73q.fsf@mat.ucm.es> (Uwe Brauer's message of "Thu, 25 May 2006 12:59:21 +0200")
>>>>> On Thu, 25 May 2006 12:59:21 +0200, Uwe Brauer <oub@mat.ucm.es> said:
> Hello
> Does anybody know about a function which would insert a gcc field,
> according to a relevant BBDB entry?
> Example the entry
> gnus-folder: nnimap+myserverimap.here.net:Gnus
> would insert
> Ccc: nnimap+myserverimap.here.net:Gnus
I don't understand exactly how you plan for this to work. Do you want
a function that looks up whatever's on, say, the To line and pulls the
gnus-folder record for that bbdb record? Or do you want a posting
style (but what you search for in that case?) Anyway, the functions
you want are bbdb-search (use the result of bbdb-records as the first
argument) and then bbdb-record-getprop against the record that matches
your query. An example off the top of my head, and which is
completely untried would be something like this:
(defun get-folder-for-address (TO)
"Get gnus-folder record for the bbdb entry with TO in the net
address"
(let ((rec (car (bbdb-search (bbdb-records) nil nil TO nil nil))))
(bbdb-record-getprop rec 'gnus-folder)))
And then you'd do something like
(message-insert-header "Gcc"
(get-folder-for-address (message-fetch-field "To")))
Again, off the top of my head. Odds are there's some tweaking needed.
hth,
--
Dave Goldberg
david.goldberg6@verizon.net
next prev parent reply other threads:[~2006-05-26 2:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-25 10:59 Uwe Brauer
2006-05-25 12:44 ` Sam Steingold
2006-05-25 14:07 ` Uwe Brauer
2006-05-26 2:57 ` Dave Goldberg [this message]
2006-05-26 15:28 ` Uwe Brauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x7slmx5w7s.fsf@davestoy.homelinux.org \
--to=david.goldberg6@verizon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).