5 echo "Usage: $0 command"
9 echo " send [sendargs]"
15 echo " refile +folder"
24 echo "$0 has no own version number, thus this instead:"
28 echo "$0 has no own version number, thus this instead:" 1>&2
46 if [ -f "$mhmetafile" ]
48 lasteditor=`anno -list -component 'mmh-last-editor' "$mhmetafile"`
49 if [ -n "$lasteditor" ]
51 editor=`echo $lasteditor | cut -d ' ' -f 1`
52 mheditor=`mhparam "$editor-next"`
53 [ -n "$mheditor" ] && return
58 if [ -n "$MMHEDITOR" ]
63 mheditor=`mhparam 'Editor'`
70 anno -delete -number all -component "$component" "$mhmetafile"
71 anno -nodate -component "$component" -text "$newtext" "$mhmetafile"
76 mhshowproc=`mhparam 'listproc'`
83 filename=`basename "$1"`
95 mhext=`mhparam Metafile-Extension`
96 mhmetafile="$mhdraft""$mhext"
102 if [ "$mhuse" -eq 1 ]
104 exec $mheditor $mhdraft
107 save_config mmh-mhaltmsg "$mhaltmsg"
108 save_config mmh-mhdist "$mhdist"
109 save_config mmh-mhfolder "$mhfolder"
110 save_config mmh-mhmessages "$mhmessages"
111 save_config mmh-mhannotate "$mhannotate"
112 save_config mmh-last-editor "$mheditor"
113 exec $mheditor "$mhdraft"
125 save_config mmh-last-editor "$mheditor"
126 exec $mheditor "$mhdraft"
132 exec $mhshowproc -file $mhdraft
137 export mhaltmsg=`anno -list -component 'mmh-mhaltmsg' "$mhmetafile"`
138 export mhdist=`anno -list -component 'mmh-mhdist' "$mhmetafile"`
139 export mhfolder=`anno -list -component 'mmh-mhfolder' "$mhmetafile"`
140 export mhmessages=`anno -list -component 'mmh-mhmessages' "$mhmetafile"`
141 export mhannotate=`anno -list -component 'mmh-mhannotate' "$mhmetafile"`
144 mhl -form mhl.whatnow2 "$tmp" > "$mhdraft"
151 send "$@" "$mhdraft" || exit $?
159 folder -push "$draftfolder" >/dev/null 2>&1
161 folder -pop >/dev/null 2>&1
167 header=`mhparam 'Attachment-Header'`
172 echo "file not found: $1" 1>&2
174 echo -n "folloing files are not attached: " 1>&2
179 file=`get_realpath "$1"`
180 anno -nodate -append -component "$header" -text "$file" "$mhdraft"
187 header=`mhparam 'Attachment-Header'`
188 anno -list -number -component "$header" "$mhdraft"
193 header=`mhparam 'Attachment-Header'`
196 anno -delete -component "$header" -number "$1" "$mhdraft"
199 echo "can't delet attachment $1" 1>&2
208 mhaltmsg=`anno -list -component 'mmh-mhaltmsg' "$mhmetafile"`
210 if [ -z "$mhaltmsg" ]
212 echo "no altmsg" 1>&2
215 exec $mhshowproc -file "$mhaltmsg"
227 draftfolder=`mhparam draftfolder`
229 mhdraft=`mhpath "$draftfolder" c 2>/dev/null`
236 -V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version)
240 echo "no current message in $draftfolder" 1>&2
245 mhext=`mhparam Metafile-Extension`
246 mhmetafile="$mhdraft""$mhext"
255 [ $# -eq 0 ] || usage 1
261 del|dele|delet|delete)
262 [ $# -eq 0 ] || usage 1
265 di|dis|disp|displ|displa|display)
266 [ $# -eq 0 ] || usage 1
269 at|att|atta|attac|attach)
273 [ $# -eq 0 ] || usage 1
276 det|deta|detac|detach)
279 r|re|ref|refi|refil|refile)
280 refile -file "$mhdraft" "$@"
288 -V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version)