[comp.windows.x] Inserting replies in xmh

colas@celeste.inria.fr (Colas Nahaboo) (05/23/91)

In article <9105022125.AA24441@osf.osf.org>, vania@osf.ORG (Vania Joloboff)
writes:
> when
> you insert the message you immediately want to delete the useless header
> lines. I am too lazy to write an awk script to remove them.

What about a perl script? this is the one I use...
I am NOT a perl GURU, so my perl style is surely bad. However, real perl hackers
will surely start a contest for the smallest perl script doing this job :-)

#!/usr/local/bin/perl
eval "exec /usr/local/bin/perl -S $0 $*"
    if $running_under_some_shell;
			# this emulates #! processing on NIH machines.
			# (remove #! line above if indigestible)

eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_]+=)(.*)/ && shift;
			# process any FOO=bar switches

$, = ' ';		# set output field separator
$\ = "\n";		# set output record separator

while (<>) {
    chop;	# strip record separator
    $OK = 1;
    if ($. == 1 .. /^$/) {
	$OK = 0;
    }
    if ($OK == 1) {
	print '> ' . $_;
    }
}

merlyn@iwarp.intel.com (Randal L. Schwartz) (05/24/91)

In article <11427@mirsa.inria.fr>, colas@celeste (Colas Nahaboo) writes:
| What about a perl script? this is the one I use...
| I am NOT a perl GURU, so my perl style is surely bad. However, real perl hackers
| will surely start a contest for the smallest perl script doing this job :-)
[22 line script deleted]

Gosh.  What about:

perl -ne 'print "> $_" unless 1../^$/'

Short.  Sweet.  Perl.

print "Just another Perl hacker,"
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/

thoth@reef.cis.ufl.edu (Robert Forsman) (05/31/91)

   Wait, you guys want to have the message you're replying to inserted
in the edit buffer preceeded by "> "s, right?  Why not use the
documented mh facilities?  (please excuse me if I have the question
wrong, I caught the tail end and probably shouldn't be posting).


~/.mh_profile:
Path: Mail
Editor: /local/bin/emacs
repl:-filter .replfilter
Aliasfile: .mailaliases
Signature: Robert Forsman

~/Mail/.replfilter
message-id:nocomponent,formatfield="In message %{text}you wrote: \n\n"
body:component="> ",overflowtext="> ",overflowoffset=0

  This stuff is almost directly out of the mh manual pages (which are
quite huge, by the way) and I have used it for months.  I can find (an
mail) the specific manual page if you can't find it on your system.
--
"every population has 50% that are dumber than average..." shebs@apple.com
I deal with Reality as you _don't_ understand it. 
"The way I see things, food exists to give texture to the taste of ketchup."