--- /dev/null
+Return-Path: <bacuh@riseup.net>\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 43DC3431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 3 Jul 2014 17:48:52 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_NONE=-0.0001, UNPARSEABLE_RELAY=0.001]\r
+ 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 cHPpjH8bDl8T for <notmuch@notmuchmail.org>;\r
+ Thu, 3 Jul 2014 17:48:46 -0700 (PDT)\r
+X-Greylist: delayed 597 seconds by postgrey-1.32 at olra;\r
+ Thu, 03 Jul 2014 17:48:46 PDT\r
+Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 41E93431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 3 Jul 2014 17:48:46 -0700 (PDT)\r
+Received: from fruiteater.riseup.net (fruiteater-pn.riseup.net [10.0.1.74])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (Client CN "*.riseup.net",\r
+ Issuer "Gandi Standard SSL CA" (not verified))\r
+ by mx1.riseup.net (Postfix) with ESMTPS id 4CF2149376;\r
+ Thu, 3 Jul 2014 17:38:48 -0700 (PDT)\r
+Received: from [127.0.0.1] (localhost [127.0.0.1])\r
+ (Authenticated sender: bacuh@fruiteater.riseup.net)\r
+ with ESMTPSA id CDBC61016\r
+From: Sebastian Lipp <bacuh@riseup.net>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>,\r
+ Jed Brown <jed@59A2.org>, Jani Nikula <jani@nikula.org>,\r
+ Karl Fogel <kfogel@red-bean.com>, 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: <m2ehejykb1.fsf@guru.guru-group.fi>\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> <87ip3wbj7g.fsf@mcs.anl.gov>\r
+ <m2hajgxli5.fsf@guru.guru-group.fi>\r
+ <87vc7vgbym.fsf@zancas.localnet>\r
+ <m2ehejykb1.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1\r
+ (i686-pc-linux-gnu)\r
+Date: Fri, 04 Jul 2014 02:38:51 +0200\r
+Message-ID:\r
+ <87pphmc604.fsf@verb.i-did-not-set--mail-host-address--so-tickle-me>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+X-Virus-Scanned: clamav-milter 0.98.1 at mx1\r
+X-Virus-Status: Clean\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: Fri, 04 Jul 2014 00:48:52 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+Tomi Ollila <tomi.ollila@iki.fi> writes:\r
+> On Tue, Apr 09 2013, David Bremner wrote:\r
+>> There seems to be a few warnings:\r
+>>\r
+>> In notmuch-bbdb/snarf-from:\r
+>> notmuch-address.el:116:26:Warning: reference to free variable\r
+>> `bbdb-get-addresses-headers'\r
+>>\r
+>> In notmuch-bbdb/snarf-to:\r
+>> notmuch-address.el:122:29:Warning: reference to free variable\r
+>> `bbdb-get-addresses-headers'\r
+>>\r
+>> In end of data:\r
+>> notmuch-address.el:143:1:Warning: the following functions are not known to be\r
+>> defined: bbdb-get-addresses, bbdb-update-records, notmuch-show-get-header\r
+>>\r
+>> Do we need a few defvars?\r
+>\r
+> For the above set, something like:\r
+>\r
+> (defvar bbdb-get-addresses-headers)\r
+>\r
+> (declare-function notmuch-show-get-header "notmuch-show" (header &optional props))\r
+>\r
+> (declare-function bbdb-get-addresses "bbdb-com" \r
+> (only-first-address\r
+> uninteresting-senders\r
+> get-header-content-function\r
+> &rest get-header-content-function-args))\r
+>\r
+> (declare-function bbdb-update-records "bbdb-com" (addrs auto-create-p offer-to-create))\r
+\r
+As I'd like to see this in notmuch I made the change. The patch is\r
+attached. As it is my first contribution to notmuch at all: Just tell me\r
+if I'm supposed to do it in any other way.\r
+\r
+LG\r
+basti\r
+\r
+\r
+--=-=-=\r
+Content-Type: text/x-diff\r
+Content-Disposition: inline;\r
+ filename=0001-emacs-functions-to-import-sender-or-recipient-into-B.patch\r
+\r
+>From 522e4294258e6392a02c923b4b7e78a898986fca 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 [v3]\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
+[v3] Fixes a few warnings as suggested by Tomi Ollila in\r
+ id:87vc7vgbym.fsf@zancas.localnet\r
+[v2] Fixes missing close parenthesis in original.\r
+ Spotted by Karl Fogel <kfogel@red-bean.com>.\r
+---\r
+ emacs/notmuch-address.el | 53 ++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 53 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
+index fa65cd5..ee7b169 100644\r
+--- a/emacs/notmuch-address.el\r
++++ b/emacs/notmuch-address.el\r
+@@ -113,6 +113,59 @@ to know how address selection is made by default."\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
++(defvar bbdb-get-addresses-headers)\r
++\r
++(declare-function notmuch-show-get-header "notmuch-show" (header &optional props))\r
++\r
++(declare-function bbdb-get-addresses "bbdb-com" \r
++ (only-first-address\r
++ uninteresting-senders\r
++ get-header-content-function\r
++ &rest get-header-content-function-args))\r
++\r
++(declare-function bbdb-update-records "bbdb-com" (addrs auto-create-p offer-to-create))\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
+2.0.1\r
+\r
+\r
+--=-=-=--\r