Re: [notmuch] Snippet to jump to message in Gnus from notmuch-show buffer
authorCarl Worth <cworth@cworth.org>
Fri, 27 Nov 2009 12:54:17 +0000 (04:54 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:44 +0000 (09:35 -0800)
2f/401993b355e7408fa17ea100bf57872e3867ba [new file with mode: 0644]

diff --git a/2f/401993b355e7408fa17ea100bf57872e3867ba b/2f/401993b355e7408fa17ea100bf57872e3867ba
new file mode 100644 (file)
index 0000000..fdce338
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <cworth@cworth.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 68C93431FC0;\r
+       Fri, 27 Nov 2009 04:54:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 2BWKPHq7nLvS; Fri, 27 Nov 2009 04:54:31 -0800 (PST)\r
+Received: from cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7854C431FAE;\r
+       Fri, 27 Nov 2009 04:54:31 -0800 (PST)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: Tassilo Horn <tassilo@member.fsf.org>, notmuch@notmuchmail.org\r
+In-Reply-To: <87zl6cl595.fsf@thinkpad.tsdh.de>\r
+References: <87zl6cl595.fsf@thinkpad.tsdh.de>\r
+Date: Fri, 27 Nov 2009 04:54:17 -0800\r
+Message-ID: <87hbsgqgau.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: Re: [notmuch] Snippet to jump to message in Gnus from notmuch-show\r
+ buffer\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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, 27 Nov 2009 12:54:32 -0000\r
+\r
+On Tue, 24 Nov 2009 09:02:46 +0100, Tassilo Horn <tassilo@member.fsf.org> wrote:\r
+> I'm a Gnus user and use notmuch mostly for searching.  When I want to\r
+> reply to a message, I need to get back to Gnus, so that my Gnus posting\r
+> styles (gcc into that group, right email address, correct signature,...)\r
+> are applied.\r
+\r
+Oh, good. I've been hoping to be able to get some advice from gnus\r
+users. I want to figure out how to get gnus support for viewing\r
+encrypted messages, etc.\r
+\r
+Do you happen to know some good documentation for how to get started\r
+with gnus for reading mail? I'd be happy even with the bare minimum to\r
+just get gnus to view one single message from out of my mail\r
+store. (Which is something I tried to figure out from the gnus manual,\r
+but I neve succeeded.)\r
+\r
+> Therefore, I created this small snippet.  Now C-c C-c inside some\r
+> message in the *notmuch-show* buffer opens this article in a Gnus\r
+> *Summary* buffer, where I can reply to it, forward it, ...\r
+> \r
+> Of course, the translation from file name to Gnus group name is\r
+> something that is different for any user.  The essence of this code is\r
+> the call to the org-gnus.el function `org-gnus-follow-link', which takes\r
+> the group name and the message-id.  It's included in Emacsen >= 23.\r
+> \r
+> --8<---------------cut here---------------start------------->8---\r
+> (require 'notmuch)\r
+> \r
+> (defun th-notmuch-file-to-group (file)\r
+>   "Calculate the Gnus group name from the given file name.\r
+> \r
+> Example:\r
+> \r
+>   IN: /home/horn/Mail/Dovecot/uni/INBOX/dbox-Mails/u.4075\r
+>   OUT: nnimap+Uni:INBOX"\r
+>   (concat "nnimap+"\r
+>           (replace-regexp-in-string \r
+>            "^\\([^/]+\\)/" "\\1:"\r
+>            (replace-regexp-in-string \r
+>             "/dbox-Mails/.*" ""\r
+>             (replace-regexp-in-string\r
+>              "/home/horn/Mail/Dovecot/" "" file)))))\r
+> \r
+> (defun th-notmuch-goto-message-in-gnus ()\r
+>   "Open a summary buffer containing the current notmuch\r
+> article."\r
+>   (interactive)\r
+>   (let ((group (th-notmuch-file-to-group (notmuch-show-get-filename)))\r
+>         (message-id (replace-regexp-in-string\r
+>                      "^id:" "" (notmuch-show-get-message-id))))\r
+>     (message "G: %s, mid: %s" group message-id)\r
+>     (if (and group message-id)\r
+>         (org-gnus-follow-link group message-id)\r
+>       (message "Couldn't get relevant infos for switching to Gnus."))))\r
+> \r
+> (define-key notmuch-show-mode-map (kbd "C-c C-c") 'th-notmuch-goto-message-in-gnus)\r
+> --8<---------------cut here---------------end--------------->8---\r
+> \r
+> BTW, why does `notmuch-show-get-message-id' prefix the message-id with\r
+> "id:"?\r
+> \r
+> Bye,\r
+> Tassilo\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+> \r