2 This is the maildir mtime patch by Dale Woolridge.
4 The home page for this patch is:
6 http://www.mutt.ca/maildir-mtime.html
8 * Patch last synced with upstream:
10 - File: http://www.mutt.ca/patches/patch-1.5.6.dw.maildir-mtime.1
13 - removed a spurious const in add_folder() definition.
14 - added a $maildir_mtime option to allow this patch to be disabled at
15 runtime (see Bug#253261, comments from Zephaniah E. Hull).
18 --- maildir-mtime/PATCHES Dec 2002 17:44:54 -0000 3.6
19 +++ maildir-mtime/PATCHES Feb 2004 13:19:42 -0000
21 +patch-1.5.6.dw.maildir-mtime.1
22 --- maildir-mtime/browser.c Sep 2003 13:03:25 -0000 3.9
23 +++ maildir-mtime/browser.c Feb 2004 13:19:42 -0000
28 @@ -304,4 +305,6 @@ folder_format_str (char *dest, size_t de
29 static void add_folder (MUTTMENU *m, struct browser_state *state,
30 - const char *name, const struct stat *s, int new)
31 + const char *name, /*DEB const IAN*/ struct stat *s, BUFFY *mbuf)
33 + int new = (mbuf) ? mbuf->new : 0;
35 if (state->entrylen == state->entrymax)
36 @@ -317,2 +320,5 @@ static void add_folder (MUTTMENU *m, str
38 + if (mbuf && mbuf->magic == M_MAILDIR && mbuf->mtime)
39 + s->st_mtime = mbuf->mtime;
42 @@ -411,3 +417,3 @@ static int examine_directory (MUTTMENU *
44 - add_folder (menu, state, de->d_name, &s, (tmp) ? tmp->new : 0);
45 + add_folder (menu, state, de->d_name, &s, tmp);
47 @@ -435,3 +441,3 @@ static int examine_mailboxes (MUTTMENU *
49 - add_folder (menu, state, tmp->path, NULL, tmp->new);
50 + add_folder (menu, state, tmp->path, NULL, tmp);
52 @@ -442,3 +448,3 @@ static int examine_mailboxes (MUTTMENU *
54 - add_folder (menu, state, tmp->path, NULL, tmp->new);
55 + add_folder (menu, state, tmp->path, NULL, tmp);
57 @@ -456,3 +462,3 @@ static int examine_mailboxes (MUTTMENU *
59 - add_folder (menu, state, buffer, &s, tmp->new);
60 + add_folder (menu, state, buffer, &s, tmp);
62 --- maildir-mtime/buffy.c Feb 2004 17:50:43 -0000 3.9
63 +++ maildir-mtime/buffy.c Feb 2004 13:19:42 -0000
64 @@ -229,2 +229,3 @@ int mutt_parse_mailboxes (BUFFER *path,
65 (*tmp)->newly_created = 0;
68 @@ -260,2 +261,3 @@ int mutt_buffy_check (int force)
72 @@ -299,2 +301,3 @@ int mutt_buffy_check (int force)
76 @@ -383,6 +386,13 @@ int mutt_buffy_check (int force)
78 - /* one new and undeleted message is enough */
84 + /* one new and undeleted message is enough */
88 + snprintf (path, sizeof (path), "%s/new/%s", tmp->path, de->d_name);
89 + if (!stat (path, &smd) && smd.st_mtime > tmp->mtime)
91 + tmp->mtime = smd.st_mtime;
94 --- maildir-mtime/buffy.h Dec 2002 11:19:39 -0000 3.2
95 +++ maildir-mtime/buffy.h Feb 2004 13:19:42 -0000
96 @@ -29,2 +29,3 @@ typedef struct buffy_t
98 + time_t mtime; /* for maildirs...time of newest entry */
99 short new; /* mailbox has new mail */
101 +++ DEBIAN/buffy.c.new
103 /* one new and undeleted message is enough */
107 + if (! option (OPTMAILDIRMTIME)) /* prevent stat calls */
110 snprintf (path, sizeof (path), "%s/new/%s", tmp->path, de->d_name);
111 if (!stat (path, &smd) && smd.st_mtime > tmp->mtime)
113 +++ DEBIAN/init.h.new
114 @@ -1022,6 +1022,16 @@
115 ** \fBDON'T CHANGE THIS SETTING UNLESS YOU ARE REALLY SURE WHAT YOU ARE
118 + { "maildir_mtime", DT_BOOL, R_NONE, OPTMAILDIRMTIME, 0 },
121 + ** If set, the sort-by-date option in the browser will sort maildirs
122 + ** smartly, not using the mtime of the maildir itself but that of the
123 + ** newest message in the new subdirectory, making the sorting by
124 + ** reverse date much more useful. People with maildirs over NFS may
125 + ** wish to leave this option unset.
130 { "header_cache", DT_PATH, R_NONE, UL &HeaderCache, 0 },
132 +++ DEBIAN/mutt.h.new