From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/13308 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.user Subject: Re: notmuch? Date: Fri, 27 Nov 2009 11:50:50 +0100 Message-ID: <87r5rk8cmt.fsf@thinkpad.tsdh.de> References: <87638y494z.fsf@topper.koldfront.dk> <87ocmpyscz.fsf@topper.koldfront.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1259319094 23488 80.91.229.12 (27 Nov 2009 10:51:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Nov 2009 10:51:34 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Nov 27 11:51:27 2009 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NDyQ7-0002qk-7p for gegu-info-gnus-english@m.gmane.org; Fri, 27 Nov 2009 11:51:23 +0100 Original-Received: from localhost ([127.0.0.1]:53029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDyQ6-0006lP-Uo for gegu-info-gnus-english@m.gmane.org; Fri, 27 Nov 2009 05:51:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDyQ2-0006ir-Rz for info-gnus-english@gnu.org; Fri, 27 Nov 2009 05:51:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDyPx-0006iB-En for info-gnus-english@gnu.org; Fri, 27 Nov 2009 05:51:17 -0500 Original-Received: from [199.232.76.173] (port=58564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDyPx-0006i8-3b for info-gnus-english@gnu.org; Fri, 27 Nov 2009 05:51:13 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:33177) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDyPw-0005Rv-J0 for info-gnus-english@gnu.org; Fri, 27 Nov 2009 05:51:12 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NDyPu-0002jm-HF for info-gnus-english@gnu.org; Fri, 27 Nov 2009 11:51:10 +0100 Original-Received: from p54af2603.dip0.t-ipconnect.de ([84.175.38.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Nov 2009 11:51:10 +0100 Original-Received: from tassilo by p54af2603.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Nov 2009 11:51:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 64 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p54af2603.dip0.t-ipconnect.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:zXuf8CvMF9l/uMAuC4mMV/OGFS8= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:13308 Archived-At: asjo@koldfront.dk (Adam Sjøgren) writes: Hi Adam, >> While you are still indexing, I already use it, and it's >> fantastic. :-) > > With Gnus? Could you share some of your experiences, setup etc.? Sure. I use notmuch as search engine only, and do replying and normal reading in Gnus. So the most important part is to be able to jump from a *notmuch-show* buffer to exactly that message in Gnus. Here's the code that here: --8<---------------cut here---------------start------------->8--- (require 'notmuch) (defun th-notmuch-file-to-group (file) "Calculate the Gnus group name from the given file name. Example: IN: /home/horn/Mail/Dovecot/Fastmail/.INBOX.mailinglists.notmuch/cur/1259184569.M4818P3384.localhost,W=6921:2,S OUT: nnimap+Fastmail:INBOX.mailinglists.notmuch IN: /home/horn/Mail/Dovecot/Fastmail/cur/1259176906.M17483P24679.localhost,W=2488:2,S OUT:nnimap+Fastmail:INBOX" (let ((group (file-name-directory (directory-file-name (file-name-directory file))))) (setq group (replace-regexp-in-string "/home/horn/Mail/Dovecot/" "" group)) (setq group (replace-regexp-in-string "^\\([^/]+\\)/" "nnimap+\\1:" group t)) (setq group (replace-regexp-in-string "/$" "" group)) (if (string-match ":$" group) (concat group "INBOX") (replace-regexp-in-string ":\\." ":" group)))) (defun th-notmuch-goto-message-in-gnus () "Open a summary buffer containing the current notmuch article." (interactive) (let ((group (th-notmuch-file-to-group (notmuch-show-get-filename))) (message-id (replace-regexp-in-string "^id:" "" (notmuch-show-get-message-id)))) (if (and group message-id) (org-gnus-follow-link group message-id) (message "Couldn't get relevant infos for switching to Gnus.")))) (define-key notmuch-show-mode-map (kbd "C-c C-c") 'th-notmuch-goto-message-in-gnus) --8<---------------cut here---------------end--------------->8--- The code assumes that one has his mails in a Maildir. (I use a local Dovecot IMAP client, which uses Maildir as default-backend.) Additionally, it assumes that the Gnus server names (Fastmail and Uni) equal the top-level maildir directories. So most users will need to write an own version of th-notmuch-file-to-group, but th-notmuch-goto-message-in-gnus should be general. The quintessence is that it uses org-gnus-follow-link, which comes with org-mode and is also included in emacs 23.1 and newer. Bye, Tassilo