]> git.pld-linux.org Git - packages/mutt.git/blame - mutt-devl.narrow_tree.patch
- already included in Mutt-1.5.10
[packages/mutt.git] / mutt-devl.narrow_tree.patch
CommitLineData
ac6ff396 1diff -u mutt-1.3.26.old/PATCHES mutt-1.3.26/PATCHES
2--- mutt-1.3.26.old/PATCHES Tue Jan 15 10:03:20 2002
3+++ mutt-1.3.26/PATCHES Fri Jan 18 15:54:52 2002
4@@ -0,0 +1 @@
5+patch-1.3.26.devl.narrow_tree.1
6diff -u mutt-1.3.26.old/hdrline.c mutt-1.3.26/hdrline.c
7--- mutt-1.3.26.old/hdrline.c Mon Dec 17 11:04:48 2001
8+++ mutt-1.3.26/hdrline.c Fri Jan 18 15:54:28 2002
9@@ -200,6 +200,50 @@
10 return h->recipient;
11 }
12
13+/* do_subject returns the pointer it is given for tree or subject if
14+ * the respective one of them is all the subject that needs to be
15+ * printed. otherwise, it copies the appropriate string into buf
16+ * and returns that.
17+ */
18+char *do_subject (char *dest, size_t destlen, char *subject, char *tree, int flags, char *buf, size_t bufsize)
19+{
20+ char *dst;
21+
22+ if (option (OPTNARROWTREE))
23+ {
24+ dst = buf;
25+
26+ while (bufsize > 1)
27+ {
28+ *dst = *tree;
29+ bufsize--;
30+ dst++;
31+ if (!(*(tree + 1)))
32+ break;
33+ tree += 2;
34+ }
35+ if (*(tree - 1) == '\010')
36+ *(dst - 2) = '\010';
37+
38+ if (flags & M_FORMAT_FORCESUBJ)
39+ {
40+ mutt_format_s (dest, destlen, "", NONULL (subject));
41+ snprintf (dst, bufsize, "%s", dest);
42+ }
43+ else
44+ *dst = 0;
45+ return (buf);
46+ }
47+ else if (flags & M_FORMAT_FORCESUBJ)
48+ {
49+ mutt_format_s (dest, destlen, "", NONULL (subject));
50+ snprintf (buf, bufsize, "%s%s", tree, dest);
51+ return (buf);
52+ }
53+ else
54+ return (tree);
55+}
56+
57 /* %a = address of author
58 * %b = filename of the originating folder
59 * %B = the list to which the letter was sent
60@@ -528,16 +572,8 @@
61 case 's':
62
63 if (flags & M_FORMAT_TREE && !hdr->collapsed)
64- {
65- if (flags & M_FORMAT_FORCESUBJ)
66- {
67- mutt_format_s (dest, destlen, "", NONULL (hdr->env->subject));
68- snprintf (buf2, sizeof (buf2), "%s%s", hdr->tree, dest);
69- mutt_format_s_tree (dest, destlen, prefix, buf2);
70- }
71- else
72- mutt_format_s_tree (dest, destlen, prefix, hdr->tree);
73- }
74+ mutt_format_s_tree (dest, destlen, prefix,
75+ do_subject (dest, destlen, hdr->env->subject, hdr->tree, flags, buf2, sizeof (buf2)));
76 else
77 mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->subject));
78 break;
79diff -u mutt-1.3.26.old/init.h mutt-1.3.26/init.h
80--- mutt-1.3.26.old/init.h Mon Dec 10 11:09:03 2001
81+++ mutt-1.3.26/init.h Fri Jan 18 15:54:28 2002
82@@ -1093,6 +1093,14 @@
83 { "msg_format", DT_SYN, R_NONE, UL "message_format", 0 },
84 /*
85 */
86+ { "narrow_tree", DT_BOOL, R_BOTH, OPTNARROWTREE, 0 },
87+ /*
88+ ** .pp
89+ ** This variable controls the width of the thread tree when sorting by
90+ ** threads. When set, it makes the tree approximately twice as narrow,
91+ ** to allow more room the tree and message subjects. This is useful on
92+ ** narrow screens.
93+ */
94 { "pager", DT_PATH, R_NONE, UL &Pager, UL "builtin" },
95 /*
96 ** .pp
97diff -u mutt-1.3.26.old/mutt.h mutt-1.3.26/mutt.h
98--- mutt-1.3.26.old/mutt.h Tue Jan 15 22:00:32 2002
99+++ mutt-1.3.26/mutt.h Fri Jan 18 15:54:28 2002
100@@ -364,6 +364,7 @@
101 OPTMETOO,
102 OPTMHPURGE,
103 OPTMIMEFORWDECODE,
104+ OPTNARROWTREE,
105 OPTPAGERSTOP,
106 OPTPIPEDECODE,
107 OPTPIPESPLIT,
This page took 0.035935 seconds and 4 git commands to generate.