From: Michal Sojka Date: Fri, 19 Nov 2010 09:56:37 +0000 (+0100) Subject: Add how to attach files from command line X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=c43e6b0a9afeceeb70e36834cf3e707727fec0e3;p=notmuch-wiki Add how to attach files from command line --- diff --git a/emacstips.mdwn b/emacstips.mdwn index 5f48335..9c5c3d8 100644 --- a/emacstips.mdwn +++ b/emacstips.mdwn @@ -70,6 +70,20 @@ from a file manager into a mail composition window to have it attached (assuming you are using emacs with X support). At least in Ubuntu it works by dragging from the file manager without any modifications. +And for those who prefer working from command line, the following +script opens new emacs window with empty message and attaches files +mentioned as script arguments. (Note: The script expects that you have +`(server-start)` in your .emacs) + + #!/bin/sh + attach_cmds="" + while [ "$1" ]; do + attach_cmds="$attach_cmds (mml-attach-file \"$1\")" + shift + done + emacsclient -a '' -c -e "(progn (compose-mail) $attach_cmds)" + + -----

Advanced tips and tweaks