On 20Oct2011 21:22, du yang <duyang....@gmail.com> wrote: | On Thursday 10/20/11 20:09:26 CST, Volker Bouffier wrote: | > On 13Oct2011 22:08, stardiviner <numbch...@gmail.com> wrote: | > > I usually attach files to a message by putting "Attach:" header lines in | > > during the edit mode. Now, I have a vi macro bound to ^A to do this with | > > file completion easily, which makes me happy. | > Great idea! This has the additional advantage that I can attach files while | > writing the mail. I often forget the attachment with mutt. | | There have had solutions for file attaching like so. | For emacs, post-mode can do that. | As I know, the solution is mainly for the problem poeple often forget | attaching files with mutt.;-)
Not for me. 1: I always go straight to editor mode in mutt. 2: I _much_ prefer to locate file pathnames using terminal based file competion. So I will generally attach this way by choice. FYI, my ^A macro goes: map 1G}-:.r!exec </dev/tty 2>/dev/tty; readline -B 'Attach: ' IAttach: Works in plain vi as well as in vim. Those are literal ^A, ^M and ^[ (esc) in there. Readline is a tiny shell script of mine to use bash's file competion to look up and echo a filename: http://www.cskk.ezoshosting.com/cs/css/bin/readline The "readline -B 'Attach: '^M" part could as well be replaced by an invocation of an external file browser provided it could be told to report the file chosen. All you want back is the filename - mutt will do the attaching (and thus magicly give it the right MIME type, with luck). Cheers, -- Cameron Simpson <c...@zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ He no doubt sees himself as a visionary, and takes to heart Einstein's aphorism that great spirits always encounter violent opposition from mediocre minds. Just which role of that adage he plays is evidently not one of the questions upon which he dwells. - bo...@eecs.nwu.edu (James Salsman), talking about Richard E. Depew