<<< Date Index >>>     <<< Thread Index >>>

Re: What should go into 1.5.7?



Charles Cazabon <muttdev@xxxxxxxxxxxxxxxxxxxx> wrote:
> 
> My "notalternates" patch would be nice; the original thread was here:
> http://marc.theaimsgroup.com/?l=mutt-dev&m=108558865804202&w=2

Thomas requested a cleaned-up diff (in a private message) -- attached.

Unfortunately, I haven't been able to test it yet, because mutt's build
prerequisites seem to have passed me by.  When I run autoconf, I get errors:

  configure.in:8: error: possibly undefined macro: AM_CONFIG_HEADER
        If this token and others are legitimate, please use m4_pattern_allow.
        See the Autoconf documentation.
  configure.in:13: error: possibly undefined macro: AM_INIT_AUTOMAKE
  configure.in:32: error: possibly undefined macro: AM_C_PROTOTYPES
  configure.in:513: error: possibly undefined macro: AM_CONDITIONAL

With the resulting configure script, I of course get the related error:

  ./configure: syntax error near unexpected token `AM_CONFIG_HEADER(config.h)'
  ./configure: ./configure: line 1333: `AM_CONFIG_HEADER(config.h)'

Looks like I need a newer autoconf, but I've not been able to build one
successfully -- dependency hell, it would seem.

Charles

-- 
-----------------------------------------------------------------------
Charles Cazabon                          <muttdev@xxxxxxxxxxxxxxxxxxxx>
-----------------------------------------------------------------------
diff -urN mutt.20050126.orig/alias.c mutt-notalternates/alias.c
--- mutt.20050126.orig/alias.c  Sun Feb  1 11:10:43 2004
+++ mutt-notalternates/alias.c  Wed Jan 26 08:46:37 2005
@@ -568,8 +568,12 @@
 
   if (mutt_match_rx_list (addr->mailbox, Alternates))
   {
-    dprint (5, (debugfile, "mail_addr_is_user: yes, %s matched by 
alternates.\n", addr->mailbox));
-    return 1;
+    if (!mutt_match_rx_list (addr->mailbox, Notalternates))
+    {
+      dprint (5, (debugfile, "mail_addr_is_user: yes, %s matched by alternates 
and not by notalternates.\n", addr->mailbox));
+      return 1;
+    }
+    dprint (5, (debugfile, "mail_addr_is_user: not yet, %s matched by both 
alternates and notalternates.\n", addr->mailbox));
   }
   
   dprint (5, (debugfile, "mail_addr_is_user: no, all failed.\n"));
diff -urN mutt.20050126.orig/doc/manual.sgml.head 
mutt-notalternates/doc/manual.sgml.head
--- mutt.20050126.orig/doc/manual.sgml.head     Sat Jan 15 01:36:37 2005
+++ mutt-notalternates/doc/manual.sgml.head     Wed Jan 26 08:46:47 2005
@@ -1192,7 +1192,23 @@
 receive e-mail.
 
 To remove a regular expression from this list, use the
-<tt/unalternates/ command.
+<tt/unalternates/ command.  To exclude otherwise matching addresses,
+see the <tt/notalternates/ command.
+
+<sect1>Excluding alternative addresses<label id="notalternates">
+<p>
+Usage: <tt/&lsqb;un&rsqb;notalternates/ <em/regexp/ &lsqb; <em/regexp/ ... 
&rsqb;<newline>
+
+Many users receive e-mail under a number of different addresses. To
+fully use mutt's features here, the program must be able to
+recognize what e-mail addresses you receive mail under. That's the
+purpose of the <tt/notalternates/ command: It takes a list of regular
+expressions, each of which can identify an address under which you do not
+receive e-mail.  Use this to exclude an address which mutt would otherwise
+consider an alternate address because of the <tt/alternates/ command.
+
+To remove a regular expression from this list, use the
+<tt/unnotalternates/ command.
 
 <sect1>Mailing lists<label id="lists">
 <p>
@@ -1884,8 +1900,8 @@
 ~n [MIN]-[MAX]  messages with a score in the range MIN to MAX *)
 ~N              new messages
 ~O              old messages
-~p              message is addressed to you (consults alternates)
-~P              message is from you (consults alternates)
+~p              message is addressed to you (consults alternates and 
notalternates)
+~P              message is from you (consults alternates and notalternates)
 ~Q              messages which have been replied to
 ~R              read messages
 ~r [MIN]-[MAX]  messages with ``date-received'' in a Date range
@@ -3100,6 +3116,10 @@
 <tt><ref id="alternates" name="alternates"></tt> <em/regexp/ &lsqb; 
<em/regexp/ ... &rsqb;
 <item>
 <tt><ref id="alternates" name="unalternates"></tt> &lsqb; * | <em/regexp/ ... 
&rsqb;
+<item>
+<tt><ref id="notalternates" name="notalternates"></tt> <em/regexp/ &lsqb; 
<em/regexp/ ... &rsqb;
+<item>
+<tt><ref id="notalternates" name="unnotalternates"></tt> &lsqb; * | 
<em/regexp/ ... &rsqb;
 <item>
 <tt><ref id="alternative_order" name="alternative&lowbar;order"></tt> 
<em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
 <item>
diff -urN mutt.20050126.orig/doc/muttrc.man.head 
mutt-notalternates/doc/muttrc.man.head
--- mutt.20050126.orig/doc/muttrc.man.head      Sat Jan 15 01:36:37 2005
+++ mutt-notalternates/doc/muttrc.man.head      Wed Jan 26 08:46:48 2005
@@ -87,6 +87,18 @@
 a regular expression from the list of known alternates.
 .PP
 .nf
+\fBnotalternates\fP \fIregexp\fP [ \fB,\fP \fIregexp\fP [ ... ]]
+\fBunnotalternates\fP [\fB * \fP | \fIregexp\fP [ \fB,\fP \fIregexp\fP [ ... 
]] ]
+.fi
+.IP
+\fBnotalternates\fP is used to inform mutt about addresses
+where you do not receive mail; you can use regular expressions to specify
+non-alternate addresses.  This affects mutt's idea about messages
+from you, and messages addressed to you.  \fBunnotalternates\fP removes
+a regular expression from the list of known non-alternates.  The purpose
+of this is to exclude addresses otherwise matched by \fBalternates\fP.
+.PP
+.nf
 \fBalternative_order\fP \fItype\fP[\fB/\fP\fIsubtype\fP] [ ... ]
 \fBunalternative_order\fP [\fB * \fP | \fItype\fP/\fIsubtype\fP] [...]
 .fi
@@ -423,8 +435,8 @@
 ~n \fIMIN\fP-\fIMAX\fP messages with a score in the range \fIMIN\fP to 
\fIMAX\fP
 ~N     new messages
 ~O     old messages
-~p     message is addressed to you (consults $alternates)
-~P     message is from you (consults $alternates)
+~p     message is addressed to you (consults $alternates and $notalternates)
+~P     message is from you (consults $alternates and $notalternates)
 ~Q     messages which have been replied to
 ~R     read messages
 ~r \fIMIN\fP-\fIMAX\fP messages with \(lqdate-received\(rq in a Date range
diff -urN mutt.20050126.orig/globals.h mutt-notalternates/globals.h
--- mutt.20050126.orig/globals.h        Wed Jan 26 07:36:44 2005
+++ mutt-notalternates/globals.h        Wed Jan 26 08:46:38 2005
@@ -131,6 +131,7 @@
 WHERE LIST *UnIgnore INITVAL(0);
 
 WHERE RX_LIST *Alternates INITVAL(0);
+WHERE RX_LIST *Notalternates INITVAL(0);
 WHERE RX_LIST *MailLists INITVAL(0);
 WHERE RX_LIST *SubscribedLists INITVAL(0);
 WHERE SPAM_LIST *SpamList INITVAL(0);
diff -urN mutt.20050126.orig/init.h mutt-notalternates/init.h
--- mutt.20050126.orig/init.h   Wed Jan 26 07:36:44 2005
+++ mutt-notalternates/init.h   Wed Jan 26 08:46:44 2005
@@ -2858,6 +2858,8 @@
 struct command_t Commands[] = {
   { "alternates",      parse_alternates,       UL &Alternates },
   { "unalternates",    parse_unalternates,     UL &Alternates },
+  { "notalternates",   parse_alternates,       UL &Notalternates },
+  { "unnotalternates", parse_unalternates,     UL &Notalternates },
 #ifdef USE_SOCKET
   { "account-hook",     mutt_parse_hook,        M_ACCOUNTHOOK },
 #endif