1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id CF413431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 8 Apr 2013 23:32:09 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id KigqdARTbsVT for <notmuch@notmuchmail.org>;
\r
16 Mon, 8 Apr 2013 23:32:05 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 6036B431FAE
\r
19 for <notmuch@notmuchmail.org>; Mon, 8 Apr 2013 23:32:05 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id F1F60100093;
\r
22 Tue, 9 Apr 2013 09:32:02 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jed Brown <jed@59A2.org>, David Bremner <david@tethera.net>,
\r
25 Jani Nikula <jani@nikula.org>, Karl Fogel <kfogel@red-bean.com>,
\r
26 Daniel Bergey <bergey@alum.mit.edu>
\r
27 Subject: Re: [PATCH] emacs: add missing paren to fix defun in
\r
29 In-Reply-To: <87ip3wbj7g.fsf@mcs.anl.gov>
\r
30 References: <87wqsfik5l.fsf@floss.red-bean.com>
\r
31 <87mwtah2hd.fsf@zancas.localnet>
\r
32 <877gkeau42.fsf@floss.red-bean.com>
\r
33 <m2ppy5v3mc.fsf@guru.guru-group.fi> <8738v1jtzc.fsf@nikula.org>
\r
34 <87k3odgutd.fsf@zancas.localnet> <87ip3wbj7g.fsf@mcs.anl.gov>
\r
35 User-Agent: Notmuch/0.15.2+75~gd7fa7c4 (http://notmuchmail.org) Emacs/24.3.1
\r
36 (x86_64-unknown-linux-gnu)
\r
37 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
38 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
39 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
40 Date: Tue, 09 Apr 2013 09:32:02 +0300
\r
41 Message-ID: <m2hajgxli5.fsf@guru.guru-group.fi>
\r
43 Content-Type: text/plain
\r
44 Cc: notmuch@notmuchmail.org
\r
45 X-BeenThere: notmuch@notmuchmail.org
\r
46 X-Mailman-Version: 2.1.13
\r
48 List-Id: "Use and development of the notmuch mail system."
\r
49 <notmuch.notmuchmail.org>
\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
53 List-Post: <mailto:notmuch@notmuchmail.org>
\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
57 X-List-Received-Date: Tue, 09 Apr 2013 06:32:11 -0000
\r
59 On Tue, Apr 09 2013, Jed Brown wrote:
\r
61 > David Bremner <david@tethera.net> writes:
\r
63 >> Squashed sounds good to me too. Sorry I'm too lazy/busy at the moment to
\r
66 > I tested the attached and it's working as expected. Sent as an
\r
67 > attachment to preserve author information.
\r
69 LGTM (this time tested, too). Also compared diffs by hand, change as announced.
\r
70 comments in id:m26207wgyt.fsf@guru.guru-group.fi (amend!) apply.
\r
75 >>From 5404ac5bf13f8b5349d5b94f9f2000e9d1832b83 Mon Sep 17 00:00:00 2001
\r
76 > From: Daniel Bergey <bergey@alum.mit.edu>
\r
77 > Date: Mon, 8 Apr 2013 19:55:04 -0500
\r
78 > Subject: [PATCH] emacs: functions to import sender or recipient into BBDB [v2]
\r
80 >>From a show buffer, notmuch-bbdb/snarf-from imports the sender into
\r
81 > bbdb. notmuch-bbdb/snarf-to imports all recipients. Newly imported
\r
82 > contacts are reported in the minibuffer / Messages buffer.
\r
84 > Both functions use the BBDB parser to recognize email address formats.
\r
86 > [v2] Fixes missing close parenthesis in original.
\r
87 > Spotted by Karl Fogel <kfogel@red-bean.com>.
\r
89 > emacs/notmuch-address.el | 41 +++++++++++++++++++++++++++++++++++++++++
\r
90 > 1 file changed, 41 insertions(+)
\r
92 > diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
\r
93 > index 2bf762b..4eda098 100644
\r
94 > --- a/emacs/notmuch-address.el
\r
95 > +++ b/emacs/notmuch-address.el
\r
96 > @@ -96,6 +96,47 @@ line."
\r
97 > (when (notmuch-address-locate-command notmuch-address-command)
\r
98 > (notmuch-address-message-insinuate))
\r
100 > +;; functions to add sender / recipients to BBDB
\r
102 > +(defun notmuch-bbdb/snarf-headers (headers)
\r
103 > + ;; Helper function to avoid code duplication in the two below
\r
104 > + ;; headers should have the same format as bbdb-get-addresses-headers
\r
106 > + ;; bbdb-get-addresses reads these
\r
107 > + ;; Ugh, pass-by-global
\r
108 > + (let ((addrs (bbdb-get-addresses nil nil 'notmuch-bbdb/get-header-content))
\r
109 > + (bbdb-get-addresses-headers headers) ; headers to read
\r
110 > + (bbdb-gag-messages t)) ; suppress m/n processed message)
\r
111 > + (bbdb-update-records addrs t t)))
\r
113 > +(defun notmuch-bbdb/snarf-from ()
\r
114 > + "Import the sender of the current message into BBDB"
\r
116 > + (notmuch-bbdb/snarf-headers
\r
117 > + (list (assoc 'authors bbdb-get-addresses-headers))))
\r
119 > +(defun notmuch-bbdb/snarf-to ()
\r
120 > + "Import all recipients of the current message into BBDB"
\r
122 > + (notmuch-bbdb/snarf-headers
\r
123 > + (list (assoc 'recipients bbdb-get-addresses-headers))))
\r
125 > +(defvar notmuch-bbdb/header-by-name
\r
126 > + ;; both are case sensitive
\r
127 > + '( ("From" . :From)
\r
131 > + ("Resent-From" . nil)
\r
132 > + ("Reply-To" . nil)
\r
133 > + ("Resent-To" . nil)
\r
134 > + ("Resent-CC" . nil))
\r
135 > + "Alist for dispatching header symbols as used by notmuch-show-get-header
\r
136 > +from strings as used by bbdb-get-addresses")
\r
138 > +(defun notmuch-bbdb/get-header-content (name)
\r
139 > + (notmuch-show-get-header (cdr (assoc name notmuch-bbdb/header-by-name))))
\r
143 > (provide 'notmuch-address)
\r
147 > _______________________________________________
\r
148 > notmuch mailing list
\r
149 > notmuch@notmuchmail.org
\r
150 > http://notmuchmail.org/mailman/listinfo/notmuch
\r