]> git.pld-linux.org Git - packages/mutt.git/blame - patch-0.95.4.bj.status-time.1
1.3.17i
[packages/mutt.git] / patch-0.95.4.bj.status-time.1
CommitLineData
7e5fb030 1diff -udpr -X diff-excludes mutt-0.95.4-orig/curs_main.c mutt-0.95.4/curs_main.c
2--- mutt-0.95.4-orig/curs_main.c Thu Mar 4 08:16:48 1999
3+++ mutt-0.95.4/curs_main.c Sun Mar 14 09:21:51 1999
4@@ -483,7 +483,8 @@ int mutt_index_menu (void)
5 menu_redraw_current (menu);
6 }
7
8- if (menu->redraw & REDRAW_STATUS)
9+ if ((menu->redraw & REDRAW_STATUS) ||
10+ update_status_time ())
11 {
12 menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
13 CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
14diff -Nru mutt-1.1.11/doc/manual.sgml mutt-1.1.11.status_update/doc/manual.sgml
15--- mutt-1.1.11/doc/manual.sgml Sun Apr 2 23:17:35 2000
16+++ mutt-1.1.11.status_update/doc/manual.sgml Sun Apr 2 23:17:27 2000
17@@ -5395,6 +5395,8 @@
18 %u number of unread messages *
19 %v Mutt version string
20 %V currently active limit pattern, if any *
21+%[fmt] the current date and time. `fmt'' is expanded by the system
22+ call ``strftime''; a leading bang disables locales
23 %>X right justify the rest of the string and
24 pad with "X"
25 %|X pad to the end of the line with "X"
26@@ -5441,6 +5443,17 @@
27 Setting this variable causes the ``status bar'' to be displayed on
28 the first line of the screen rather than near the bottom.
29
30+<sect2>status&lowbar;update<label id="status_update">
31+<p>
32+Type: number<newline>
33+Default: -1
34+
35+This variable controls, if positive, the maximum interval in seconds
36+before the time in the status line is updated. It is checked at
37+every key press, and after a keyboard <ref id="timeout"
38+name="timeout">. If the value is zero, the status line will updated
39+at every check. If it is negative, the status time will only be updated
40+if it necessary to update to the status line for some other reason.
41
42 <sect2>strict&lowbar;threads<label id="strict_threads">
43 <p>
44diff -Nru mutt-1.1.11/init.h mutt-1.1.11.status_update/init.h
45--- mutt-1.1.11/init.h Sun Apr 2 23:17:35 2000
46+++ mutt-1.1.11.status_update/init.h Sun Apr 2 23:17:25 2000
47@@ -1963,6 +1963,7 @@
48 ** Setting this variable causes the ``$status bar'' to be displayed on
49 ** the first line of the screen rather than near the bottom.
50 */
51+ { "status_update", DT_NUM, R_NONE, UL &StatusUpdate, -1 },
52 { "strict_threads", DT_BOOL, R_RESORT|R_INDEX, OPTSTRICTTHREADS, 0 },
53 /*
54 ** .pp
55diff -udpr -X diff-excludes mutt-0.95.4-orig/globals.h mutt-0.95.4/globals.h
56--- mutt-0.95.4-orig/globals.h Thu Jan 7 10:14:40 1999
57+++ mutt-0.95.4/globals.h Sun Mar 14 09:21:51 1999
58@@ -107,6 +107,7 @@ WHERE short PagerIndexLines;
59 WHERE short PopPort;
60 WHERE short ReadInc;
61 WHERE short SendmailWait;
62+WHERE short StatusUpdate;
63 WHERE short Timeout;
64 WHERE short WriteInc;
65
66diff -udpr -X diff-excludes mutt-0.95.4-orig/menu.c mutt-0.95.4/menu.c
67--- mutt-0.95.4-orig/menu.c Thu Jan 7 10:14:42 1999
68+++ mutt-0.95.4/menu.c Sun Mar 14 09:21:51 1999
69@@ -840,3 +840,23 @@ int mutt_menuLoop (MUTTMENU *menu)
70 }
71 /* not reached */
72 }
73+
74+int update_status_time ()
75+{
76+ static time_t Last;
77+ time_t now;
78+
79+ if (StatusUpdate < 0)
80+ return 0;
81+ else if (StatusUpdate == 0)
82+ return 1;
83+
84+ now = time (NULL);
85+ if (now - Last >= StatusUpdate)
86+ {
87+ Last = now;
88+ return 1;
89+ }
90+ else
91+ return 0;
92+}
93diff -udpr -X diff-excludes mutt-0.95.4-orig/mutt_menu.h mutt-0.95.4/mutt_menu.h
94--- mutt-0.95.4-orig/mutt_menu.h Thu Jan 7 10:14:43 1999
95+++ mutt-0.95.4/mutt_menu.h Sun Mar 14 09:21:51 1999
96@@ -98,3 +98,5 @@ int mutt_menuLoop (MUTTMENU *);
97 /* used in both the index and pager index to make an entry. */
98 void index_make_entry (char *, size_t, struct menu_t *, int);
99 int index_color (int);
100+
101+int update_status_time (void);
102diff -udpr -X diff-excludes mutt-0.95.4-orig/pager.c mutt-0.95.4/pager.c
103--- mutt-0.95.4-orig/pager.c Thu Jan 7 10:14:44 1999
104+++ mutt-0.95.4/pager.c Sun Mar 14 09:21:51 1999
105@@ -1636,7 +1636,7 @@ mutt_pager (const char *banner, const ch
106 SETCOLOR (MT_COLOR_NORMAL);
107 }
108
109- if ((redraw & REDRAW_INDEX) && index)
110+ if (index && ((redraw & REDRAW_INDEX) || update_status_time ()))
111 {
112 /* redraw the pager_index indicator, because the
113 * flags for this message might have changed. */
114diff -udpr -X diff-excludes mutt-0.95.4-orig/status.c mutt-0.95.4/status.c
115--- mutt-0.95.4-orig/status.c Thu Jan 7 10:14:47 1999
116+++ mutt-0.95.4/status.c Sun Mar 14 09:21:59 1999
117@@ -25,6 +25,7 @@
118 #include <string.h>
119 #include <ctype.h>
120 #include <unistd.h>
121+#include <locale.h>
122
123 static char *get_sort_str (char *buf, size_t buflen, int method)
124 {
125@@ -269,6 +270,61 @@ status_format_str (char *buf, size_t buf
126 case 0:
127 *buf = 0;
128 return (src);
129+
130+ case '[':
131+ {
132+ int do_locales;
133+ int len = sizeof (fmt) - 1;
134+
135+ cp = fmt;
136+ if (*src == '!')
137+ {
138+ do_locales = 0;
139+ src++;
140+ }
141+ else
142+ do_locales = 1;
143+
144+ while (len > 0 && *src != ']')
145+ {
146+ if (*src == '%')
147+ {
148+ src++;
149+ if (len >= 2)
150+ {
151+ *cp++ = '%';
152+ *cp++ = *src;
153+ len -= 2;
154+ }
155+ else
156+ break; /* not enough space */
157+ src++;
158+ }
159+ else
160+ {
161+ *cp++ = *src++;
162+ len--;
163+ }
164+ }
165+ *cp = 0;
166+ src++;
167+
168+ if (do_locales && Locale)
169+ setlocale (LC_TIME, Locale);
170+
171+ {
172+ time_t now = time (NULL);
173+
174+ strftime (tmp, sizeof (tmp), fmt, localtime (&now));
175+ }
176+
177+ if (do_locales && Locale)
178+ setlocale (LC_TIME, "C");
179+
180+ snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
181+ snprintf (buf, buflen, fmt, tmp);
182+ }
183+ break;
184
185 default:
186 snprintf (buf, buflen, "%%%s%c", prefix, op);
187--- mutt-0.94.7i/patchlist.c.orig Sat Sep 19 02:29:51 1998
188+++ mutt-0.94.7i/patchlist.c Sat Sep 19 02:54:16 1998
189@@ -16,6 +16,8 @@
190
191
192
193+ printf("Feature patch: status-time 0.95.4 by Byrial Jensen\n");
194+
195
196
197 /* DO NOT MODIFY AFTER THIS LINE */
This page took 0.113099 seconds and 4 git commands to generate.