--- /dev/null
+Return-Path: <five9a2@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 6EA01431FB6\r
+ for <notmuch@notmuchmail.org>; Mon, 8 Apr 2013 18:12:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.301\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.301 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, \r
+ FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id j4y2+773o4Kq for <notmuch@notmuchmail.org>;\r
+ Mon, 8 Apr 2013 18:12:39 -0700 (PDT)\r
+Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com\r
+ [209.85.223.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id B002F431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 8 Apr 2013 18:12:39 -0700 (PDT)\r
+Received: by mail-ie0-f171.google.com with SMTP id e14so7873651iej.30\r
+ for <notmuch@notmuchmail.org>; Mon, 08 Apr 2013 18:12:39 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=x-received:sender:from:to:cc:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=1AGfDchkhsWQvs66oviCZQsIxADueajtPP7OPxaaO6E=;\r
+ b=svAB6DHkteCSRIExtN18wRdxHR5zGB/XnI5RvmGFEOldKG7nKZhTVBB9f0l8eG/ZTl\r
+ 5cw7xTFtYm9z/o4v88MXLTX5nbT/oAd57AMuhEZ0z84CDeER/NdvX9r8JjLS1pOHPUjh\r
+ g3BIKcRL9lzF5naMxbw6R3z0PKRbBCDvEH2R/68rlDIVGBMcMbxzOO5E1uKJt4+QYs0H\r
+ t7eAc4uAg8nPL46IdJs0GapzUG40cbD/JsL0uFD0voaUB2apmWa3SS5n9B+taArPwX34\r
+ GfdX9pC3J88ZHqh0G/SzkHqvU8Gw4dtSgC70U0tYg5b/9mEMSqCjE3hkZm6gvKbPzK94\r
+ ck4Q==\r
+X-Received: by 10.50.114.37 with SMTP id jd5mr9345489igb.2.1365469957953;\r
+ Mon, 08 Apr 2013 18:12:37 -0700 (PDT)\r
+Received: from localhost ([38.69.41.96])\r
+ by mx.google.com with ESMTPS id y5sm22761884igg.7.2013.04.08.18.12.36\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Mon, 08 Apr 2013 18:12:37 -0700 (PDT)\r
+Sender: Jed Brown <five9a2@gmail.com>\r
+From: Jed Brown <jed@59A2.org>\r
+To: David Bremner <david@tethera.net>, Jani Nikula <jani@nikula.org>,\r
+ Tomi Ollila <tomi.ollila@iki.fi>, Karl Fogel <kfogel@red-bean.com>,\r
+ Daniel Bergey <bergey@alum.mit.edu>\r
+Subject: Re: [PATCH] emacs: add missing paren to fix defun in\r
+ notmuch-address.el.\r
+In-Reply-To: <87k3odgutd.fsf@zancas.localnet>\r
+References: <87wqsfik5l.fsf@floss.red-bean.com>\r
+ <87mwtah2hd.fsf@zancas.localnet>\r
+ <877gkeau42.fsf@floss.red-bean.com>\r
+ <m2ppy5v3mc.fsf@guru.guru-group.fi> <8738v1jtzc.fsf@nikula.org>\r
+ <87k3odgutd.fsf@zancas.localnet>\r
+User-Agent: Notmuch/0.15.2+78~g5404ac5 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+Date: Mon, 08 Apr 2013 20:12:35 -0500\r
+Message-ID: <87ip3wbj7g.fsf@mcs.anl.gov>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 09 Apr 2013 01:12:40 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+David Bremner <david@tethera.net> writes:\r
+\r
+> Squashed sounds good to me too. Sorry I'm too lazy/busy at the moment to\r
+> do it myself.\r
+\r
+I tested the attached and it's working as expected. Sent as an\r
+attachment to preserve author information.\r
+\r
+\r
+--=-=-=\r
+Content-Type: text/x-patch\r
+Content-Disposition: inline;\r
+ filename=0001-emacs-functions-to-import-sender-or-recipient-into-B.patch\r
+\r
+>From 5404ac5bf13f8b5349d5b94f9f2000e9d1832b83 Mon Sep 17 00:00:00 2001\r
+From: Daniel Bergey <bergey@alum.mit.edu>\r
+Date: Mon, 8 Apr 2013 19:55:04 -0500\r
+Subject: [PATCH] emacs: functions to import sender or recipient into BBDB [v2]\r
+\r
+>From a show buffer, notmuch-bbdb/snarf-from imports the sender into\r
+bbdb. notmuch-bbdb/snarf-to imports all recipients. Newly imported\r
+contacts are reported in the minibuffer / Messages buffer.\r
+\r
+Both functions use the BBDB parser to recognize email address formats.\r
+\r
+[v2] Fixes missing close parenthesis in original.\r
+ Spotted by Karl Fogel <kfogel@red-bean.com>.\r
+---\r
+ emacs/notmuch-address.el | 41 +++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 41 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
+index 2bf762b..4eda098 100644\r
+--- a/emacs/notmuch-address.el\r
++++ b/emacs/notmuch-address.el\r
+@@ -96,6 +96,47 @@ line."\r
+ (when (notmuch-address-locate-command notmuch-address-command)\r
+ (notmuch-address-message-insinuate))\r
+ \r
++;; functions to add sender / recipients to BBDB\r
++\r
++(defun notmuch-bbdb/snarf-headers (headers)\r
++ ;; Helper function to avoid code duplication in the two below\r
++ ;; headers should have the same format as bbdb-get-addresses-headers\r
++\r
++ ;; bbdb-get-addresses reads these\r
++ ;; Ugh, pass-by-global\r
++ (let ((addrs (bbdb-get-addresses nil nil 'notmuch-bbdb/get-header-content))\r
++ (bbdb-get-addresses-headers headers) ; headers to read\r
++ (bbdb-gag-messages t)) ; suppress m/n processed message)\r
++ (bbdb-update-records addrs t t)))\r
++\r
++(defun notmuch-bbdb/snarf-from ()\r
++ "Import the sender of the current message into BBDB"\r
++ (interactive)\r
++ (notmuch-bbdb/snarf-headers\r
++ (list (assoc 'authors bbdb-get-addresses-headers))))\r
++\r
++(defun notmuch-bbdb/snarf-to ()\r
++ "Import all recipients of the current message into BBDB"\r
++ (interactive)\r
++ (notmuch-bbdb/snarf-headers\r
++ (list (assoc 'recipients bbdb-get-addresses-headers))))\r
++\r
++(defvar notmuch-bbdb/header-by-name\r
++ ;; both are case sensitive\r
++ '( ("From" . :From)\r
++ ("To" . :To)\r
++ ("CC" . :Cc)\r
++ ("BCC" . :Bcc)\r
++ ("Resent-From" . nil)\r
++ ("Reply-To" . nil)\r
++ ("Resent-To" . nil)\r
++ ("Resent-CC" . nil))\r
++ "Alist for dispatching header symbols as used by notmuch-show-get-header\r
++from strings as used by bbdb-get-addresses")\r
++\r
++(defun notmuch-bbdb/get-header-content (name)\r
++ (notmuch-show-get-header (cdr (assoc name notmuch-bbdb/header-by-name))))\r
++\r
+ ;;\r
+ \r
+ (provide 'notmuch-address)\r
+-- \r
+1.8.2.1\r
+\r
+\r
+--=-=-=--\r