mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Create $sidebar_relative_shortpath_indent, default unset.

When unset this option provides the pre-1.13.0 sidebar indentation and
shortpath behavior.

Setting the option will enable the new (relative to previous entries)
indentation and shortening behavior.

Note the mailbox shortcuts are controlled by
$sidebar_use_mb_shortcuts, which defaults set.

+70 -25
+28
init.h
··· 3272 3272 ** \fC<sidebar-prev-new>\fP command is similarly affected, wrapping around to 3273 3273 ** the end of the list. 3274 3274 */ 3275 + { "sidebar_relative_shortpath_indent", DT_BOOL, R_SIDEBAR, {.l=OPTSIDEBARRELSPINDENT}, {.l=0} }, 3276 + /* 3277 + ** .pp 3278 + ** When set, this option changes how $$sidebar_short_path and 3279 + ** $$sidebar_folder_indent perform shortening and indentation: both 3280 + ** will look at the previous sidebar entries and shorten/indent 3281 + ** relative to the most recent parent. 3282 + ** .pp 3283 + ** An example of this option set/unset for mailboxes listed in this 3284 + ** order, with $$sidebar_short_path=yes, 3285 + ** $$sidebar_folder_indent=yes, and $$sidebar_indent_string="→": 3286 + ** .dl 3287 + ** .dt \fBmailbox\fP .dd \fBset\fP .dd \fBunset\fP 3288 + ** .dt \fC=a.b\fP .dd \fC=a.b\fP .dd \fC→b\fP 3289 + ** .dt \fC=a.b.c.d\fP .dd \fC→c.d\fP .dd \fC→→→d\fP 3290 + ** .dt \fC=a.b.e\fP .dd \fC→e\fP .dd \fC→→e\fP 3291 + ** .de 3292 + ** .pp 3293 + ** The second line illustrates most clearly. With this option set, 3294 + ** \fC=a.b.c.d\fP is shortened relative to \fC=a.b\fP, becoming 3295 + ** \fCc.d\fP; it is also indented one place relative to \fC=a.b\fP. 3296 + ** With this option unset \fC=a.b.c.d\fP is always shortened to the 3297 + ** last part of the mailbox, \fCd\fP and is indented three places, 3298 + ** with respect to $$folder (represented by '='). 3299 + ** .pp 3300 + ** When set, the third line will also be indented and shortened 3301 + ** relative to the first line. 3302 + */ 3275 3303 { "sidebar_short_path", DT_BOOL, R_SIDEBAR, {.l=OPTSIDEBARSHORTPATH}, {.l=0} }, 3276 3304 /* 3277 3305 ** .pp
+1
mutt.h
··· 515 515 OPTSIDEBARFOLDERINDENT, 516 516 OPTSIDEBARNEWMAILONLY, 517 517 OPTSIDEBARNEXTNEWWRAP, 518 + OPTSIDEBARRELSPINDENT, 518 519 OPTSIDEBARUSEMBSHORTCUTS, 519 520 OPTSIDEBARSHORTPATH, 520 521 #endif
+41 -25
sidebar.c
··· 619 619 int entryidx; 620 620 SBENTRY *entry; 621 621 BUFFY *b; 622 + int maildir_is_prefix; 622 623 int indent_width = -1; 623 624 int indent_depths[SIDEBAR_MAX_INDENT]; 624 625 const char *sidebar_folder_name; ··· 668 669 b->msg_flagged = Context->flagged; 669 670 } 670 671 672 + maildir_is_prefix = 0; 671 673 if (option (OPTSIDEBARUSEMBSHORTCUTS)) 672 674 { 673 675 mutt_buffer_strcpy (pretty_folder_name, mutt_b2s (b->pathbuf)); 674 676 mutt_buffer_pretty_mailbox (pretty_folder_name); 675 677 sidebar_folder_name = mutt_b2s (pretty_folder_name); 678 + if (sidebar_folder_name[0] == '=') 679 + maildir_is_prefix = 1; 676 680 } 677 681 else 678 682 { ··· 688 692 (mutt_strncmp (Maildir, mutt_b2s (b->pathbuf), maildirlen) == 0) && 689 693 SidebarDelimChars && 690 694 strchr (SidebarDelimChars, mutt_b2s (b->pathbuf)[maildirlen])) 695 + { 691 696 sidebar_folder_name = mutt_b2s (b->pathbuf) + (maildirlen + 1); 697 + maildir_is_prefix = 1; 698 + } 692 699 else 693 700 sidebar_folder_name = mutt_b2s (b->pathbuf); 694 701 } ··· 704 711 705 712 calculate_depth (sidebar_folder_name, mutt_b2s (last_folder_name), 706 713 &depth, &common_depth); 707 - mutt_buffer_strcpy (last_folder_name, sidebar_folder_name); 708 714 709 - if (indent_width < SIDEBAR_MAX_INDENT) 710 - indent_width++; 715 + if (option(OPTSIDEBARRELSPINDENT)) 716 + { 717 + mutt_buffer_strcpy (last_folder_name, sidebar_folder_name); 711 718 712 - /* indent_depths[] hold the path depths at each level of indentation. 713 - * Indent based off the longest path that we share in common. 714 - * 715 - * The 'indent_depths[] >= depth' test below is for a corner case: 716 - * 717 - * path depth common_depth indent_width 718 - * /a 2 0 0 719 - * /a/b 3 2 1 720 - * /a/b/ 3 3 1 721 - * 722 - * Because the common_depth of /a/b/ matches the depth of 723 - * /a/b, we need the additional test to continue popping the 724 - * indent_depths[] stack. 725 - */ 726 - while (indent_width && 727 - ((indent_depths[indent_width - 1] > common_depth) || 728 - (indent_depths[indent_width - 1] >= depth))) 729 - indent_width--; 719 + if (indent_width < SIDEBAR_MAX_INDENT) 720 + indent_width++; 730 721 731 - if (indent_width < SIDEBAR_MAX_INDENT) 732 - indent_depths[indent_width] = depth; 733 - if (indent_width) 734 - parent_depth = indent_depths[indent_width - 1]; 722 + /* indent_depths[] hold the path depths at each level of indentation. 723 + * Indent based off the longest path that we share in common. 724 + * 725 + * The 'indent_depths[] >= depth' test below is for a corner case: 726 + * 727 + * path depth common_depth indent_width 728 + * /a 2 0 0 729 + * /a/b 3 2 1 730 + * /a/b/ 3 3 1 731 + * 732 + * Because the common_depth of /a/b/ matches the depth of 733 + * /a/b, we need the additional test to continue popping the 734 + * indent_depths[] stack. 735 + */ 736 + while (indent_width && 737 + ((indent_depths[indent_width - 1] > common_depth) || 738 + (indent_depths[indent_width - 1] >= depth))) 739 + indent_width--; 740 + 741 + if (indent_width < SIDEBAR_MAX_INDENT) 742 + indent_depths[indent_width] = depth; 743 + if (indent_width) 744 + parent_depth = indent_depths[indent_width - 1]; 745 + } 746 + else 747 + { 748 + parent_depth = depth - 1; 749 + indent_width = maildir_is_prefix ? depth - 1 : 0; 750 + } 735 751 } 736 752 737 753 if (option (OPTSIDEBARSHORTPATH) && parent_depth)