summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Sojka <sojkam1@fel.cvut.cz>2010-12-28 14:38:20 +0100
committerMichal Sojka <sojkam1@fel.cvut.cz>2010-12-28 14:38:20 +0100
commitb925c865e943f1cf21dd19593f2b7fdcaf92bbc3 (patch)
tree1aa393e6a546225db574d7e68efe639679f29d21
parent9955a7fedfab57235e01edb137cc8e44df644884 (diff)
Fix script for adding attachments from command line
It is better to specify the attachment via its full path, because if the attachment markup is copied to another buffer, the relative path may not be valid there.
-rw-r--r--emacstips.mdwn3
1 files changed, 2 insertions, 1 deletions
diff --git a/emacstips.mdwn b/emacstips.mdwn
index fb9742a..7a23293 100644
--- a/emacstips.mdwn
+++ b/emacstips.mdwn
@@ -78,7 +78,8 @@ mentioned as script arguments. (Note: The script expects that you have
#!/bin/sh
attach_cmds=""
while [ "$1" ]; do
- attach_cmds="$attach_cmds (mml-attach-file \"$1\")"
+ fullpath=$(readlink --canonicalize $1)
+ attach_cmds="$attach_cmds (mml-attach-file \"$fullpath\")"
shift
done
emacsclient -a '' -c -e "(progn (compose-mail) $attach_cmds)"