From: Michal Sojka Date: Tue, 28 Dec 2010 13:38:20 +0000 (+0100) Subject: Fix script for adding attachments from command line X-Git-Url: https://git.cworth.org/git?p=notmuch-wiki;a=commitdiff_plain;h=b925c865e943f1cf21dd19593f2b7fdcaf92bbc3 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. --- 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)"