From c43e6b0a9afeceeb70e36834cf3e707727fec0e3 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 19 Nov 2010 10:56:37 +0100 Subject: [PATCH] Add how to attach files from command line --- emacstips.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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

-- 2.43.0