summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Sojka <sojkam1@fel.cvut.cz>2010-11-19 10:56:37 +0100
committerMichal Sojka <sojkam1@fel.cvut.cz>2010-11-19 10:56:37 +0100
commitc43e6b0a9afeceeb70e36834cf3e707727fec0e3 (patch)
treed5124738d8b604dec79a5d9884e53109c46424e1
parentb155f6009c63f09745768ae00da816b428910891 (diff)
Add how to attach files from command line
-rw-r--r--emacstips.mdwn14
1 files changed, 14 insertions, 0 deletions
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)"
+
+
-----
<h2 id="advanced_tips">Advanced tips and tweaks</h2>