Re: [notmuch] Snippet to jump to message in Gnus from notmuch-show buffer
authorBrett Viren <brett.viren@gmail.com>
Sun, 21 Nov 2010 01:12:41 +0000 (20:12 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:34 +0000 (09:37 -0800)
96/1c4c17dce1614f753e23615153389491303e29 [new file with mode: 0644]

diff --git a/96/1c4c17dce1614f753e23615153389491303e29 b/96/1c4c17dce1614f753e23615153389491303e29
new file mode 100644 (file)
index 0000000..2f8cf74
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <brett.viren@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 6D2DA40DF1F\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 17:12:54 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.999\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
+       DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]\r
+       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 b9SpYFpOPHWk for <notmuch@notmuchmail.org>;\r
+       Sat, 20 Nov 2010 17:12:42 -0800 (PST)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9B5E540DEEC\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 17:12:42 -0800 (PST)\r
+Received: by fxm10 with SMTP id 10so952083fxm.26\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 17:12:41 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:mime-version:received:received:in-reply-to\r
+       :references:date:message-id:subject:from:to:content-type\r
+       :content-transfer-encoding;\r
+       bh=j7D6tAs4NKNqGZT3xJMP7/gE67E21ksM0Mak/L51WCI=;\r
+       b=ttkurPhHi+T8GMJR5VbytDIl1FYp0nHWPBKWbfMm5qN7UCwk+7UzyudGb6EhOf7pjj\r
+       OcIqqD5N6+iwnHTQoo8Ank+rUGzdng5J9pSqmJav2KuVyltuvxxebHNwfQADoxTGy+0l\r
+       +I5ireUq1h5DT2/rfhiZ7SFi8UW2RKqJZgAoM=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
+       :content-type:content-transfer-encoding;\r
+       b=DcXqgBHrr9dtWwu93wOIKGPBnGLQVFLOUFM3jBKKjU+CrvpJ+KfJNPQDZykpoPLCGX\r
+       ZhiWe4PGYjwpT9rkwChY1Ojk/guLcsiYlEWhRRsimpBcxYPoOub7NKOEXhneEld6jDHr\r
+       h64+UTqnFYN4t7FzTDG0QNg0YxiDTAiTWOq6o=\r
+MIME-Version: 1.0\r
+Received: by 10.223.122.146 with SMTP id l18mr2598426far.102.1290301961671;\r
+       Sat, 20 Nov 2010 17:12:41 -0800 (PST)\r
+Received: by 10.223.89.142 with HTTP; Sat, 20 Nov 2010 17:12:41 -0800 (PST)\r
+In-Reply-To: <87zl6cl595.fsf@thinkpad.tsdh.de>\r
+References: <87zl6cl595.fsf@thinkpad.tsdh.de>\r
+Date: Sat, 20 Nov 2010 20:12:41 -0500\r
+Message-ID: <AANLkTimrF2OXzJFNfhrJ-rA44FRDRw_7PKMGD3Kec2D4@mail.gmail.com>\r
+Subject: Re: [notmuch] Snippet to jump to message in Gnus from notmuch-show\r
+       buffer\r
+From: Brett Viren <brett.viren@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\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 Nov 2010 01:12:54 -0000\r
+\r
+Hi Tassilo,\r
+\r
+I adapted your code for my use and found it was failing due to some\r
+stray double-quotes.  I'm using notmuch from git so maybe these quotes\r
+were added in the year since you first posted your idea.\r
+\r
+See below for the simple fix:\r
+\r
+On Tue, Nov 24, 2009 at 3:02 AM, Tassilo Horn <tassilo@member.fsf.org> wrot=\r
+e:\r
+> --8<---------------cut here---------------start------------->8---\r
+> (require 'notmuch)\r
+>\r
+> (defun th-notmuch-file-to-group (file)\r
+> =A0"Calculate the Gnus group name from the given file name.\r
+>\r
+> Example:\r
+>\r
+> =A0IN: /home/horn/Mail/Dovecot/uni/INBOX/dbox-Mails/u.4075\r
+> =A0OUT: nnimap+Uni:INBOX"\r
+> =A0(concat "nnimap+"\r
+> =A0 =A0 =A0 =A0 =A0(replace-regexp-in-string\r
+> =A0 =A0 =A0 =A0 =A0 "^\\([^/]+\\)/" "\\1:"\r
+> =A0 =A0 =A0 =A0 =A0 (replace-regexp-in-string\r
+> =A0 =A0 =A0 =A0 =A0 =A0"/dbox-Mails/.*" ""\r
+> =A0 =A0 =A0 =A0 =A0 =A0(replace-regexp-in-string\r
+> =A0 =A0 =A0 =A0 =A0 =A0 "/home/horn/Mail/Dovecot/" "" file)))))\r
+>\r
+> (defun th-notmuch-goto-message-in-gnus ()\r
+> =A0"Open a summary buffer containing the current notmuch\r
+> article."\r
+> =A0(interactive)\r
+> =A0(let ((group (th-notmuch-file-to-group (notmuch-show-get-filename)))\r
+> =A0 =A0 =A0 =A0(message-id (replace-regexp-in-string\r
+> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "^id:" "" (notmuch-show-get-messa=\r
+ge-id))))\r
+\r
+I needed to define the message-id like:\r
+\r
+       (message-id (replace-regexp-in-string\r
+                   "\"" ""\r
+                   (replace-regexp-in-string\r
+                    "^id:" "" (notmuch-show-get-message-id)))))\r
+\r
+\r
+> =A0 =A0(message "G: %s, mid: %s" group message-id)\r
+> =A0 =A0(if (and group message-id)\r
+> =A0 =A0 =A0 =A0(org-gnus-follow-link group message-id)\r
+> =A0 =A0 =A0(message "Couldn't get relevant infos for switching to Gnus.")=\r
+)))\r
+>\r
+> (define-key notmuch-show-mode-map (kbd "C-c C-c") 'th-notmuch-goto-messag=\r
+e-in-gnus)\r
+> --8<---------------cut here---------------end--------------->8---\r
+\r
+Regards and thanks for this handy code!\r
+-Brett.\r