using notmuch programmatically from emacs
authorAlan Schmitt <alan.schmitt@polytechnique.org>
Fri, 18 Jul 2014 13:09:47 +0000 (15:09 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:03:45 +0000 (10:03 -0800)
ac/14d9ede838241e5ec6cf298075e8af784b948a [new file with mode: 0644]

diff --git a/ac/14d9ede838241e5ec6cf298075e8af784b948a b/ac/14d9ede838241e5ec6cf298075e8af784b948a
new file mode 100644 (file)
index 0000000..6373ee0
--- /dev/null
@@ -0,0 +1,101 @@
+Return-Path: <alan.schmitt@polytechnique.org>\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 1E53B431FBD\r
+       for <notmuch@notmuchmail.org>; Fri, 18 Jul 2014 06:09:58 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -5\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_HI=-5] 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 LXbkzbBYlpoz for <notmuch@notmuchmail.org>;\r
+       Fri, 18 Jul 2014 06:09:52 -0700 (PDT)\r
+Received: from mail2-relais-roc.national.inria.fr\r
+       (mail2-relais-roc.national.inria.fr [192.134.164.83])\r
+       (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 49CBC431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 18 Jul 2014 06:09:52 -0700 (PDT)\r
+X-IronPort-AV: E=Sophos;i="5.01,685,1400018400"; d="scan'208";a="85919657"\r
+Received: from cbg35-2-78-242-14-140.fbx.proxad.net (HELO top.local)\r
+       ([78.242.14.140])\r
+       by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA;\r
+       18 Jul 2014 15:09:49 +0200\r
+From: Alan Schmitt <alan.schmitt@polytechnique.org>\r
+To: notmuch <notmuch@notmuchmail.org>\r
+Subject: using notmuch programmatically from emacs\r
+Date: Fri, 18 Jul 2014 15:09:47 +0200\r
+Message-ID: <m2r41iyfs4.fsf@polytechnique.org>\r
+User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha512; protocol="application/pgp-signature"\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, 18 Jul 2014 13:09:58 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Hello,\r
+\r
+I sometimes have to find a message knowing only its message id. I know\r
+how to use a notmuch search in emacs to find the message, then use\r
+another function to display it in gnus, but I would like to do it\r
+directly without going through the *notmuch-search* buffer.\r
+\r
+Right now I'm doing the following:\r
+\r
+#+begin_src emacs-lisp\r
+  (defun as/msgid-to-gnus (msgid)\r
+    "Search for the MSGID using notmuch, then open the message with\r
+  gnus."\r
+    (let ((file (shell-command-to-string (concat "notmuch search --output=\r
+=3Dfiles 'id:" msgid "'"))))\r
+      (gnus-summary-read-group (notmuch-file-to-group file))\r
+      (gnus-summary-refer-article msgid)))\r
+#+end_src\r
+\r
+(the `notmuch-file-to-group' function takes a file name and finds the\r
+corresponding gnus group).\r
+\r
+Is there a way to do the same thing using notmuch.el functionality\r
+(i.e., without having to do the `shell-command-to-string' myself)?\r
+\r
+Thanks,\r
+\r
+Alan\r
+\r
+=2D-=20\r
+OpenPGP Key ID : 040D0A3B4ED2E5C7\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG/MacGPG2 v2.0.22 (Darwin)\r
+\r
+iQEcBAEBCgAGBQJTyRyfAAoJEAQNCjtO0uXHFdcH/0B+Ks1NUUvD1uX7AmA1kBJI\r
+5dfsbTs4EeG5hd53WAuSuWhYlljvZ5ktxuPuJ74AZOlX2rBE6/K7xpeT3gz4ppac\r
+yE4dAbsnJ9dkt+xTYkGx2orTR70/rT72NglIrF19QG6v60qg6IE5IPTdVYYgA2Xf\r
+0gKC3sDRGxLHFS3dNZuLkZ59uU7NCedlYrzTO11fDR93NqJ1aXHNeyyjDgPQ63Np\r
+LgRxtEit93eCqOZNf4HDk00VvUaEGZRTVDYED1qSWPpxPwOW710dkLJnzrPncW6s\r
+5QtDdnYXgB37XD0CQQ8h1NM6KIEUXPbH6y6Na7peSunwsuw15ulKFSeLN/z1SU4=\r
+=Oiti\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r