Re: .signature-related blues

2001-09-21 Thread Robert Berkowitz

Miguel Farah F. [[EMAIL PROTECTED]] wrote:
 Also: one of the nice things about tin (the news reader) is that it
 lets you have a random signature (there's a fixed part and a random
 one, selected from the files in a directory previously declared). It'd
 be nice it mutt could do that as well.
 

Mutt can do this with a little help =)

Here is a perl script that will do what you want:


#!/usr/bin/perl
# randsig.pl, by Don Blaheta.  Released into public domain, blah, blah, blah.
# Generates a signature randomly from a single file of witty quotes which
# the user maintains; the quotes can be multi-line, and are separated by
# blank lines. 

# Modifications by Glenn Maynard:
# Put your own signature in a file (typically ~/.sig), and your quotes in
# another file (ie ~/.randsig).  Put %QUOTE% in your signature file where
# you want a quote replaced. To simply output your sig with no quote 
# (%QUOTE removed), don't specify a quotefile.

# Cleaned up by me =)
# Place something like the following in your .muttrc to use this script.
# set signature=~/bin/randsig3.pl .sig ~/.mutt/quotes|

$home =  $ENV{HOME}; 

if ($#ARGV lt 0 or $#ARGV gt 1) {
  print Usage: $^X sigfile [quotefile]\n;
  exit 1;
} 

# determine the quote 
if ($#ARGV eq 1) {
  open (FI, $ARGV[1]) or die Can't open $ARGV[1]; 

  # count the quotes
  $sig[0] = 0;
  while (FI) { $sig[$#sig + 1] = tell if /^$/; } 

  # read one
  srand;
  seek(FI, $sig[int rand ($#sig + .)], SEEK_SET) or die Can't seek;
  while (FI) {
last if /^$/;
chomp ($_);
$msg .= \n;
$msg .= $_;
  }
} 

open (SIG, $ARGV[0]) or die Can't open $ARGV[0];
while (SIG) {
  $_ =~ s/%QUOTE%/$msg/;
  print $_;
} 

-- 
Robert Berkowitz

We stand together tonight not as Democrats or Republicans but as citizens
of the world, as Americans, as brothers and sisters with pain and with 
hurt. We are a circle of trust that cannot be broken. We are one people. 
We are one family. We are one nation.
- Rep. John Lewis, D-Georgia

 PGP signature


Re: .signature-related blues

2001-09-20 Thread René Clerc

On Wed, Sep 19, 2001 at 10:39:20AM -0400, Miguel Farah F. wrote:
| I believe there was a vim command or option that trimmed the signature
| off when editing/quoting the message.  Might want to search the
| archives.  

At http://www.math.ohio-state.edu/~lahvak/software/files/dotvimrc
you can find a few keymappings concerning quoted text and sigs.

I use them myself too ;)

| I think that this should be a mail-client feature, considering it does
| the rest of the preformatting (i.e. inserting quotes and the
| attribution, etcetera) too.

I think it's handy _not_ to have it in the mail-client, because
sometimes you don't want the sig to be cut off. Probably in the case
one sends you random quotes at the end of his sig, and you want to
reply on a quote ;)

(taken from How to link two different subjects ;-)

| Mutt will let you use the output of a program as a signature, so you
| could either whip up or otherwise find a program to do this.  I'm almost
| sure I've seen it mentioned before.  
| 
| Cool. I'll see that.

I use the following:

set signature=~/.mutt/signature|

And the script signature looks like:

#!/bin/bash

cat /home/rene/.signature
echo 
/usr/games/fortune -a -s -n 200

HTH,

-- 
René Clerc  - ([EMAIL PROTECTED])

Fortune sides with him who dares.
-Virgil, Aeneid



Re: .signature-related blues

2001-09-20 Thread Piet Delport


--JgQwtEuHJzHdouWu
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, 20 Sep 2001 at 09:38:39 +0200, Ren=E9 Clerc wrote:
 On Wed, Sep 19, 2001 at 10:39:20AM -0400, Miguel Farah F. wrote:
 | I think that this should be a mail-client feature, considering it
 | does the rest of the preformatting (i.e. inserting quotes and the
 | attribution, etcetera) too.
=20
 I think it's handy _not_ to have it in the mail-client, because
 sometimes you don't want the sig to be cut off. Probably in the case
 one sends you random quotes at the end of his sig, and you want to
 reply on a quote ;)

If it's an option, you can turn it off temporarily in the rare cases
that you want to reply to a sig, and keep it on in the vast majority of
cases where you just want the .sig gone.

[...]
 And the script signature looks like:
=20
 #!/bin/bash
=20
 cat /home/rene/.signature
 echo 
 /usr/games/fortune -a -s -n 200

Very OT, but why use #!/bin/bash when #!/bin/sh will do?  Not every
Unix comes with bash in /bin like (most incarnations of) Linux. :-)

--=20
Piet Delport [EMAIL PROTECTED]
Today's subliminal thought is:

--JgQwtEuHJzHdouWu
Content-Type: application/pgp-signature
Content-Disposition: inline

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (FreeBSD)

iD8DBQE7qlUNzRUP82sZFCcRAm2XAJ9O8BIHbsOU2NU+wH0mCGK6vfzDJwCfSQZz
CwZb/Uk2no9Bpds+y3h4lhM=
=1sn0
-END PGP SIGNATURE-

--JgQwtEuHJzHdouWu--



.signature-related blues

2001-09-19 Thread Miguel Farah F.

Hi all.

I'm a new mutt user, so if the stuff I ask has already been discussed
to death, please don't /dev/null me.

When I reply to an e-mail, mutt quotes it and pases it to the editor,
including the .signature - I think it'd be nice if there was an option
called trim_signature - if on, it cuts everything from the LAST line
that responds to the pattern ^-- $ (BOL-dash-dash-space-EOL) upto
the end off the mail. This would save time and bandwidth, me thinks.

Also: one of the nice things about tin (the news reader) is that it
lets you have a random signature (there's a fixed part and a random
one, selected from the files in a directory previously declared). It'd
be nice it mutt could do that as well.


-- 
MIGUEL FARAH  //   [EMAIL PROTECTED]
#include disclaimer.h   //   http://www.nn.cl/~miguel
*
Trust me - I know what I'm doing.
- Sledge Hammer



Re: .signature-related blues

2001-09-19 Thread Justin R. Miller

Thus spake Miguel Farah F. ([EMAIL PROTECTED]):

 I'm a new mutt user, so if the stuff I ask has already been discussed
 to death, please don't /dev/null me.

You should read up on the recent archives... but welcome to mutt-users
anyway :-)

 When I reply to an e-mail, mutt quotes it and pases it to the editor,
 including the .signature - I think it'd be nice if there was an option
 called trim_signature - if on, it cuts everything from the LAST line
 that responds to the pattern ^-- $ (BOL-dash-dash-space-EOL) upto
 the end off the mail. This would save time and bandwidth, me thinks.

I believe there was a vim command or option that trimmed the signature
off when editing/quoting the message.  Might want to search the
archives.  

 Also: one of the nice things about tin (the news reader) is that it
 lets you have a random signature (there's a fixed part and a random
 one, selected from the files in a directory previously declared). It'd
 be nice it mutt could do that as well.

Mutt will let you use the output of a program as a signature, so you
could either whip up or otherwise find a program to do this.  I'm almost
sure I've seen it mentioned before.  

Happy Mutting!

-- 
| Justin R. Miller / [EMAIL PROTECTED] / 0xC9C40C31
| Of all the things I've lost, I miss my pants the most.
--

 PGP signature


Re: .signature-related blues

2001-09-19 Thread Victor Yegorov

* Miguel Farah F. [EMAIL PROTECTED] [19.09.2001 17:08]:
 Also: one of the nice things about tin (the news reader) is that it
 lets you have a random signature (there's a fixed part and a random
 one, selected from the files in a directory previously declared). It'd
 be nice it mutt could do that as well.
 

take a glance on the send-hooks - i use them to add different
signatures. other possibility - output of external program, it was
already mentioned.

-- 

Victor Yegorov

 PGP signature


Re: .signature-related blues

2001-09-19 Thread Roberto Suarez Soto

On Sep/19/2001, Miguel Farah F. wrote:

 Also: one of the nice things about tin (the news reader) is that it
 lets you have a random signature (there's a fixed part and a random
 one, selected from the files in a directory previously declared). It'd
 be nice it mutt could do that as well.

Well, not natively, as everyone told you. I use signify for that. It's
a little cute program in Perl. Comes by default in Debian, but you can
download it also from www.verisim.com, I think.

-- 
  Roberto Suarez Soto  ·My yellow in this case is not so mellow
[EMAIL PROTECTED]·   In fact I'm trying to say
   Corgo/Lugo/Galicia/Spain·It's frightened like me