Steven --

...and then Steven G. Harms said...
% David,
% 
% I thought I was on the right path with what you'd given me, regrettably,
% I've not found a way to make this work.

Well, we're getting close.


% 
% When using Mutt, I Use emacs as the editor and mutt then creates an

No flames today :-)


% ascii attachment from a file located in /tmp.  I realized that I could
% use the 'F' option to filter this tmpfile through a perl script or


% something of that nature.

Hmmm...  Rather than that, just modify the file before you open the
editor on it.


% 
% Regrettably, it seems that mutt chooses NOT to touch the headers -
% even when edit_headers=yes.  Here was my test.
% 
% I created 'hm.pl' which looks like:

I created /tmp/ed.sh which looks like

  #!/bin/sh
  
  perl -e '
    open MUTTI, "< '$1'";
    open MUTTO, ">'$1'.out";
    while(<MUTTI>)
      {
        print("-");     ###
        print(MUTTO "  $_");
      }
      print("\n");      ###
    close MUTTI;
    close MUTTO;
    '
  mv -f $1.out $1
  
  vim +/^$ $*

and set my $editor to that (note the clever unquoting of $1 in the open
lines) and, sure enough, found my entire file indented by two lines.

I let mutt put together the headers and the body and then hand it to the
"editor", which I've specified as a wrapper which will first manipulate
the file it's handed.

Now, I know that there is a way to edit in place in perl and skip the
temp file, but it doesn't pop to mind.  I could do it easily in ed but
that would probably be tough to use to grab the Subject: line and
generate a Cc: line :-)


...
% As you can see, the filter operation worked ONLY on the non-header data.
% 
% Possible solutions:
% 
% 1.  Find out the name of the /tmp/file (is it in a variable?) and then
%     execute some | command to insert the appropriate cc line into the
%     text.

The /tmp/file is passed to the $editor command, so you can easily read it
from your wrapper.


% 
%     I don't think this will work though.  If there's still the
%     'header' versus 'ascii attachment [i.e. content] bifurcation,
%     having the ability to write to that text file isn't
%     going to affect the headers.

I don't think that will be any problem.


% 
% 2.  Find a way to access the headers themselves?

Nah; don't bother.


% 
% ---------------------------------------------------------------------
% 
% BUT!!! I don't understand why this is.  Even as I type this message to
% you, emacs tells me your message is "/tmp/mutt-stharms-lnx-20706-83".
% If i run cat on that in another X-term i see:

Yep; by the time your editor gets it it's been put together.


HTH & HAND

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg20509/pgp00000.pgp
Description: PGP signature

Reply via email to