From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/63259 Path: news.gmane.org!not-for-mail From: Dave Goldberg Newsgroups: gmane.emacs.gnus.general Subject: Re: add a gcc field according to bbdb entry Date: Thu, 25 May 2006 22:57:43 -0400 Message-ID: References: <87ac96s73q.fsf@mat.ucm.es> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1148612575 21066 80.91.229.2 (26 May 2006 03:02:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 26 May 2006 03:02:55 +0000 (UTC) Original-X-From: ding-owner+m11786@lists.math.uh.edu Fri May 26 05:02:53 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FjSbD-0005R5-A9 for ding-account@gmane.org; Fri, 26 May 2006 05:02:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FjSb7-00081N-00; Thu, 25 May 2006 22:02:46 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FjSWO-00081F-00 for ding@lists.math.uh.edu; Thu, 25 May 2006 21:57:52 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FjSWN-0004fE-5D for ding@lists.math.uh.edu; Thu, 25 May 2006 21:57:52 -0500 Original-Received: from vms042pub.verizon.net ([206.46.252.42]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FjSWM-00049P-00 for ; Fri, 26 May 2006 04:57:50 +0200 Original-Received: from davestoy.homelinux.org.verizon.net ([68.163.190.235]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IZU00JA4QW8BB33@vms042.mailsrvcs.net> for ding@gnus.org; Thu, 25 May 2006 21:57:49 -0500 (CDT) X-Face: GUaHTH@nS>[7,ME@-gYZ4#Wl{z"99k@[[Y8AcP0x1paqu.,z9,XSV1WI>{q3f6^e5(zrit <4fV&VHhmE`uidRqtmG27;si9&r;#KSF~E#$%W8w(xdp)H4tW=\2XOk~3=@oGqqpj;m4xf Ow;y26396&,34@9#~4;@*S;E0cq"LM9N(us4P%F(Nxis'Vvfm9?KufH;:Q$dMa-QWGLR&K d0`LJZE8xb*>^yN>b]_NcU:E=Zn\1=#/(OS2 In-reply-to: <87ac96s73q.fsf@mat.ucm.es> (Uwe Brauer's message of "Thu, 25 May 2006 12:59:21 +0200") Original-To: ding@gnus.org User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux) X-Spam-Score: -0.7 (/) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:63259 Archived-At: >>>>> On Thu, 25 May 2006 12:59:21 +0200, Uwe Brauer 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