Re: Extra line added on edit message

2000-12-29 Thread Abhay Ghaisas

Suresh Ramasubramanian [EMAIL PROTECTED]  wrote --
 Abhay Ghaisas proclaimed on mutt-users that: 
 
  I think I misled you with the clean-up part.  The script does not
  clean-up the mail-box by removing mails; I invoke it on individual mails
  to do clean-up like removing the pesky advertisements that some mailing
  list hosts like e-groups add.  Also for some other tasks like getting
 
 hmmm... couldn't you do that with procmail + sed / awk etc _before_ the mail
 lands in your mailbox?

True.  For egroups, I am doing it with procmail + perl script.  But some
other things like removing quoted text have to be done on a case to case
basis.  So, I still need the macro and editor magic.  Actually, I use a
generic perl script as editor option and pass the name of the filter
script as the first argument.  The editor script is attached.

Regards,
Abhay.
-- 
Abhay Ghaisas / [EMAIL PROTECTED]
Motorola India Electronics Ltd., Bangalore, India.

 mailCleanup.pl


Re: Extra line added on edit message

2000-12-29 Thread Conor Daly

 exit 0 unless (defined($ARGV[0])  defined($ARGV[1]));

Does perl use the usual convention of "argv[0]" is the name the
script/program was called with or sometrhing different (The line above
suggests different to me)?

TIA
-- 
Conor Daly [EMAIL PROTECTED]

Domestic Sysadmin :-)
-
 10:40pm  up 11 days, 10:28,  1 user,  load average: 0.19, 0.11, 0.03



Re: Extra line added on edit message

2000-12-29 Thread Charles Curley

On Fri, Dec 29, 2000 at 10:42:11PM +, Conor Daly muttered:
  exit 0 unless (defined($ARGV[0])  defined($ARGV[1]));
 
 Does perl use the usual convention of "argv[0]" is the name the
 script/program was called with or sometrhing different (The line above
 suggests different to me)?

Something different.

Oh, you wanted to know what is is? :-)

$0

If you don't have the camel book, get it. Programming Perl, Larry Wall 
Randall Schwartz, O'Reilly, www.ora.com.

-- 

-- C^2

No windows were crashed in the making of this email.

Looking for fine software and/or web pages?
http://w3.trib.com/~ccurley
 PGP signature


Re: Extra line added on edit message

2000-12-28 Thread Abhay Ghaisas

Suresh Ramasubramanian [EMAIL PROTECTED]  wrote --
 On Thursday 28 December 2000 11:34, Abhay Ghaisas wrote:
[snip]
  piled up at the end of the message.  Is this done with some reason or
  is it just a bug?
 
 Looks like a harmless feature to me :)

Quite harmless when hand-editing the messages; a bit of annoyance when
mixed with scripts :)

  I am using some scripts for cleaning up some mails by setting editor
  variable to script name.  And, every time I try it, new lines get
  added at end.
 
 Could you share this script?  Or you could just archive mails by using 
 date-wise folders in your .procmailrc (say mails from mutt-users in 
 march get appended to mutt-users-march)

I think I misled you with the clean-up part.  The script does not
clean-up the mail-box by removing mails; I invoke it on individual mails
to do clean-up like removing the pesky advertisements that some mailing
list hosts like e-groups add.  Also for some other tasks like getting
rid of too many additional newlines at the end (now, isn't that ironic
considering this misfeature :) or removing excessive quoting done by
some people.

Regards,
Abhay.
-- 
Abhay Ghaisas / [EMAIL PROTECTED]
Motorola India Electronics Ltd., Bangalore, India.



Re: Extra line added on edit message

2000-12-28 Thread Suresh Ramasubramanian

Abhay Ghaisas proclaimed on mutt-users that: 

 I think I misled you with the clean-up part.  The script does not
 clean-up the mail-box by removing mails; I invoke it on individual mails
 to do clean-up like removing the pesky advertisements that some mailing
 list hosts like e-groups add.  Also for some other tasks like getting

hmmm... couldn't you do that with procmail + sed / awk etc _before_ the mail
lands in your mailbox?

-- 
Suresh Ramasubramanian + Wallopus Malletus Indigenensis
mallet @ cluestick.org + Lumber Cartel of India, tinlcI
EMail Sturmbannfuhrer, Lower Middle Class Unix Sysadmin



Re: Extra line added on edit message

2000-12-28 Thread David Champion

On 2000.12.28, in [EMAIL PROTECTED],
"Suresh Ramasubramanian" [EMAIL PROTECTED] wrote:
  I am using some scripts for cleaning up some mails by setting editor
  variable to script name.  And, every time I try it, new lines get
  added at end.
 
 Could you share this script?  Or you could just archive mails by using 
 date-wise folders in your .procmailrc (say mails from mutt-users in 
 march get appended to mutt-users-march)

I'm using this to macro-reply to messages with some stock response
text.

macro   attach  \;m "enter-commandset 
wait_key=noenterpipe-entrymm-replyenterenter-commandset wait_key=yesenter" 
"Send Mailman completion message"

"mm-reply" is attached.  It's an "attach" macro because I use it only
to reply to MIME message/rfc822 components.  It probably could be a
"normal" macro if you wanted to do that kind of thing.

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago


#!/bin/sh

TMP=/tmp/mutt-formail-$$

mailquote () {
awk '
ok==1   { printf " "; }
/^$/{ ok=1; }
{ print; }'
}

formail -brkt \
| mailquote \
| sed -e 's/^$/\
done\
/'  ${TMP}

/dev/tty /opt/bin/mutt -H ${TMP} \
-e 'set abort_unmodified=no' \
-e 'set editor=/bin/true' \
-e 'macro compose e "\enter-command\set 
editor=\"vi\"\enter\\edit-message\"'

/bin/rm -f ${TMP}



Extra line added on edit message

2000-12-27 Thread Abhay Ghaisas

Hi,

When I do edit-message ('e' in index menu by default), I get the
message in my editor.  It seems like there is an extra newline added at
the end of the message.  Thus, if I repeatedly keep on editing my
message and saving it (by force) without any changes, blank lines get
piled up at the end of the message.  Is this done with some reason or is
it just a bug?

I am using some scripts for cleaning up some mails by setting editor
variable to script name.  And, every time I try it, new lines get added
at end.

Regards,
Abhay.
-- 
Abhay Ghaisas / [EMAIL PROTECTED]
Motorola India Electronics Ltd., Bangalore, India.



Re: Extra line added on edit message

2000-12-27 Thread Suresh Ramasubramanian

On Thursday 28 December 2000 11:34, Abhay Ghaisas wrote:

 When I do edit-message ('e' in index menu by default), I get the
 message in my editor.  It seems like there is an extra newline added
 at the end of the message.  Thus, if I repeatedly keep on editing my

I can duplicate this

 piled up at the end of the message.  Is this done with some reason or
 is it just a bug?

Looks like a harmless feature to me :)

 I am using some scripts for cleaning up some mails by setting editor
 variable to script name.  And, every time I try it, new lines get
 added at end.

Could you share this script?  Or you could just archive mails by using 
date-wise folders in your .procmailrc (say mails from mutt-users in 
march get appended to mutt-users-march)

--suresh

-- 
Suresh Ramasubramanian + Wallopus Malletus Indigenensis
mallet @ cluestick.org + Lumber Cartel of India, tinlcI
EMail Sturmbannfuhrer, Lower Middle Class Unix Sysadmin