From: Glyn Millington <glyn.millington@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Mail avec emacs24
Date: Thu, 30 Apr 2015 20:17:02 +0100 [thread overview]
Message-ID: <87egn1ifyp.fsf@nowhere.org> (raw)
In-Reply-To: 877fstr4qt.fsf@desiato.home.uhoreg.ca
Hubert Chathi <hubert@uhoreg.ca> writes:
> On Thu, 30 Apr 2015 06:43:54 +0100, Glyn Millington <glyn.millington@gmail.com> 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 "<f7>") 'notmuch-search))
(defun gm-notmuch-new-shortcut ()
(define-key gnus-group-mode-map (kbd "<f6>") (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 ("<f8>" . notmuch))
next prev parent reply other threads:[~2015-04-30 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 22:48 Mail avec emacs24 Rossi Xavier
2015-04-30 3:52 ` Pierre Lorenzon
2015-04-30 5:43 ` Glyn Millington
2015-04-30 15:54 ` Hubert Chathi
2015-04-30 19:17 ` Glyn Millington [this message]
[not found] ` <mailman.1983.1430374054.904.help-gnu-emacs@gnu.org>
2015-04-30 14:59 ` Rusi
2015-04-30 15:38 ` Jorge A. Alfaro-Murillo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87egn1ifyp.fsf@nowhere.org \
--to=glyn.millington@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).