[notmuch] Using notmuch as an address book for tab-completion
authorJesse Rosenthal <jrosenthal@jhu.edu>
Sun, 21 Mar 2010 02:35:42 +0000 (22:35 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:24 +0000 (09:36 -0800)
c7/1a03e3800c528ec35394d4ae0fa42ec95347cb [new file with mode: 0644]

diff --git a/c7/1a03e3800c528ec35394d4ae0fa42ec95347cb b/c7/1a03e3800c528ec35394d4ae0fa42ec95347cb
new file mode 100644 (file)
index 0000000..2372c22
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <prvs=jrosenthal=6892ac58a@jhu.edu>\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 4C1AE4196F0\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Mar 2010 19:35:39 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.5\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.5 tagged_above=-999 required=5\r
+       tests=[BAYES_50=0.8, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham\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 zAsnS5vhaDHF for <notmuch@notmuchmail.org>;\r
+       Sat, 20 Mar 2010 19:35:38 -0700 (PDT)\r
+Received: from ipex3.johnshopkins.edu (ipex3.johnshopkins.edu\r
+       [128.220.161.140])\r
+       by olra.theworths.org (Postfix) with ESMTP id 04C17431FC1\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Mar 2010 19:35:37 -0700 (PDT)\r
+X-IronPort-AV: E=Sophos;i="4.51,281,1267419600"; d="scan'208";a="364693379"\r
+Received: from c-69-255-36-229.hsd1.md.comcast.net (HELO lucky)\r
+       ([69.255.36.229])\r
+       by ipex3.johnshopkins.edu with ESMTP/TLS/AES256-SHA;\r
+       20 Mar 2010 22:35:37 -0400\r
+Received: from jkr by lucky with local (Exim 4.69)\r
+       (envelope-from <jrosenthal@jhu.edu>)\r
+       id 1NtB0w-0007M9-Vj; Sat, 20 Mar 2010 22:35:42 -0400\r
+From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
+To: notmuch@notmuchmail.org\r
+Date: Sat, 20 Mar 2010 22:35:42 -0400\r
+Message-ID: <87fx3uflkx.fsf@jhu.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: [notmuch] Using notmuch as an address book for tab-completion\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: Sun, 21 Mar 2010 02:35:39 -0000\r
+\r
+Dear All,\r
+\r
+There was some talk on IRC ages ago about using notmuch as an\r
+address-book for tab-completion in emacs message mode. Thanks to some\r
+great recent work (Ingmar Vanhassel's shared lib and Sebastians's\r
+cnotmuch python lib) I have been able to take a first step in that\r
+direction. I've written a python script (with some help and suggestions\r
+from spaetz) which can perform the address-book functionality, and a\r
+backend for emacs's EUDC address-lookup functionality to access the\r
+script.\r
+\r
+They are available by the following commands:\r
+\r
+git clone http://jkr.acm.jhu.edu/git/notmuch_addresses.git\r
+git clone http://jkr.acm.jhu.edu/git/notmuch_eudc.git\r
+\r
+Remember, neither of these will do you much good with the shared lib and\r
+cnotmuch installed.\r
+\r
+At the moment, the script works by search addresses that you have\r
+written to (or CC'd or BCC'd) in the past. This seems like a good\r
+utility-speed tradeoff, but it would be easy to hack the script to\r
+search a different set of messages. Give three letters (it looks through\r
+first names, last names, and email addresses) it returns results from my\r
+12K messages in well under a second. \r
+\r
+The responses are sorted by frequency, and each email address is\r
+associated with the most frequently used real name (null real-names are\r
+avoided, unless they're the only option).\r
+\r
+The script can be run from the command line by:\r
+$ python notmuch_addresses.py query\r
+\r
+To get tab completion from emacs, you have to install the script into\r
+your path, make it executable, and then put my eudcb-notmuch.el file\r
+into your load path (you should byte-compile it too). DON'T CHANGE THE\r
+TITLE OF THE .EL FILE! EUDC looks for a specific title based on\r
+protocol.\r
+\r
+Then add the following to your .emacs:\r
+\r
+(eudc-set-server "localhost" 'notmuch t)\r
+(setq eudc-server-hotlist '(("localhost" . notmuch)))\r
+(setq eudc-inline-expansion-servers 'hotlist)\r
+\r
+if you wish to use BBDB too (likely before you use notmuch), then\r
+you should use something like this:\r
+\r
+(eudc-set-server "localhost" 'bbdb t)\r
+(eudc-protocol-set 'eudc-inline-expansion-format \r
+                  '("%s %s <%s>" firstname lastname net)\r
+                  'bbdb)\r
+(eudc-set-server "localhost" 'notmuch t)\r
+(setq eudc-server-hotlist '(("localhost" . bbdb)\r
+                           ("localhost" . notmuch)))\r
+(setq eudc-inline-expansion-servers 'hotlist)\r
+\r
+That should do it. Please let me know if it works for you.\r
+\r
+(For those of you who care, eudcb-notmuch.el has a few hacky bits to\r
+hide the fact that notmuch really isn't an address book. That is, it\r
+doesn't know the difference between names and email addresses. So\r
+everything you enter just goes in as one string, which I call "name."\r
+Back-end stuff, but if you're looking through the code, that might make\r
+a few things clearer.)\r
+\r
+Best,\r
+Jesse\r