This repository was archived by the owner on Jan 25, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0002-feature-initials.patch
More file actions
291 lines (285 loc) · 7.97 KB
/
0002-feature-initials.patch
File metadata and controls
291 lines (285 loc) · 7.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
From 776a35c125abc1f115557c510025520becf8ae1f Mon Sep 17 00:00:00 2001
From: Vsevolod Volkov <vvv@mutt.org.ua>
Date: Sun, 31 Jan 2016 17:17:10 +0000
Subject: [PATCH 2/7] feature: initials
Expando for author's initials
---
PATCHES | 1 +
README.initials | 48 ++++++++++++++++++++
doc/manual.xml.head | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++
doc/muttrc.initials | 27 +++++++++++
hdrline.c | 23 ++++++++++
5 files changed, 225 insertions(+)
create mode 100644 README.initials
create mode 100644 doc/muttrc.initials
diff --git a/PATCHES b/PATCHES
index d803941..446a4b9 100644
--- a/PATCHES
+++ b/PATCHES
@@ -1 +1,2 @@
+patch-initials-neo-git
patch-ifdef-neo-git
diff --git a/README.initials b/README.initials
new file mode 100644
index 0000000..76b04ba
--- /dev/null
+++ b/README.initials
@@ -0,0 +1,48 @@
+Initials Expando Patch
+======================
+
+ Expando for author's initials
+
+Patch
+-----
+
+ To check if Mutt supports "Initials", look for "patch-initials" in the mutt
+ version.
+
+ Dependencies
+ * mutt-1.6.2
+
+Introduction
+------------
+
+ The "initials" patch adds an expando (%I) for an author's initials.
+
+ The index panel displays a list of emails. Its layout is controlled by the
+ $index_format variable. Using this expando saves space in the index panel.
+ This can be useful if you are regularly working with a small set of people.
+
+Variables
+---------
+
+ This patch has no config of its own. It adds an expando which can be used
+ in the $index_format variable.
+
+See Also
+--------
+
+ * NeoMutt project
+ * $index_format
+ * index-color patch
+ * folder-hook
+
+Known Bugs
+----------
+
+ None
+
+Credits
+-------
+
+ * Vsevolod Volkov <vvv@mutt.org.ua>
+ * Richard Russon <rich@flatcap.org>
+
diff --git a/doc/manual.xml.head b/doc/manual.xml.head
index d643a7c..e6f1320 100644
--- a/doc/manual.xml.head
+++ b/doc/manual.xml.head
@@ -8263,6 +8263,132 @@ <sect1 id="ifdef">
</sect2>
</sect1>
+<sect1 id="initials">
+ <title>Initials Expando Patch</title>
+ <subtitle>Expando for author's initials</subtitle>
+
+ <sect2 id="initials-patch">
+ <title>Patch</title>
+
+ <para>
+ To check if Mutt supports <quote>Initials</quote>, look for
+ <quote>patch-initials</quote> in the mutt version.
+ See: <xref linkend="mutt-patches"/>.
+ </para>
+
+ <itemizedlist>
+ <title>Dependencies:</title>
+ <listitem><para>mutt-1.6.2</para></listitem>
+ </itemizedlist>
+
+ <para>This patch is part of the <ulink url="http://www.neomutt.org/">NeoMutt Project</ulink>.</para>
+ </sect2>
+
+ <sect2 id="initials-intro">
+ <title>Introduction</title>
+
+ <para>
+ The <quote>initials</quote> patch adds an expando (%I) for an author's
+ initials.
+ </para>
+
+ <para>
+ The index panel displays a list of emails. Its layout is controlled by
+ the <link linkend="index-format">$index_format</link> variable. Using
+ this expando saves space in the index panel. This can be useful if you
+ are regularly working with a small set of people.
+ </para>
+ </sect2>
+
+ <sect2 id="initials-variables">
+ <title>Variables</title>
+
+ <para>
+ This patch has no config of its own. It adds an expando which can be
+ used in the <link linkend="index-format">$index_format</link> variable.
+ </para>
+ </sect2>
+
+<!--
+ <sect2 id="initials-functions">
+ <title>Functions</title>
+ <para>None</para>
+ </sect2>
+
+ <sect2 id="initials-commands">
+ <title>Commands</title>
+ <para>None</para>
+ </sect2>
+
+ <sect2 id="initials-colors">
+ <title>Colors</title>
+ <para>None</para>
+ </sect2>
+
+ <sect2 id="initials-sort">
+ <title>Sort</title>
+ <para>None</para>
+ </sect2>
+-->
+
+ <sect2 id="initials-muttrc">
+ <title>Muttrc</title>
+<screen>
+<emphasis role="comment"># Example Mutt config file for the 'initials' patch.
+
+# The 'initials' patch has no config of its own.
+# It adds an expando for an author's initials,
+# which can be used in the 'index_format' variable.
+
+# The default 'index_format' is:</emphasis>
+set index_format='%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s'
+
+<emphasis role="comment"># Where %L represents the author/recipient
+
+# This might look like:
+# 1 + Nov 17 David Bowie Changesbowie ( 689)
+# 2 ! Nov 17 Stevie Nicks Rumours ( 555)
+# 3 + Nov 16 Jimi Hendrix Voodoo Child ( 263)
+# 4 + Nov 16 Debbie Harry Parallel Lines ( 540)
+
+# Using the %I expando:</emphasis>
+set index_format='%4C %Z %{%b %d} %I (%?l?%4l&%4c?) %s'
+
+<emphasis role="comment"># This might look like:
+# 1 + Nov 17 DB Changesbowie ( 689)
+# 2 ! Nov 17 SN Rumours ( 555)
+# 3 + Nov 16 JH Voodoo Child ( 263)
+# 4 + Nov 16 DH Parallel Lines ( 540)
+
+# vim: syntax=muttrc</emphasis>
+</screen>
+ </sect2>
+
+ <sect2 id="initials-see-also">
+ <title>See Also</title>
+
+ <itemizedlist>
+ <listitem><para><ulink url="http://www.neomutt.org/">NeoMutt Project</ulink></para></listitem>
+ <listitem><para><link linkend="index-format">$index_format</link></para></listitem>
+ <listitem><para><link linkend="index-color">index-color patch</link></para></listitem>
+ <listitem><para><link linkend="folder-hook">folder-hook</link></para></listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="initials-known-bugs">
+ <title>Known Bugs</title>
+ <para>None</para>
+ </sect2>
+
+ <sect2 id="initials-credits">
+ <title>Credits</title>
+ <itemizedlist>
+ <listitem><para>Vsevolod Volkov <email>vvv@mutt.org.ua</email></para></listitem>
+ <listitem><para>Richard Russon <email>rich@flatcap.org</email></para></listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
</chapter>
<chapter id="security">
diff --git a/doc/muttrc.initials b/doc/muttrc.initials
new file mode 100644
index 0000000..644c1b7
--- /dev/null
+++ b/doc/muttrc.initials
@@ -0,0 +1,27 @@
+# Example Mutt config file for the 'initials' patch.
+
+# The 'initials' patch has no config of its own.
+# It adds an expando for an author's initials,
+# which can be used in the 'index_format' variable.
+
+# The default 'index_format' is:
+set index_format='%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s'
+
+# Where %L represents the author/recipient
+
+# This might look like:
+# 1 + Nov 17 David Bowie Changesbowie ( 689)
+# 2 ! Nov 17 Stevie Nicks Rumours ( 555)
+# 3 + Nov 16 Jimi Hendrix Voodoo Child ( 263)
+# 4 + Nov 16 Debbie Harry Parallel Lines ( 540)
+
+# Using the %I expando:
+set index_format='%4C %Z %{%b %d} %I (%?l?%4l&%4c?) %s'
+
+# This might look like:
+# 1 + Nov 17 DB Changesbowie ( 689)
+# 2 ! Nov 17 SN Rumours ( 555)
+# 3 + Nov 16 JH Voodoo Child ( 263)
+# 4 + Nov 16 DH Parallel Lines ( 540)
+
+# vim: syntax=muttrc
diff --git a/hdrline.c b/hdrline.c
index b844411..ddde2e4 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -212,6 +212,7 @@ int mutt_user_is_recipient (HEADER *h)
* %f = entire from line
* %F = like %n, unless from self
* %i = message-id
+ * %I = initials of author
* %l = number of lines in the message
* %L = like %F, except `lists' are displayed first
* %m = number of messages in the mailbox
@@ -463,6 +464,28 @@ hdr_format_str (char *dest,
mutt_format_s (dest, destlen, prefix, hdr->env->message_id ? hdr->env->message_id : "<no.id>");
break;
+ case 'I':
+ {
+ int iflag = FALSE;
+ int j = 0;
+
+ for (i = 0; hdr->env->from && hdr->env->from->personal &&
+ hdr->env->from->personal[i] && (j < (SHORT_STRING - 1)); i++) {
+ if (isalpha ((int) hdr->env->from->personal[i])) {
+ if (!iflag) {
+ buf2[j++] = hdr->env->from->personal[i];
+ iflag = TRUE;
+ }
+ } else {
+ iflag = FALSE;
+ }
+ }
+
+ buf2[j] = '\0';
+ }
+ mutt_format_s (dest, destlen, prefix, buf2);
+ break;
+
case 'l':
if (!optional)
{
--
2.7.4