diff -u mutt-1.3.26.old/PATCHES mutt-1.3.26/PATCHES --- mutt-1.3.26.old/PATCHES Tue Jan 15 10:03:20 2002 +++ mutt-1.3.26/PATCHES Fri Jan 18 15:54:52 2002 @@ -0,0 +1 @@ +patch-1.3.26.devl.narrow_tree.1 diff -u mutt-1.3.26.old/hdrline.c mutt-1.3.26/hdrline.c --- mutt-1.3.26.old/hdrline.c Mon Dec 17 11:04:48 2001 +++ mutt-1.3.26/hdrline.c Fri Jan 18 15:54:28 2002 @@ -200,6 +200,50 @@ return h->recipient; } +/* do_subject returns the pointer it is given for tree or subject if + * the respective one of them is all the subject that needs to be + * printed. otherwise, it copies the appropriate string into buf + * and returns that. + */ +char *do_subject (char *dest, size_t destlen, char *subject, char *tree, int flags, char *buf, size_t bufsize) +{ + char *dst; + + if (option (OPTNARROWTREE)) + { + dst = buf; + + while (bufsize > 1) + { + *dst = *tree; + bufsize--; + dst++; + if (!(*(tree + 1))) + break; + tree += 2; + } + if (*(tree - 1) == '\010') + *(dst - 2) = '\010'; + + if (flags & M_FORMAT_FORCESUBJ) + { + mutt_format_s (dest, destlen, "", NONULL (subject)); + snprintf (dst, bufsize, "%s", dest); + } + else + *dst = 0; + return (buf); + } + else if (flags & M_FORMAT_FORCESUBJ) + { + mutt_format_s (dest, destlen, "", NONULL (subject)); + snprintf (buf, bufsize, "%s%s", tree, dest); + return (buf); + } + else + return (tree); +} + /* %a = address of author * %b = filename of the originating folder * %B = the list to which the letter was sent @@ -528,16 +572,8 @@ case 's': if (flags & M_FORMAT_TREE && !hdr->collapsed) - { - if (flags & M_FORMAT_FORCESUBJ) - { - mutt_format_s (dest, destlen, "", NONULL (hdr->env->subject)); - snprintf (buf2, sizeof (buf2), "%s%s", hdr->tree, dest); - mutt_format_s_tree (dest, destlen, prefix, buf2); - } - else - mutt_format_s_tree (dest, destlen, prefix, hdr->tree); - } + mutt_format_s_tree (dest, destlen, prefix, + do_subject (dest, destlen, hdr->env->subject, hdr->tree, flags, buf2, sizeof (buf2))); else mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->subject)); break; diff -u mutt-1.3.26.old/init.h mutt-1.3.26/init.h --- mutt-1.3.26.old/init.h Mon Dec 10 11:09:03 2001 +++ mutt-1.3.26/init.h Fri Jan 18 15:54:28 2002 @@ -1093,6 +1093,14 @@ { "msg_format", DT_SYN, R_NONE, UL "message_format", 0 }, /* */ + { "narrow_tree", DT_BOOL, R_BOTH, OPTNARROWTREE, 0 }, + /* + ** .pp + ** This variable controls the width of the thread tree when sorting by + ** threads. When set, it makes the tree approximately twice as narrow, + ** to allow more room the tree and message subjects. This is useful on + ** narrow screens. + */ { "pager", DT_PATH, R_NONE, UL &Pager, UL "builtin" }, /* ** .pp diff -u mutt-1.3.26.old/mutt.h mutt-1.3.26/mutt.h --- mutt-1.3.26.old/mutt.h Tue Jan 15 22:00:32 2002 +++ mutt-1.3.26/mutt.h Fri Jan 18 15:54:28 2002 @@ -364,6 +364,7 @@ OPTMETOO, OPTMHPURGE, OPTMIMEFORWDECODE, + OPTNARROWTREE, OPTPAGERSTOP, OPTPIPEDECODE, OPTPIPESPLIT,