From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glyn Millington Newsgroups: gmane.emacs.help Subject: Re: Mail avec emacs24 Date: Thu, 30 Apr 2015 20:17:02 +0100 Organization: Utterly lacking Message-ID: <87egn1ifyp.fsf@nowhere.org> References: <55415FC4.2020907@voo.be> <20150430.055233.2193016943746902451.devel@pollock-nageoire.net> <87d22mkw6d.fsf@nowhere.org> <877fstr4qt.fsf@desiato.home.uhoreg.ca> Reply-To: glyn.millington@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430423448 14646 80.91.229.3 (30 Apr 2015 19:50:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2015 19:50:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 30 21:50:39 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnuTm-0004wj-Vq for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 21:50:39 +0200 Original-Received: from localhost ([::1]:45602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnuTl-0007WR-Jv for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 15:50:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnuTO-0007W8-Nr for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 15:50:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnuTK-00069k-G1 for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 15:50:14 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnuTK-00069c-9d for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 15:50:10 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YnuHC-0001hp-Vj for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 21:37:39 +0200 Original-Received: from cust25-dsl91-135-3.idnet.net ([91.135.3.25]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Apr 2015 21:37:38 +0200 Original-Received: from glyn.millington by cust25-dsl91-135-3.idnet.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Apr 2015 21:37:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 97 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cust25-dsl91-135-3.idnet.net X-Liturgical-Date: Optional Memorial: Saint Pius V, pope, A.D. 2015 X-Shakespeare: "There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy." -- Hamlet, I.5 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:jqF7nMx6KOrYKkJjyAO0k9FSXFU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104108 Archived-At: Hubert Chathi writes: > On Thu, 30 Apr 2015 06:43:54 +0100, Glyn Millington said: > > [...] > >> I use Gnus and Notmuch > > Do you mean you use Gnus and Notmuch separately, or you use Gnus to > access Notmuch? If it's the latter, can you give some information about > how you have that set up? I'd be interested in looking into a setup > like that. Hi Hubert, Normally the latter. I did it something like this. 1. Install notmuch! 2. Run it from the command line, and it will take you through various configuration options. 3. Set up your init.el to run the emacs notmuch mode (which comes with notmuch) The code I use is below - mostly pinched from Bastien's init file! http://bzg.fr/emacs.html. I use John Wiegley's wonderful use-package.el, but you can extract the useful stuff easily enough. Hope this helps Glyn 8<------8<------8<------8<------8<------8<------8<------8<------8<------ ;;;; NOTMUCH (use-package notmuch :defer 3 :config (progn ;;;; add here stuff required to be configured *before* ;;; notmuch is loaded; ;; address completeion - not needed as we use bbdb ;; (require 'notmuch-address) ;; (setq notmuch-address-command "/usr/local/bin/notmuch-addrlookup") ;; (notmuch-address-message-insinuate) (setq notmuch-wash-wrap-lines-length 73) ;; set up some useful bindings (defun gm-notmuch-shortcut () (define-key gnus-group-mode-map (kbd "") 'notmuch-search)) (defun gm-notmuch-new-shortcut () (define-key gnus-group-mode-map (kbd "") (shell-command "notmuch new > /dev/null 2>&1"))) ;; hook 'em into gnus-group-mode (add-hook 'gnus-group-mode-hook 'gm-notmuch-shortcut) (add-hook 'gnus-group-mode-hook 'gm-notmuch-new-shortcut) ;; getting back into Gnus from notmuch! (defun gm-notmuch-file-to-group (file) "Calculate the Gnus group name from the given file name." (let* ((g0 (directory-file-name (file-name-directory file))) (g1 (replace-regexp-in-string "/home/glyn/Mail/" "" g0))) (concat "nnml:" (replace-regexp-in-string "/" "." g1)))) (defun gm-notmuch-goto-message-in-gnus () "Open a summary buffer containing the current notmuch article." (interactive) (let ((group (gm-notmuch-file-to-group (notmuch-show-get-filename))) (message-id (replace-regexp-in-string "^id:" "" (notmuch-show-get-message-id)))) (setq message-id (replace-regexp-in-string "\"" "" message-id)) (if (and group message-id) (progn (switch-to-buffer "*Group*") (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") 'gm-notmuch-goto-message-in-gnus) (define-key notmuch-search-mode-map "S" (lambda () "mark message as deleted" (interactive) (notmuch-search-tag (list "+deleted" "-inbox" "-new"))))) :bind ("" . notmuch))