]> git.pld-linux.org Git - packages/mutt.git/blame - mutt-bj.status-time.patch
- cleanup, flea.1 manpage unlikely to come back, don't bother keeping it here
[packages/mutt.git] / mutt-bj.status-time.patch
CommitLineData
68eeb855 1diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/curs_main.c mutt-1.5.10/curs_main.c
d47c1371 2--- mutt-1.5.20.b/curs_main.c 2009-07-14 12:34:25.000000000 +0200
3+++ mutt-1.5.20/curs_main.c 2009-07-14 12:42:41.000000000 +0200
4@@ -556,7 +556,7 @@
c3bf9ee0
AG
5 menu_redraw_current (menu);
6 }
6f7ac9b9 7
c3bf9ee0
AG
8- if (menu->redraw & REDRAW_STATUS)
9+ if (menu->redraw & REDRAW_STATUS || update_status_time ())
10 {
11 menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
12 mutt_window_move (MuttStatusWindow, 0, 0);
91acbdc1
JB
13--- mutt-1.5.18/globals.h.orig 2008-01-30 05:26:50.000000000 +0100
14+++ mutt-1.5.18/globals.h 2008-07-25 17:41:02.532746787 +0200
15@@ -200,6 +200,7 @@
16 WHERE short SaveHist;
6f7ac9b9 17 WHERE short SendmailWait;
18 WHERE short SleepTime INITVAL (1);
19+WHERE short StatusUpdate;
91acbdc1 20 WHERE short TimeInc;
6f7ac9b9 21 WHERE short Timeout;
91acbdc1 22 WHERE short Wrap;
8d013520
PZ
23--- mutt-2.0.6/init.h.orig 2021-03-06 19:06:37.000000000 +0000
24+++ mutt-2.0.6/init.h 2021-04-07 17:25:21.720777040 +0000
25@@ -4197,6 +4197,8 @@
6f7ac9b9 26 ** .dt %u .dd number of unread messages *
27 ** .dt %v .dd Mutt version string
28 ** .dt %V .dd currently active limit pattern, if any *
29+ ** .dt %[fmt] .dd the current date and time. ``fmt'' is
30+ ** expanded by the system call ``strftime'';
bebcbf73
AG
31 ** .dt %>X .dd right justify the rest of the string and pad with ``X''
32 ** .dt %|X .dd pad to the end of the line with ``X''
33 ** .dt %*X .dd soft-fill with character ``X'' as pad
8d013520
PZ
34@@ -4248,6 +4250,16 @@
35 ** the first line of the screen rather than near the bottom. If $$help
36 ** is \fIset\fP, too it'll be placed at the bottom.
6f7ac9b9 37 */
8d013520 38+ { "status_update", DT_NUM, R_NONE, {.p=&StatusUpdate}, {.l=-1} },
6f7ac9b9 39+ /*
40+ ** .pp
41+ ** This variable controls, if positive, the maximum interval in seconds
42+ ** before the time in the status line is updated. It is checked at
43+ ** every key press and after a keyboard $$timeout.
44+ ** If the value is zero, the status line will be updated at every check.
45+ ** If it is negative, the status time will only be updated
46+ ** if it necessary to update to the status line for some other reason.
47+ */
8d013520 48 { "strict_threads", DT_BOOL, R_RESORT|R_RESORT_INIT|R_INDEX, {.l=OPTSTRICTTHREADS}, {.l=0} },
6f7ac9b9 49 /*
50 ** .pp
68eeb855 51diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/menu.c mutt-1.5.10/menu.c
52--- mutt-1.5.10.orig/menu.c 2005-06-12 20:32:46.000000000 +0200
53+++ mutt-1.5.10/menu.c 2005-10-07 09:28:24.000000000 +0200
54@@ -1087,3 +1087,23 @@
6f7ac9b9 55 }
56 /* not reached */
57 }
58+
59+int update_status_time ()
60+{
61+ static time_t Last;
62+ time_t now;
63+
64+ if (StatusUpdate < 0)
65+ return 0;
66+ else if (StatusUpdate == 0)
67+ return 1;
68+
69+ now = time (NULL);
70+ if (now - Last >= StatusUpdate)
71+ {
72+ Last = now;
73+ return 1;
74+ }
75+ else
76+ return 0;
77+}
68eeb855 78diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/mutt_menu.h mutt-1.5.10/mutt_menu.h
79--- mutt-1.5.10.orig/mutt_menu.h 2005-08-11 21:37:02.000000000 +0200
80+++ mutt-1.5.10/mutt_menu.h 2005-10-07 09:28:59.000000000 +0200
81@@ -112,4 +112,5 @@
6f7ac9b9 82 void index_make_entry (char *, size_t, struct menu_t *, int);
83 int index_color (int);
68eeb855 84
6f7ac9b9 85+int update_status_time (void);
68eeb855 86 #endif /* _MUTT_MENU_H_ */
87diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/pager.c mutt-1.5.10/pager.c
88--- mutt-1.5.10.orig/pager.c 2005-08-11 21:37:02.000000000 +0200
89+++ mutt-1.5.10/pager.c 2005-10-07 09:28:24.000000000 +0200
90@@ -1763,7 +1763,7 @@
6f7ac9b9 91 }
c3bf9ee0 92 }
6f7ac9b9 93
c3bf9ee0 94- if ((pager_menu->redraw & REDRAW_INDEX) && rd->index)
3ef07388 95+ if (( (pager_menu->redraw & REDRAW_INDEX) || update_status_time()) && rd->index)
c3bf9ee0
AG
96 {
97 /* redraw the pager_index indicator, because the
98 * flags for this message might have changed. */
68eeb855 99diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/status.c mutt-1.5.10/status.c
100--- mutt-1.5.10.orig/status.c 2005-10-07 09:28:10.000000000 +0200
101+++ mutt-1.5.10/status.c 2005-10-07 09:28:24.000000000 +0200
9c1df5d5 102@@ -303,6 +304,47 @@
6f7ac9b9 103 *buf = 0;
104 return (src);
105
106+ case '[':
107+ {
6f7ac9b9 108+ int len = sizeof (fmt) - 1;
109+
110+ cp = fmt;
111+ if (*src == '!')
112+ {
6f7ac9b9 113+ src++;
114+ }
6f7ac9b9 115+
116+ while (len > 0 && *src != ']')
117+ {
118+ if (*src == '%')
119+ {
120+ src++;
121+ if (len >= 2)
122+ {
123+ *cp++ = '%';
124+ *cp++ = *src;
125+ len -= 2;
126+ }
127+ else
128+ break; /* not enough space */
129+ src++;
130+ }
131+ else
132+ {
133+ *cp++ = *src++;
134+ len--;
135+ }
136+ }
137+ *cp = 0;
138+ src++;
9c1df5d5
AG
139+ time_t now = time (NULL);
140+ strftime (tmp, sizeof (tmp), fmt, localtime (&now));
6f7ac9b9 141+
142+ snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
143+ snprintf (buf, buflen, fmt, tmp);
144+ }
145+ break;
146+
147 default:
148 snprintf (buf, buflen, "%%%s%c", prefix, op);
149 break;
This page took 0.048143 seconds and 4 git commands to generate.