viewing attachments while composing in message-mode

47 views
Skip to first unread message

Tamas K Papp

unread,
Apr 11, 2012, 5:02:55 AM4/11/12
to mu-discuss
Hi,

Is it possible to open an attachment I just added to a message I am
composing? Sometimes I like to check that I attached the right file
before sending a message. C-c RET P opens a "preview" but it is not
mu4e's view (maybe that could be achieved somehow, but I was wondering
if there is an easier solution).

Best,

Tamas

Dirk-Jan C. Binnema

unread,
Apr 11, 2012, 11:45:44 AM4/11/12
to mu-di...@googlegroups.com

C-c RET P is the fastest way that I know...

Note that for 'preview' purpose (e.g. for some image you want to
attach), you can you a file browser / picture program, and then simply
drag & drop to the message composition window.

Best wishes,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Tamas K Papp

unread,
Apr 14, 2012, 5:01:34 AM4/14/12
to mu-di...@googlegroups.com
Hi Dirk,

On Wed 11 Apr 2012 05:45:44 PM CEST, Dirk-Jan C. Binnema wrote:

>
> On Wed 11 Apr 2012 12:02:55 PM EEST, Tamas K Papp wrote:
>
> > Hi,
> >
> > Is it possible to open an attachment I just added to a message I am
> > composing? Sometimes I like to check that I attached the right file
> > before sending a message. C-c RET P opens a "preview" but it is not
> > mu4e's view (maybe that could be achieved somehow, but I was wondering
> > if there is an easier solution).
>
> C-c RET P is the fastest way that I know...
>
> Note that for 'preview' purpose (e.g. for some image you want to
> attach), you can you a file browser / picture program, and then simply
> drag & drop to the message composition window.

Can I attach files from Dired-mode somehow?

Best,

Tamas

Stephen Eglen

unread,
Apr 14, 2012, 5:57:08 PM4/14/12
to mu-di...@googlegroups.com

]Can I attach files from Dired-mode somehow?

Best,

Tamas


hi Tamas, there is gnus-dired-attach, which you can call from a dired buffer to attach files to a message-mode buffer in GNUS.  It *might* work out of the box for you  in mu4e, or it might need a little adapting.

Stephen 

Stephen Eglen

unread,
May 31, 2012, 8:40:22 AM5/31/12
to mu-di...@googlegroups.com


I had need for this today; it works pretty easily.  The following should work.  Load it up, then
you may need M-x turn-on-gnus-dired-mode.

Mark a few files in dired, then C-c RET C-a will ask whether you want to attach them to an existing message, or create a new message.




;; This is defined in message.el, but needs a simple change to
;; find mu4e composition buffers.
(defun message-buffers ()
  "Return a list of active message buffers."
  (let (buffers)
    (save-current-buffer
      (dolist (buffer (buffer-list t))
    (set-buffer buffer)
    (when (and (eq major-mode 'mu4e-compose-mode) ;; not message-mode
           (null message-sent-message-via))
      (push (buffer-name buffer) buffers))))
    (nreverse buffers)))

;; When composing new mail messages.
(setq gnus-dired-mail-mode 'mu4e-user-agent)

 

Stephen Eglen

unread,
May 31, 2012, 9:01:46 AM5/31/12
to mu-di...@googlegroups.com

;; When composing new mail messages.
(setq gnus-dired-mail-mode 'mu4e-user-agent)

Whoops - forget this bit above.  

Dirk-Jan C. Binnema

unread,
Jun 3, 2012, 3:57:49 PM6/3/12
to mu-di...@googlegroups.com
Hi,
Cool stuff! I'll add it to the mu4e manual.

Stephen Eglen

unread,
Jun 3, 2012, 5:10:45 PM6/3/12
to mu-di...@googlegroups.com

Cool stuff! I'll add it to the mu4e manual.


Thanks.  In which case, please see below for a slightly neater solution to message-buffers; using derived-mode-p is a more robust test.


(defun message-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)
Reply all
Reply to author
Forward
0 new messages