From e949ea3233817c8f691197bd8c4fc602302e8fb7 Mon Sep 17 00:00:00 2001 From: djcb Date: Mon, 4 Jun 2012 10:32:33 +0200 Subject: [PATCH] * mu4e.texi: document Stephen Eglen's attach-from-dired trick --- emacs/mu4e.texi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/emacs/mu4e.texi b/emacs/mu4e.texi index 7a6937ac..7c6d8913 100644 --- a/emacs/mu4e.texi +++ b/emacs/mu4e.texi @@ -1335,6 +1335,7 @@ with other tools. * Getting new mail notifications with Sauron:: * Speedbar support:: * Citations with mu-cite:: +* Attaching files with dired:: @end menu @node Setting the default emacs mail program @@ -1522,6 +1523,39 @@ following to make it work with @t{mu4e}: (setq mu-cite-prefix-format '(" > "))) @end lisp +@node Attaching files with dired +@section Attaching files with @t{dired} + +It's possible to attach files to @t{mu4e} messages, using the following steps +(based on a post on the @t{mu-discuss} mailing list by Stephen Eglen). + +To prepare for this, you need a special version of the @code{gnus-dired-mail-buffers} +function so it understands @t{mu4e} buffers as well; so put in your +configuration: + +@lisp +(require 'gnus-dired) +;; make the `gnus-dired-mail-buffers' function also work on message-mode derived +;; modes, such as mu4e-compose-mode +(defun gnus-dired-mail-buffers () + "Return a list of active message buffers." + (let (buffers) + (save-current-buffer + (dolist (buffer (buffer-list t)) + (set-buffer buffer) + (when (and (derived-mode-p 'message-mode) + (null message-sent-message-via)) + (push (buffer-name buffer) buffers)))) + (nreverse buffers))) + +(setq gnus-dired-mail-mode 'mu4e-user-agent) +(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) +@end lisp + +Then, mark the file(s) in @t{dired} you would like to attach and press @t{C-c +RET C-a}, and you'll be asked whether to attach them to an existing message, +or create a new one. + @node Example configuration @chapter Example configuration