jeremy-compostella / org-msg

OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
GNU General Public License v3.0
276 stars 57 forks source link

Org msg dired attach #118

Closed bottom-bracket closed 3 years ago

bottom-bracket commented 3 years ago

Normal mu4e/gnus composing already supports selection of attachments via dired (gnus-dired-attach) and I missed this feature in org-msg, in particular for multiple attachments, as calling the attach dispatcher multiple times and navigating to different directories takes some time for me.

This adds two function to the org-msg namespace that clone the functionality of the corresponding gnus-dired functions, which are: org-msg-dired-mail-buffers

org-msg-dired-attach

Ideally, org-msg-dired-attach can be bound to a key in the dired map.

jeremy-compostella commented 3 years ago

Good idea. I thought about implementing it a long time ago but I never look into it.

While I was reviewing your patches, I realized that there is most likely a more efficient way to implement this than duplicating code. I have made a patch and pushed it on the experimental branch. It seems to work on my end. One of the nice benefits of advising the gnus-dired-attach is that the dired keybinding is automatic :)

bottom-bracket commented 3 years ago

Cool! I knew there would be a more elegant way. My elisp skills are not that advanced and I did not have the time to look into it deeper at the moment.

I can confirm that your patch works for me, using the standard gnus-dired keybindings. There was only a parenthesis missing in line 159. Thanks for adding this feature :+1:

jeremy-compostella commented 3 years ago

I pushed my implementation to the master branch.