Re: regexp help?

2000-01-26 Thread Mikko Hänninen

Jim B <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
> I've been looking at how Mutt uses these regexps, and it seems I may need
> something more like:
>
>   
>
> From what I can tell, the expression actually is more of the "ignore" part
> rather than the "match" part... like a "negative" match.  Am I right on
> this?

I think you are.

And that unfortunately means that as far as I can see, you can't have 
the kind of reply_regexp that you'd like, because there's no way to 
specify "skip these chars" -- they'll be included no matter what you do,
or then the part at the end won't.

It would be possible to solve this case with just a reply_regexp if the 
tracking number got added somewhere to the beginning of the subject, not 
to the end.  As it is, you either need to convince the tracking software
to start adding References headers, or to use a different method for 
mungling the subjects, or to figure out some way to fix the subjects 
and/or Reference headers (procmail? custom perl script to maintain a 
database of seen subject lines which adds a References header?).


David T-G <[EMAIL PROTECTED]> wrote on Tue, 25 Jan 2000:
> Mutt regexp gurus: Is specifying the A-Z necessary if we don't care about
> the case?  If we do and have to use A-Z, will the re|aw exp match upper
> case versions?

Me either, but I think it follows the usual regexp rules, since the
re|aw part works (Most my replies begin with Re:, not re:, yet that
works for me) -- no reason why an [a-z] match would work differently.

(I mean, I haven't looked at the code, but the easiest way for a case
insensitive match is to lowercase the whole string first before
matching, instead of try to start mungling the regexp parser somehow,
so I'd be willing to bet that's how it's done).


Regards,
Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
Clouds are high flying fogs.



Printing Problem in Mutt 0.91.1

2000-01-26 Thread Anup N. Patel

Hello,

I'm using Mutt Version 0.91.1 and am having trouble printing. I tried
setting the "set print_command = "lpr -Plp1", but mutt gives me the 
following error: "print_command: unknown variable" What is the correct
configuration variable.

I'm running on Linux 2.0.38. I can not upgrade to the most recent
version because I'm not the sys admin here. Please give other alternatives.
Thank you in advance. 

-Anup Patel
__
"Religion is a candle inside a multicolored lantern. Everyone looks 
 through a particular color, but the candle is always there."
--Mohammed Neguib



Re: sort mailbox list by date

2000-01-26 Thread Olaf Hering

On Tue, Jan 25, Roland Rosenfeld wrote:

> Olaf Hering schrieb am Dienstag, den 25. Januar 2000:
> 
> > how can I sort the list of available mailboxes ( c - ? or TAB ) by date,
> > recent first?
> set sort_browser=reverse-date
> in your muttrc.

First read the source, Luke, then ask. Shame on me :)


Gruss Olaf

-- 
 $ man 1 current_release

BUGS
   Users never read manuals...



Using send-hooks with replies

2000-01-26 Thread Jimmy Mäkelä

Is it possible to look at the original To: of the message which I wan't
to reply to, and execute commands based on the contents of that.

This would be nice since it is pretty common to have more than one
email-address, and it is IMHO better to have the address which they wrote
to as From in the reply.

Looking through the source it doesn't seem like there is a way to do this
yet. But surely someone must have tried to do it. Any ideas?

Jimmy - [EMAIL PROTECTED]



Re: Using send-hooks with replies

2000-01-26 Thread Edmund GRIMLEY EVANS

Jimmy Mäkelä <[EMAIL PROTECTED]>:

> Is it possible to look at the original To: of the message which I wan't
> to reply to, and execute commands based on the contents of that.
> 
> This would be nice since it is pretty common to have more than one
> email-address, and it is IMHO better to have the address which they wrote
> to as From in the reply.

This must surely be the second most frequently asked question (after
the one about hooks having a permanent effect unless you also have a
default hook to reset the state).

See reverse_name in the latest mutt. Unfortunately this isn't in
mutt-1.0, I think.

Edmund



Re: save as sorttes

2000-01-26 Thread Mikko Hänninen

Byrial Jensen <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
> You could make a macro to:
> 
> 1) copy the current message to some other mailbox,
> 2) move the cursor to the next message
> 3) call itself
> 
> and start it at the first message in the sorted mailbox

What would cause this macro to stop?  I forget, do macros stop executing
if there's an error (ie. can't move further down)?  There should always
be some exit condition in recursive functions...  Difficult to do with
Mutt's macros since there's no conditional execution.


Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
I'm a shareware signature!  Send $2 if you use me, $10 for a manual.



Re: Using send-hooks with replies

2000-01-26 Thread Mikko Hänninen

Edmund GRIMLEY EVANS <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
> This must surely be the second most frequently asked question (after
> the one about hooks having a permanent effect unless you also have a
> default hook to reset the state).

Indeed. :-)

> See reverse_name in the latest mutt. Unfortunately this isn't in
> mutt-1.0, I think.

It is in Mutt 1.0 (and later).  At least my version 1.0 has it. :-)


Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
  unzip ; strip ; touch ; finger ; mount ; gasp ; yes ; umount ; sleep



unset resolve

2000-01-26 Thread Steve Heitke

I wanted the (d)elete action to delete the current message and advance
to the next unread message so I did the following in my muttrc:

  # delete current message and go to next new
  macro pager "d" "\t"
  macro index "d" "\t"

  unset resolve

This works great but now when I (s)ave a message the delete builtin no
longer advances me to the next message.  Is there any way I can get both
features to work like I'd like?

Thanks,

-Steve
-- 
  Steve Heitke
  [EMAIL PROTECTED]



bash, multiple mailboxes

2000-01-26 Thread Jason Helfman

Does anyone see why this wouldn't work on checking multiple mailboxes
using the bash shell?

MAILPATH="/var/spool/mail/jgh?You have mail:$USER/Mail/mutt?You
has mutt mail:$USER/Mail/clug?You have clug mail"




Re: unset resolve

2000-01-26 Thread Mikko Hänninen

Steve Heitke <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
>   # delete current message and go to next new
>   macro index "d" "\t"
> 
>   unset resolve
> 
> This works great but now when I (s)ave a message the delete builtin no
> longer advances me to the next message.  Is there any way I can get both
> features to work like I'd like?

How about something like:

  macro index d ":unset resolve\n:set resolve\n\t"

... which will unset resolve only for the duration of deleting a
message, so it will be set for an s(ave) actions.  The logic could
also be reversed, set resolve for save actions and then unset after.


Regards,
Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
Don't talk to me about tomorrow -- I'm not even prepared for YESTERDAY yet!



Re: bash, multiple mailboxes

2000-01-26 Thread Edmund GRIMLEY EVANS

Jason Helfman <[EMAIL PROTECTED]>:

> Does anyone see why this wouldn't work on checking multiple mailboxes
> using the bash shell?
> 
> MAILPATH="/var/spool/mail/jgh?You have mail:$USER/Mail/mutt?You
> has mutt mail:$USER/Mail/clug?You have clug mail"

Don't you mean $HOME rather than $USER?



Re: Using send-hooks with replies

2000-01-26 Thread Thomas Roessler

On 2000-01-26 13:25:33 +, Edmund GRIMLEY EVANS wrote:

> See reverse_name in the latest mutt. Unfortunately this isn't in
> mutt-1.0, I think.

Reverse_name is a pretty old feature, and certainly present in
stable.

However, it's more useful together with the new versions' "from"
variable.

-- 
http://www.guug.de/~roessler/




Re: unset resolve

2000-01-26 Thread Steve Heitke

On Wed, Jan 26, 2000 at 04:54:50PM +0200, [EMAIL PROTECTED] wrote:
>Steve Heitke <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
>>   # delete current message and go to next new
>>   macro index "d" "\t"
>> 
>>   unset resolve
>> 
>> This works great but now when I (s)ave a message the delete builtin no
>> longer advances me to the next message.  Is there any way I can get both
>> features to work like I'd like?
>
>How about something like:
>
>  macro index d ":unset resolve\n:set resolve\n\t"
>
> which will unset resolve only for the duration of deleting a
>message, so it will be set for an s(ave) actions.  The logic could
>also be reversed, set resolve for save actions and then unset after.
>

Thanks, I didn't know I could nest stuff like that.

-Steve
-- 
  Steve Heitke
  [EMAIL PROTECTED]



Re: regexp help?

2000-01-26 Thread David DeSimone

David T-G <[EMAIL PROTECTED]> wrote:
>
> Mutt regexp gurus:  Is specifying the A-Z necessary if we don't care
> about the case?  If we do and have to use A-Z, will the re|aw exp
> match upper case versions?

Specifying any capital letter in your regexp will cause Mutt to match
the regexp case-sensitively.  If there are no capital letters in the
regexp, it will be performed case-insensitively.

So a regexp like "^(re|aw): [A-Z]*" will fail to match "Re: ",
because the "A-Z" part causes a case-sensitive match.  If the
regexp was "^(re|aw): [a-z]*", it would match.

-- 
David DeSimone   | "The doctrine of human equality reposes on this:
[EMAIL PROTECTED]   |  that there is no man really clever who has not
Hewlett-Packard  |  found that he is stupid." -- Gilbert K. Chesterson
UX WTEC Engineer |PGP: 5B 47 34 9F 3B 9A B0 0D  AB A6 15 F1 BB BE 8C 44



Re: save as sorttes

2000-01-26 Thread Byrial Jensen

On Wed, Jan 26, 2000 at 16:30:45 +0200, Mikko Hänninen wrote:
> Byrial Jensen <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
> > You could make a macro to:
> > 
> > 1) copy the current message to some other mailbox,
> > 2) move the cursor to the next message
> > 3) call itself
> > 
> > and start it at the first message in the sorted mailbox
> 
> What would cause this macro to stop?  I forget, do macros stop executing
> if there's an error (ie. can't move further down)?

I thought so when I made the suggestion. But I just tested it
and inspected the source, and it seems that recursive macros
can't be stopped in Mutt 1.0 -- which of course makes them
useless.

I'm sure that macro executing once were stopped by errors, but I
didn't find any notice about this in the changelog. Does anybody
know why that was changed?

It would be very simple to change back.

> There should always
> be some exit condition in recursive functions...  Difficult to do with
> Mutt's macros since there's no conditional execution.

Yes, I miss a more powerfull macro language for Mutt.

-- 
Byrial



Re: regexp help?

2000-01-26 Thread David DeSimone

Jim B <[EMAIL PROTECTED]> wrote:
>
> I believe this can be corrected by a well-written regular expression, but
> I'm not so good at that so I'm wondering if anyone can help.

This won't work with Mutt as it's currently coded, because Mutt assumes
that the reply_regexp matches something at the *beginning* of the
string, and takes anything following that match as the "real subject."

Mutt uses code like this:

if (e->subject)
{
  regmatch_t pmatch[1];

  rfc2047_decode (e->subject, e->subject, mutt_strlen (e->subject) + 1);

  if (regexec (ReplyRegexp.rx, e->subject, 1, pmatch, 0) == 0)
e->real_subj = e->subject + pmatch[0].rm_eo;
  else
e->real_subj = e->subject;
}

The pmatch[] array contains a list of matches to subexpressions within
the regular expression.  pmatch[0], used here, matches the entire
regular expression.  As written, the "real subject" is taken to be
whatever comes after the reply_regexp.  So...

> Subject: RE: [GeneralService] Word1 Word2 [IMS21250368242002]
> 
> set reply_regexp = "^(re|aw):[ \t]*[ \t]\[[a-z0-9]*\]"
> 
> but that apparently doesn't work.

Nope, that won't work, because the reply_regexp matches the entire
string, leaving no "leftover" text for the "real subject".

By the way, something to watch out for in .mutrrc's:

set reply_regexp = "^(re|aw):[ \t]*"

This doesn't do what you think it does; Mutt sees the "\t" as simply
"t", because backslashes are parsed within double-quotes.  So the regexp
comes out as "^(re|aw):[ t]*", and so a subject like "Re: Tuesday" comes
out with a real subject of "uesday".  :)

Maybe there's a way to get middle-matching of subjects; I'll have to
play with it.

-- 
David DeSimone   | "The doctrine of human equality reposes on this:
[EMAIL PROTECTED]   |  that there is no man really clever who has not
Hewlett-Packard  |  found that he is stupid." -- Gilbert K. Chesterson
UX WTEC Engineer |PGP: 5B 47 34 9F 3B 9A B0 0D  AB A6 15 F1 BB BE 8C 44



Regexp dangers (was Re: regexp help?)

2000-01-26 Thread Marius Gedminas

On Wed, Jan 26, 2000 at 02:13:23PM -0600, David DeSimone wrote:
> By the way, something to watch out for in .mutrrc's:
> 
> set reply_regexp = "^(re|aw):[ \t]*"
> 
> This doesn't do what you think it does; Mutt sees the "\t" as simply
> "t", because backslashes are parsed within double-quotes.  So the regexp
> comes out as "^(re|aw):[ t]*", and so a subject like "Re: Tuesday" comes
> out with a real subject of "uesday".  :)

I always wondered, how many backslashes I need in such places ;).

However my ~/.muttrc contains this:

  set reply_regexp="^(re|aw)(\\[[0-9]+\\])?:[ \t]*" # TheBat! uses Re[%d]:

and when I query Mutt (:set ?reply_regexp), I see

  reply_regexp="^(re|aw)(\[[0-9]+\])?:[ .]*"

I suppose that `.' in brackets is the actual tab character, so your warning
is not necessary in this case.

OTOH things like

  send-hook '~C "\\


Listing PGP keys...

2000-01-26 Thread Jean-Sebastien Morisset

I'm stumped. When I encrypt a message to a friend, mutt will ask me to
select his public key. The list which comes up doesn't show his key and
several entries are missing! There are only 14 keys listed, but when I use
"pgp -kv" it shows 20 keys! I've checked my pgp variables and they all seem
ok... Here they are:

## The following options are only valid if you have
## compiled in PGP support

# set pgp_autoencrypt
set pgp_autosign
set pgp_encryptself
# set pgp_long_ids
set pgp_replyencrypt
set pgp_replysign
set pgp_sign_as="[EMAIL PROTECTED]"
set pgp_sign_micalg="pgp-md5"
set pgp_strict_enc
set pgp_timeout=300
set pgp_verify_sig=yes

# set pgp_v2=""
# set pgp_v2_language="en"
# set pgp_v2_pubring=""
# set pgp_v2_secring=""

set pgp_v5="/opt/pgp-5.0i/bin/pgp"
set pgp_v5_language="mutt"
# set pgp_v5_pubring=""
# set pgp_v5_secring=""

set pgp_v6="/opt/pgp-6.5.1i/bin/pgp"
# set pgp_v6_language=""
set pgp_v6_pubring="~/.pgp/pubring.pkr"
set pgp_v6_secring="~/.pgp/secring.skr"

set pgp_gpg="/opt/gpg/bin/gpg"
set pgp_default_version="pgp6"

# Here, "default" means the value of $pgp_default_version:

# set pgp_receive_version="default"
# set pgp_key_version="default"
# set pgp_send_version="default"

-- 
Jean-Sebastien Morisset, Sr. UNIX Administrator
up2 technologies inc.
[EMAIL PROTECTED], www.up2me.com

 PGP signature


Re: Using send-hooks with replies

2000-01-26 Thread Jeremy Blosser

Edmund GRIMLEY EVANS [[EMAIL PROTECTED]] wrote:
> Jimmy Mäkelä <[EMAIL PROTECTED]>:
> > Is it possible to look at the original To: of the message which I wan't
> > to reply to, and execute commands based on the contents of that.
> > 
> > This would be nice since it is pretty common to have more than one
> > email-address, and it is IMHO better to have the address which they wrote
> > to as From in the reply.
> 
> This must surely be the second most frequently asked question (after
> the one about hooks having a permanent effect unless you also have a
> default hook to reset the state).

I don't know, "how do I make Mutt filter mail" is pretty popular too ;)

> See reverse_name in the latest mutt. Unfortunately this isn't in
> mutt-1.0, I think.

Others have noted this has been around forever, I will add that you should
also see the $alternates variable, as reverse_name is useless without it.

-- 
Jeremy Blosser   |   [EMAIL PROTECTED]   |   http://jblosser.firinn.org/
-+-+--
"If Microsoft can change and compete on quality, I've won." -- L. Torvalds

 PGP signature


Re: Listing PGP keys...

2000-01-26 Thread Bennett Todd

2000-01-26-16:43:44 Jean-Sebastien Morisset:
> I'm stumped. When I encrypt a message to a friend, mutt will ask
> me to select his public key.

I don't know how to make mutt solve this automagically for all your
correspondents, but if you're willing to add a line to your .muttrc,
by hand, for everyone you exchange encrypted email with, then it's
easy:

pgp-hook [EMAIL PROTECTED] KEYID
pgp-hook [EMAIL PROTECTED] KEYID2
...

-Bennett

 PGP signature


Re: using "empty" my_hdr?

2000-01-26 Thread Edmund GRIMLEY EVANS

Michael Thies <[EMAIL PROTECTED]>:

> Hi You all,
> 
> I wonder, if I could use a my_hdr-command in my .muttrc defaultly like
> send-hook . "my_hdr Return-Receipt-To: "
> and appending the specific email-adress in my editor, when I want to
> get a return-receipt?
> Just like the Cc:, Bcc: or Reply-To: .
> 
> Using a send-hook defined above, my mutt tells me something about
> "ignoring empty header field: Return-Receipt-To:"
> 
> I'm using mutt-1.0pre4 (ok, I could switch to a newer version, but
> would this bring me help?).
> 
> Has anybody any idea, how to realize this?

I can't see why empty my_hdrs are not allowed. Is there any reason why
the following rather negative patch shouldn't be applied?

--- init.c.orig Wed Jan 26 23:15:44 2000
+++ init.c  Wed Jan 26 23:27:58 2000
@@ -583,13 +583,6 @@
 return (-1);
   }
   keylen = p - buf->data + 1;
-  p++;
-  SKIPWS (p);
-  if (!*p)
-  {
-snprintf (err->data, err->dsize, _("ignoring empty header field: %s"), buf->data);
-return (-1);
-  }
 
   if (UserHeader)
   {



key binding question

2000-01-26 Thread Shao Zhang

Hi,
I would like to bind a key where when I am in the brower mode
with a list of folders, I would like to press a key that goes to
the next folder which contains unread message.

Something very similar to the next-new in the index mode.

Thanks.

Shao.

-- 

Shao Zhang - Running Debian 2.1  ___ _   _
Department of Communications/ __| |_  __ _ ___  |_  / |_  __ _ _ _  __ _ 
University of New South Wales   \__ \ ' \/ _` / _ \  / /| ' \/ _` | ' \/ _` |
Sydney, Australia   |___/_||_\__,_\___/ /___|_||_\__,_|_||_\__, |
Email: [EMAIL PROTECTED]  |___/ 
_



Re: regexp help?

2000-01-26 Thread Mikko Hänninen

David DeSimone <[EMAIL PROTECTED]> wrote on Wed, 26 Jan 2000:
> By the way, something to watch out for in .mutrrc's:
> 
> set reply_regexp = "^(re|aw):[ \t]*"
> 
> This doesn't do what you think it does; Mutt sees the "\t" as simply
> "t", because backslashes are parsed within double-quotes.

Yes, but it doesn't matter if it's parsed on the first pass (the quotes)
or the second pass (the regexp) -- a \t is always the tab character, no?

I do remember someone having a problem with t's disappearing from the
beginnings of subjects, so obviously it can be a problem, I just don't
see how.

> Maybe there's a way to get middle-matching of subjects; I'll have to
> play with it.

Probably not with the current code.  With patches, certainly.


Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
"I used to be indecisive, but now I'm not sure."