aboutsummaryrefslogtreecommitdiff
path: root/mail/mutt-devel
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2004-08-29 14:06:34 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2004-08-29 14:06:34 +0000
commit254bd6369c658c1fcfc4c8564aee3001916cc747 (patch)
treee02803a30546f796ab1b84223013d858cdead341 /mail/mutt-devel
parente9fd92b0435e8abf67cc17ccc12c1a70d3dc0841 (diff)
downloadports-254bd6369c658c1fcfc4c8564aee3001916cc747.tar.gz
ports-254bd6369c658c1fcfc4c8564aee3001916cc747.zip
Notes
Diffstat (limited to 'mail/mutt-devel')
-rw-r--r--mail/mutt-devel/Makefile20
-rw-r--r--mail/mutt-devel/files/extra-patch-maildir-header-cache90
-rw-r--r--mail/mutt-devel/files/patch-doc-manual.sgml.head111
-rw-r--r--mail/mutt-devel/files/patch-threadcomplete166
4 files changed, 292 insertions, 95 deletions
diff --git a/mail/mutt-devel/Makefile b/mail/mutt-devel/Makefile
index 9b64be2a7951..3c689ca52e7a 100644
--- a/mail/mutt-devel/Makefile
+++ b/mail/mutt-devel/Makefile
@@ -19,9 +19,9 @@
#
# The two most important knobs are:
#
-# In general you can choose between using the SLANG port (WITH_MUTT_SLANG)
-# and ncurses (WITH_MUTT_NCURSES) which is the default. Note that you may
-# have to set the variables COLORTERM=yes and COLORFGBG=color,color in your
+# In general you can choose between using ncurses (WITH_MUTT_NCURSES)
+# and SLANG (WITH_MUTT_SLANG) which is the default. Note that you may
+# have to set the variables COLORTERM=yes and COLORFGBG="color1;color2" in your
# environment to get slang function properly.
#
# If you want to install the mutt documentation in html and ps format define:
@@ -81,7 +81,7 @@
PORTNAME= mutt-devel
PORTVERSION= 1.5.6
-PORTREVISION= 8
+PORTREVISION= 9
CATEGORIES+= mail ipv6
.if defined(WITH_MUTT_NNTP)
CATEGORIES+= news
@@ -171,15 +171,15 @@ RUN_DEPENDS= ispell:${PORTSDIR}/textproc/ispell \
.if defined(WITH_MUTT_NCURSES_PORT)
WITH_MUTT_NCURSES= yes
.endif
-.if defined(WITH_MUTT_NCURSES)
-MUTT_USES_NCURSES= yes
-.endif
-.if defined(WITH_MUTT_SLANG) && !defined(MUTT_USES_NCURSES)
+.if defined(WITH_MUTT_SLANG)
MUTT_USES_SLANG= yes
.endif
-.if !defined(MUTT_USES_NCURSES) && !defined(WITHOUT_MUTT_NCURSES) && !defined(MUTT_USES_SLANG)
+.if defined(WITH_MUTT_NCURSES) && !defined(MUTT_USES_SLANG)
MUTT_USES_NCURSES= yes
.endif
+.if !defined(MUTT_USES_SLANG) && !defined(WITHOUT_MUTT_SLANG) && !defined(MUTT_USES_NCURSES)
+MUTT_USES_SLANG= yes
+.endif
.if defined(WITHOUT_MUTT_SGMLFORMAT)
SGML_USED= no
.endif
@@ -399,7 +399,7 @@ post-install:
@${ECHO} "=====================================================" >> ${PKGMESSAGE}
@${ECHO} "You have installed ${PORTNAME} with SLANG support." >> ${PKGMESSAGE}
@${ECHO} "This may work for a color terminal only when defining" >> ${PKGMESSAGE}
- @${ECHO} "COLORTERM=yes and COLORFGBG=color,color in your" >> ${PKGMESSAGE}
+ @${ECHO} "COLORTERM=yes and COLORFGBG=\"color1;color2\" in your" >> ${PKGMESSAGE}
@${ECHO} "environment." >> ${PKGMESSAGE}
@${ECHO} "=====================================================" >> ${PKGMESSAGE}
.endif
diff --git a/mail/mutt-devel/files/extra-patch-maildir-header-cache b/mail/mutt-devel/files/extra-patch-maildir-header-cache
index 807b3f21b466..af7462efb08f 100644
--- a/mail/mutt-devel/files/extra-patch-maildir-header-cache
+++ b/mail/mutt-devel/files/extra-patch-maildir-header-cache
@@ -1,14 +1,12 @@
-diff -Nru a/Makefile.am b/Makefile.am
---- a/Makefile.am 2004-08-18 10:08:12 +02:00
-+++ b/Makefile.am 2004-08-18 10:08:12 +02:00
-@@ -20,2 +20,3 @@
- mutt_SOURCES = $(BUILT_SOURCES) \
-+ hcache.c \
- addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \
+diff -Nru a/PATCHES b/PATCHES
+--- a/PATCHES
++++ b/PATCHES
+@@ -0,0 +1 @@
++patch-1.5.6.tg.hcache.2
diff -Nru a/configure.in b/configure.in
---- a/configure.in 2004-08-18 10:08:12 +02:00
-+++ b/configure.in 2004-08-18 10:08:12 +02:00
-@@ -768,6 +768,80 @@
+--- a/configure.in 2004-08-18 09:43:09 +02:00
++++ b/configure.in 2004-08-18 06:34:04 +02:00
+@@ -768,6 +768,81 @@
fi])
@@ -16,6 +14,7 @@ diff -Nru a/configure.in b/configure.in
+AC_ARG_ENABLE(hcache, [ --enable-hcache Enable header caching],
+[if test x$enableval = xyes; then
+ AC_DEFINE(USE_HCACHE, 1, [Enable header caching])
++ MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS hcache.o"
+
+ OLDCPPFLAGS="$CPPFLAGS"
+ OLDLIBS="$LIBS"
@@ -90,23 +89,23 @@ diff -Nru a/configure.in b/configure.in
AC_SUBST(MUTT_LIB_OBJECTS)
AC_SUBST(LIBIMAP)
diff -Nru a/globals.h b/globals.h
---- a/globals.h 2004-08-18 10:08:12 +02:00
-+++ b/globals.h 2004-08-18 10:08:12 +02:00
+--- a/globals.h 2004-08-18 09:43:11 +02:00
++++ b/globals.h 2004-08-26 22:32:53 +02:00
@@ -63,6 +63,10 @@
WHERE char *Locale;
WHERE char *MailcapPath;
WHERE char *Maildir;
+#if USE_HCACHE
+WHERE char *HeaderCache;
-+WHERE short HeaderCachePageSize;
++WHERE char *HeaderCachePageSize;
+#endif
WHERE char *MhFlagged;
WHERE char *MhReplied;
WHERE char *MhUnseen;
diff -Nru a/hcache.c b/hcache.c
--- /dev/null Wed Dec 31 16:00:00 196900
-+++ b/hcache.c 2004-08-18 10:08:12 +02:00
-@@ -0,0 +1,794 @@
++++ b/hcache.c 2004-08-26 22:32:53 +02:00
+@@ -0,0 +1,798 @@
+/*
+ * Copyright (C) 2004 Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
+ * Copyright (C) 2004 Tobias Werth <sitowert@stud.uni-erlangen.de>
@@ -515,7 +514,7 @@ diff -Nru a/hcache.c b/hcache.c
+{
+ int crc = 0;
+
-+ crc = crc32(crc, (unsigned char const *) "HCACHE V1", mutt_strlen("HCACHE V1"));
++ crc = crc32(crc, (unsigned char const *) "sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040826203315|26242", mutt_strlen("sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040826203315|26242"));
+
+#if HAVE_LANGINFO_CODESET
+ crc = crc32(crc, (unsigned char const *) Charset, mutt_strlen(Charset));
@@ -619,19 +618,21 @@ diff -Nru a/hcache.c b/hcache.c
+ h->folder = safe_strdup (folder);
+ h->crc = generate_crc32();
+
++ int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
++
+ if (! path || path[0] == '\0') {
+ FREE(& h->folder);
+ FREE(& h);
+ return NULL;
+ }
+
-+ h->db = gdbm_open((char *) path, (int) HeaderCachePageSize, GDBM_WRCREAT, 00600, NULL);
++ h->db = gdbm_open((char *) path, pagesize, GDBM_WRCREAT, 00600, NULL);
+ if (h->db) {
+ return h;
+ }
+
+ /* if rw failed try ro */
-+ h->db = gdbm_open((char *) path, (int) HeaderCachePageSize, GDBM_READER, 00600, NULL);
++ h->db = gdbm_open((char *) path, pagesize, GDBM_READER, 00600, NULL);
+ if(h->db) {
+ return h;
+ } else {
@@ -703,7 +704,7 @@ diff -Nru a/hcache.c b/hcache.c
+ key.dptr = path;
+ key.dsize = keylen(path);
+
-+ data.dptr = mutt_hcache_dump(db, header, &data.dsize, uid_validity);
++ data.dptr = mutt_hcache_dump(db, header, &data.dsize, uid_validity);
+
+ ret = gdbm_store(h->db, key, data, GDBM_REPLACE);
+
@@ -757,6 +758,8 @@ diff -Nru a/hcache.c b/hcache.c
+ u_int32_t createflags = DB_CREATE;
+ int ret;
+ struct header_cache *h = calloc(1, sizeof(HEADER_CACHE));
++ int pagesize = atoi(HeaderCachePageSize);
++
+
+ h->crc = generate_crc32();
+
@@ -799,7 +802,7 @@ diff -Nru a/hcache.c b/hcache.c
+
+ if (stat(path, &sb) != 0 && errno == ENOENT) {
+ createflags |= DB_EXCL;
-+ h->db->set_pagesize(h->db, (int) HeaderCachePageSize);
++ h->db->set_pagesize(h->db, pagesize);
+ }
+
+ ret = h->db->open(h->db, NULL, path, folder, DB_BTREE, createflags, 0600);
@@ -875,7 +878,7 @@ diff -Nru a/hcache.c b/hcache.c
+
+ mutt_hcache_dbt_empty_init(&data);
+ data.flags = DB_DBT_USERMEM;
-+ data.data = mutt_hcache_dump(db, header, (signed int *) &data.size, uid_validity);
++ data.data = mutt_hcache_dump(db, header, (signed int *) &data.size, uid_validity);
+ data.ulen = data.size;
+
+ ret = h->db->put(h->db, NULL, &key, &data, 0);
@@ -902,8 +905,8 @@ diff -Nru a/hcache.c b/hcache.c
+}
+#endif
diff -Nru a/imap/imap.c b/imap/imap.c
---- a/imap/imap.c 2004-08-18 10:08:12 +02:00
-+++ b/imap/imap.c 2004-08-18 10:08:12 +02:00
+--- a/imap/imap.c 2004-08-18 09:43:27 +02:00
++++ b/imap/imap.c 2004-08-17 00:34:10 +02:00
@@ -602,6 +602,17 @@
if ((pc = imap_get_flags (&(idata->flags), pc)) == NULL)
goto fail;
@@ -923,8 +926,8 @@ diff -Nru a/imap/imap.c b/imap/imap.c
{
pc = imap_next_word (pc);
diff -Nru a/imap/imap_private.h b/imap/imap_private.h
---- a/imap/imap_private.h 2004-08-18 10:08:12 +02:00
-+++ b/imap/imap_private.h 2004-08-18 10:08:12 +02:00
+--- a/imap/imap_private.h 2004-08-18 09:43:27 +02:00
++++ b/imap/imap_private.h 2004-07-24 12:39:31 +02:00
@@ -179,6 +179,9 @@
unsigned int newMailCount;
IMAP_CACHE cache[IMAP_CACHE_LEN];
@@ -936,8 +939,8 @@ diff -Nru a/imap/imap_private.h b/imap/imap_private.h
/* all folder flags - system flags AND keywords */
LIST *flags;
diff -Nru a/imap/message.c b/imap/message.c
---- a/imap/message.c 2004-08-18 10:08:12 +02:00
-+++ b/imap/message.c 2004-08-18 10:08:12 +02:00
+--- a/imap/message.c 2004-08-18 09:43:27 +02:00
++++ b/imap/message.c 2004-08-06 02:09:41 +02:00
@@ -39,6 +39,12 @@
static int msg_parse_fetch (IMAP_HEADER* h, char* s);
static char* msg_parse_flags (IMAP_HEADER* h, char* s);
@@ -1192,9 +1195,9 @@ diff -Nru a/imap/message.c b/imap/message.c
/* msg_has_flag: do a caseless comparison of the flag against a flag list,
* return 1 if found or flag list has '\*', 0 otherwise */
diff -Nru a/init.h b/init.h
---- a/init.h 2004-08-18 10:08:12 +02:00
-+++ b/init.h 2004-08-18 10:08:12 +02:00
-@@ -981,6 +981,30 @@
+--- a/init.h 2004-08-18 09:43:12 +02:00
++++ b/init.h 2004-08-26 22:32:53 +02:00
+@@ -981,6 +981,31 @@
** \fBDON'T CHANGE THIS SETTING UNLESS YOU ARE REALLY SURE WHAT YOU ARE
** DOING!\fP
*/
@@ -1213,21 +1216,22 @@ diff -Nru a/init.h b/init.h
+ ** files when the header cache is in use. This incurs one stat(2) per
+ ** message every time the folder is opened.
+ */
-+ { "header_cache_pagesize", DT_NUM, R_NONE, UL &HeaderCachePageSize, 16384 },
++ { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" },
+ /*
+ ** .pp
+ ** Change the maildir header cache database page size. Too large
+ ** or too small of a page size for the common header can waste
-+ ** space, memory effectiveness, or CPU time. You can use the
-+ ** db_dump utility to determine the optimal page size.
++ ** space, memory effectiveness, or CPU time. The default should be more or
++ ** less the best you can get. For details google after mutt maildir header
++ ** cache (first hit).
+ */
+#endif /* USE_HCACHE */
{ "maildir_trash", DT_BOOL, R_NONE, OPTMAILDIRTRASH, 0 },
/*
** .pp
diff -Nru a/main.c b/main.c
---- a/main.c 2004-08-18 10:08:12 +02:00
-+++ b/main.c 2004-08-18 10:08:12 +02:00
+--- a/main.c 2004-08-18 09:43:12 +02:00
++++ b/main.c 2004-07-24 12:39:30 +02:00
@@ -411,6 +411,12 @@
"-HAVE_GETADDRINFO "
#endif
@@ -1242,8 +1246,8 @@ diff -Nru a/main.c b/main.c
#ifdef ISPELL
diff -Nru a/mh.c b/mh.c
---- a/mh.c 2004-08-18 10:08:12 +02:00
-+++ b/mh.c 2004-08-18 10:08:12 +02:00
+--- a/mh.c 2004-08-18 09:43:13 +02:00
++++ b/mh.c 2004-07-26 09:37:28 +02:00
@@ -779,11 +779,68 @@
return r;
}
@@ -1397,8 +1401,8 @@ diff -Nru a/mh.c b/mh.c
static char *maildir_canon_filename (char *dest, const char *src, size_t l)
diff -Nru a/mutt.h b/mutt.h
---- a/mutt.h 2004-08-18 10:08:12 +02:00
-+++ b/mutt.h 2004-08-18 10:08:12 +02:00
+--- a/mutt.h 2004-08-18 09:43:13 +02:00
++++ b/mutt.h 2004-07-24 12:39:30 +02:00
@@ -345,6 +345,9 @@
OPTFORCENAME,
OPTFORWDECODE,
@@ -1410,8 +1414,8 @@ diff -Nru a/mutt.h b/mutt.h
OPTHEADER,
OPTHELP,
diff -Nru a/protos.h b/protos.h
---- a/protos.h 2004-08-18 10:08:12 +02:00
-+++ b/protos.h 2004-08-18 10:08:12 +02:00
+--- a/protos.h 2004-08-18 09:43:16 +02:00
++++ b/protos.h 2004-08-09 08:05:48 +02:00
@@ -99,6 +99,16 @@
ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short, short);
HEADER *mutt_dup_header (HEADER *);
@@ -1429,7 +1433,3 @@ diff -Nru a/protos.h b/protos.h
ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *, int, int);
time_t mutt_decrease_mtime (const char *, struct stat *);
---- PATCHES.orig Tue Nov 6 19:59:33 2001
-+++ PATCHES Tue Nov 6 19:59:42 2001
-@@ -1,0 +1 @@
-+patch-1.5.6.tg.hcache.0
diff --git a/mail/mutt-devel/files/patch-doc-manual.sgml.head b/mail/mutt-devel/files/patch-doc-manual.sgml.head
new file mode 100644
index 000000000000..b178a5b8dd29
--- /dev/null
+++ b/mail/mutt-devel/files/patch-doc-manual.sgml.head
@@ -0,0 +1,111 @@
+--- doc/manual.sgml.head.orig Sun Feb 1 18:49:53 2004
++++ doc/manual.sgml.head Wed Aug 25 14:02:33 2004
+@@ -125,24 +125,24 @@
+ <tscreen><verb>
+ ^A or <Home> bol move to the start of the line
+ ^B or <Left> backward-char move back one char
+-Esc B backward-word move back one word
++Esc B backward-word move back one word
+ ^D or <Delete> delete-char delete the char under the cursor
+ ^E or <End> eol move to the end of the line
+ ^F or <Right> forward-char move forward one char
+-Esc F forward-word move forward one word
++Esc F forward-word move forward one word
+ <Tab> complete complete filename or alias
+ ^T complete-query complete address with query
+ ^K kill-eol delete to the end of the line
+-ESC d kill-eow delete to the end ot the word
++ESC d kill-eow delete to the end ot the word
+ ^W kill-word kill the word in front of the cursor
+ ^U kill-line delete entire line
+ ^V quote-char quote the next typed key
+ <Up> history-up recall previous string from history
+ <Down> history-down recall next string from history
+ <BackSpace> backspace kill the char in front of the cursor
+-Esc u upcase-word convert word to upper case
+-Esc l downcase-word convert word to lower case
+-Esc c capitalize-word capitalize the word
++Esc u upcase-word convert word to upper case
++Esc l downcase-word convert word to lower case
++Esc c capitalize-word capitalize the word
+ ^G n/a abort
+ <Return> n/a finish editing
+ </verb></tscreen>
+@@ -325,8 +325,8 @@
+ ESC p previous-subthread jump to the start of the previous subthread
+ ESC r read-subthread mark the current subthread as read
+ ESC t tag-thread toggle the tag on the current thread
+-ESC v collapse-thread toggle collapse for the current thread
+-ESC V collapse-all toggle collapse for all threads
++ESC v collapse-thread toggle collapse for the current thread
++ESC V collapse-all toggle collapse for all threads
+ P parent-message jump to parent message in thread
+ </verb></tscreen>
+
+@@ -513,7 +513,7 @@
+
+ <tscreen><verb>
+ a attach-file attach a file
+-A attach-message attach message(s) to the message
++A attach-message attach message(s) to the message
+ ESC k attach-key attach a PGP public key
+ d edit-description edit description on attachment
+ D detach-file detach a file
+@@ -529,7 +529,7 @@
+ p pgp-menu select PGP options
+ P postpone-message postpone this message until later
+ q quit quit (abort) sending the message
+-w write-fcc write the message to a folder
++w write-fcc write the message to a folder
+ i ispell check spelling (if available on your system)
+ ^F forget-passphrase wipe passphrase(s) from memory
+ </verb></tscreen>
+@@ -1760,7 +1760,7 @@
+ ~g cryptographically signed messages
+ ~G cryptographically encrypted messages
+ ~h EXPR messages which contain EXPR in the message header
+-~k message contains PGP key material
++~k message contains PGP key material
+ ~i ID message which match ID in the ``Message-ID'' field
+ ~L EXPR message is either originated or received by EXPR
+ ~l message is addressed to a known mailing list
+@@ -1778,12 +1778,12 @@
+ ~T tagged messages
+ ~t USER messages addressed to USER
+ ~U unread messages
+-~v message is part of a collapsed thread.
+-~V cryptographically verified messages
++~v message is part of a collapsed thread.
++~V cryptographically verified messages
+ ~x EXPR messages which contain EXPR in the `References' field
+ ~y EXPR messages which contain EXPR in the `X-Label' field
+ ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
+-~= duplicated messages (see $duplicate_threads)
++~= duplicated messages (see $duplicate_threads)
+ </verb></tscreen>
+
+ Where EXPR, USER, ID, and SUBJECT are
+@@ -1885,10 +1885,10 @@
+ An error margin is a sign (+ or -), followed by a digit, followed by
+ one of the following units:
+ <verb>
+-y years
+-m months
+-w weeks
+-d days
++y years
++m months
++w weeks
++d days
+ </verb>
+ As a special case, you can replace the sign by a ``*'' character,
+ which is equivalent to giving identical plus and minus error margins.
+@@ -2919,7 +2919,7 @@
+ to send messages from the command line as well.
+
+ <tscreen><verb>
+--A expand an alias
++-A expand an alias
+ -a attach a file to a message
+ -b specify a blind carbon-copy (BCC) address
+ -c specify a carbon-copy (Cc) address
diff --git a/mail/mutt-devel/files/patch-threadcomplete b/mail/mutt-devel/files/patch-threadcomplete
index 2a226146b108..b78ee975d893 100644
--- a/mail/mutt-devel/files/patch-threadcomplete
+++ b/mail/mutt-devel/files/patch-threadcomplete
@@ -1,18 +1,33 @@
-written by Nicolas Rachinsky <nr@rachinsky.de>
-http://www.rachinsky.de
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published
-by the Free Software Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
---- mutt-1.3.28.ori/mutt.h Thu Mar 14 19:22:25 2002
-+++ mutt.h Fri Mar 15 00:22:41 2002
-@@ -198,6 +198,7 @@
+diff -Nru a/PATCHES b/PATCHES
+--- PATCHES 2004-07-24 12:27:17 +02:00
++++ PATCHES 2004-08-22 02:01:52 +02:00
+@@ -0,0 +1 @@
++patch-1.5.6.cb.thread_pattern.1
+diff -Nru a/doc/manual.sgml.head b/doc/manual.sgml.head
+--- doc/manual.sgml.head 2004-07-24 12:27:29 +02:00
++++ doc/manual.sgml.head 2004-08-25 14:54:08 +02:00
+@@ -1771,6 +1771,8 @@
+ messages:
+
+ <tscreen><verb>
++~a messages in threads that contain at least one tagged message;
++ this is the same as ~(~T) [see below for ~(..)]
+ ~A all messages
+ ~b EXPR messages which contain EXPR in the message body
+ ~B EXPR messages which contain EXPR in the whole message
+@@ -1809,6 +1811,8 @@
+ ~y EXPR messages which contain EXPR in the `X-Label' field
+ ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
+ ~= duplicated messages (see $duplicate_threads)
++~(PATTERN) messages in threads containing messages matching a certain
++ pattern, e.g. all threads containing messages from you: ~(~P)
+ </verb></tscreen>
+
+ Where EXPR, USER, ID, and SUBJECT are
+diff -Nru a/mutt.h b/mutt.h
+--- mutt.h 2004-07-24 12:27:21 +02:00
++++ mutt.h 2004-08-25 14:04:40 +02:00
+@@ -207,10 +207,12 @@
M_LIMIT,
M_EXPIRED,
M_SUPERSEDED,
@@ -20,8 +35,14 @@ General Public License for more details.
/* actions for mutt_pattern_comp/mutt_pattern_exec */
M_AND,
---- pattern.c.orig Fri Jul 11 09:19:06 2003
-+++ pattern.c Fri Jul 11 09:23:17 2003
+ M_OR,
++ M_THREAD,
+ M_TO,
+ M_CC,
+ M_COLLAPSED,
+diff -Nru a/pattern.c b/pattern.c
+--- pattern.c 2004-07-24 12:27:23 +02:00
++++ pattern.c 2004-08-25 15:37:51 +02:00
@@ -44,6 +44,7 @@
}
Flags[] =
@@ -30,44 +51,109 @@ General Public License for more details.
{ 'A', M_ALL, 0, NULL },
{ 'b', M_BODY, M_FULL_MSG, eat_regexp },
{ 'B', M_WHOLE_MSG, M_FULL_MSG, eat_regexp },
-@@ -946,6 +947,27 @@
+@@ -700,7 +701,7 @@
+ pattern_t *mutt_pattern_comp (/* const */ char *s, int flags, BUFFER *err)
+ {
+ pattern_t *curlist = NULL;
+- pattern_t *tmp;
++ pattern_t *tmp, *tmp2;
+ pattern_t *last = NULL;
+ int not = 0;
+ int alladdr = 0;
+@@ -755,6 +756,39 @@
+ alladdr = 0;
+ break;
+ case '~':
++ if (*(ps.dptr + 1) == '(') {
++ ps.dptr ++; /* skip ~ */
++ p = find_matching_paren (ps.dptr + 1);
++ if (*p != ')')
++ {
++ snprintf (err->data, err->dsize, _("mismatched brackets: %s"), ps.dptr);
++ mutt_pattern_free (&curlist);
++ return NULL;
++ }
++ tmp = new_pattern ();
++ tmp->op = M_THREAD;
++ if (last)
++ last->next = tmp;
++ else
++ curlist = tmp;
++ last = tmp;
++ tmp->not ^= not;
++ tmp->alladdr |= alladdr;
++ not = 0;
++ alladdr = 0;
++ /* compile the sub-expression */
++ buf = mutt_substrdup (ps.dptr + 1, p);
++ if ((tmp2 = mutt_pattern_comp (buf, flags, err)) == NULL)
++ {
++ FREE (&buf);
++ mutt_pattern_free (&curlist);
++ return NULL;
++ }
++ FREE (&buf);
++ tmp->child = tmp2;
++ ps.dptr = p + 1; /* restore location */
++ break;
++ }
+ if (implicit && or)
+ {
+ /* A | B & C == (A | B) & C */
+@@ -945,6 +979,30 @@
return alladdr;
}
-+static int match_threadcomplete(int flag,THREAD *t,int left,int up,int right,int down)
++static int match_threadcomplete(struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx, THREAD *t,int left,int up,int right,int down)
+{
-+ int a=0;
-+ HEADER *h=NULL;
++ int a;
++ HEADER *h;
+
-+ if(! t)return 0;
-+ h=t->message;
-+ if(! flag && h && h->tagged)return 1;
-+ if(flag && h && ! h->tagged) return 1;
++ if(!t)
++ return 0;
++ h = t->message;
++ if(!h)
++ return 0;
++ if(mutt_pattern_exec(pat, flags, ctx, h))
++ return 1;
+
-+ if(up)a=match_threadcomplete(flag,t->parent,1,1,1,0);
-+ if(a)return a;
-+ if(right && t->parent)a=match_threadcomplete(flag,t->next,0,0,1,1);
-+ if(a)return a;
-+ if(left && t->parent)a=match_threadcomplete(flag,t->prev,1,0,0,1);
-+ if(a)return a;
-+ if(down)a=match_threadcomplete(flag,t->child,1,0,1,1);
-+ if(a)return a;
-+ return 0;
++ if(up && (a=match_threadcomplete(pat, flags, ctx, t->parent,1,1,1,0)))
++ return a;
++ if(right && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->next,0,0,1,1)))
++ return a;
++ if(left && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->prev,1,0,0,1)))
++ return a;
++ if(down && (a=match_threadcomplete(pat, flags, ctx, t->child,1,0,1,1)))
++ return a;
++ return 0;
+}
+
/* flags
M_MATCH_FULL_ADDRESS match both personal and machine address */
int
-@@ -1024,6 +1046,8 @@
+@@ -958,6 +1016,8 @@
+ return (pat->not ^ (perform_and (pat->child, flags, ctx, h) > 0));
+ case M_OR:
+ return (pat->not ^ (perform_or (pat->child, flags, ctx, h) > 0));
++ case M_THREAD:
++ return (pat->not ^ match_threadcomplete(pat->child, flags, ctx, h->thread, 1, 1, 1, 1));
+ case M_ALL:
+ return (!pat->not);
+ case M_EXPIRED:
+@@ -1023,6 +1083,16 @@
pat->alladdr, 2, h->env->to, h->env->cc));
case M_LIST:
return (pat->not ^ mutt_is_list_recipient (pat->alladdr, h->env->to, h->env->cc));
+ case M_THREADCOMPLETE:
-+ return ((h->thread && match_threadcomplete(pat->not,h->thread,1,1,1,1)));
++ { static pattern_t tmp;
++ static short pattern_set = 0;
++ if(! pattern_set) {
++ memset (&tmp, 0, sizeof (tmp));
++ tmp.op = M_TAG;
++ pattern_set = 1;
++ }
++ return (pat->not ^ match_threadcomplete(&tmp, flags, ctx, h->thread, 1, 1, 1, 1));
++ }
case M_PERSONAL_RECIP:
return (pat->not ^ match_user (pat->alladdr, h->env->to, h->env->cc));
case M_PERSONAL_FROM:
---- PATCHES~ Tue Nov 6 19:59:33 2001
-+++ PATCHES Tue Nov 6 19:59:42 2001
-@@ -1,0 +1 @@
-+1.3.28.nr.threadcomplete