1 diff -Nur mutt-1.3.25-2/curs_main.c mutt-1.3.25/curs_main.c
2 --- mutt-1.3.25-2/curs_main.c Tue Jan 22 00:06:44 2002
3 +++ mutt-1.3.25/curs_main.c Tue Jan 22 00:07:02 2002
5 menu_redraw_current (menu);
8 - if (menu->redraw & REDRAW_STATUS)
9 + if ((menu->redraw & REDRAW_STATUS) || update_status_time ())
11 menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
12 CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
13 diff -Nur mutt-1.3.25-2/globals.h mutt-1.3.25/globals.h
14 --- mutt-1.3.25-2/globals.h Tue Jan 22 00:06:44 2002
15 +++ mutt-1.3.25/globals.h Tue Jan 22 00:07:02 2002
18 WHERE short SendmailWait;
19 WHERE short SleepTime INITVAL (1);
20 +WHERE short StatusUpdate;
22 WHERE short WrapMargin;
24 diff -Nur mutt-1.3.25-2/init.h mutt-1.3.25/init.h
25 --- mutt-1.3.25-2/init.h Tue Jan 22 00:06:44 2002
26 +++ mutt-1.3.25/init.h Tue Jan 22 00:09:07 2002
28 ** .dt %u .dd number of unread messages *
29 ** .dt %v .dd Mutt version string
30 ** .dt %V .dd currently active limit pattern, if any *
31 + ** .dt %[fmt] .dd the current date and time. ``fmt'' is
32 + ** expanded by the system call ``strftime'';
33 + ** a leading bang disables locales
34 ** .dt %>X .dd right justify the rest of the string and pad with "X"
35 ** .dt %|X .dd pad to the end of the line with "X"
37 @@ -2160,6 +2163,16 @@
38 ** Setting this variable causes the ``status bar'' to be displayed on
39 ** the first line of the screen rather than near the bottom.
41 + { "status_update", DT_NUM, R_NONE, UL &StatusUpdate, -1 },
44 + ** This variable controls, if positive, the maximum interval in seconds
45 + ** before the time in the status line is updated. It is checked at
46 + ** every key press and after a keyboard $$timeout.
47 + ** If the value is zero, the status line will be updated at every check.
48 + ** If it is negative, the status time will only be updated
49 + ** if it necessary to update to the status line for some other reason.
51 { "strict_threads", DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, OPTSTRICTTHREADS, 0 },
54 diff -Nur mutt-1.3.25-2/menu.c mutt-1.3.25/menu.c
55 --- mutt-1.3.25-2/menu.c Tue Jan 22 00:06:44 2002
56 +++ mutt-1.3.25/menu.c Tue Jan 22 00:07:02 2002
57 @@ -1045,3 +1045,23 @@
62 +int update_status_time ()
67 + if (StatusUpdate < 0)
69 + else if (StatusUpdate == 0)
73 + if (now - Last >= StatusUpdate)
81 diff -Nur mutt-1.3.25-2/mutt_menu.h mutt-1.3.25/mutt_menu.h
82 --- mutt-1.3.25-2/mutt_menu.h Tue Jan 22 00:06:44 2002
83 +++ mutt-1.3.25/mutt_menu.h Tue Jan 22 00:07:02 2002
85 /* used in both the index and pager index to make an entry. */
86 void index_make_entry (char *, size_t, struct menu_t *, int);
87 int index_color (int);
89 +int update_status_time (void);
90 diff -Nur mutt-1.3.25-2/pager.c mutt-1.3.25/pager.c
91 --- mutt-1.3.25-2/pager.c Tue Jan 22 00:06:44 2002
92 +++ mutt-1.3.25/pager.c Tue Jan 22 00:07:02 2002
94 SETCOLOR (MT_COLOR_NORMAL);
97 - if ((redraw & REDRAW_INDEX) && index)
98 + if (index && ((redraw & REDRAW_INDEX) || update_status_time ()))
100 /* redraw the pager_index indicator, because the
101 * flags for this message might have changed. */
102 diff -Nur mutt-1.3.25-2/status.c mutt-1.3.25/status.c
103 --- mutt-1.3.25-2/status.c Tue Jan 22 00:06:44 2002
104 +++ mutt-1.3.25/status.c Tue Jan 22 00:07:02 2002
111 static char *get_sort_str (char *buf, size_t buflen, int method)
120 + int len = sizeof (fmt) - 1;
131 + while (len > 0 && *src != ']')
143 + break; /* not enough space */
155 + if (do_locales && Locale)
156 + setlocale (LC_TIME, Locale);
159 + time_t now = time (NULL);
161 + strftime (tmp, sizeof (tmp), fmt, localtime (&now));
164 + if (do_locales && Locale)
165 + setlocale (LC_TIME, "C");
167 + snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
168 + snprintf (buf, buflen, fmt, tmp);
173 snprintf (buf, buflen, "%%%s%c", prefix, op);