Created attachment 278331 [details] sidebar-dotted.patch Here are two patches to fix bugs in the sidebar patch. sidebar-dotted.patch will properly indent and remove prefixes for Courier IMAP servers, which split subfolders with '.' rather than '/'. sidebar-sort.patch will cause IMAP folders to be sorted instead of displaying them in a random (and useless) order. These patches are from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523774
Created attachment 278333 [details, diff] sidebar-sorted.patch
do these patches apply on the sidebar patch we have for 1.5.21-r3 (http://prefix.gentooexperimental.org:8000/mutt-patches/file/413f13820028/sidebar.patch)?
It applies clean on top of -r3 using the ebuild in my overlay.
Sorted should not be necessary since the 1.5.20 patch should already have this included. Is your dotted patch with or without the free() fixes?
*** Bug 368519 has been marked as a duplicate of this bug. ***
fixed in mutt-1.5.21-r4
Hi, it seems to me that the sidebar-dotted.patch is not applied. The muttrc manpage shows the option "sidebar_sort", but not "sidebar_shortpath". Shortening also breaks the display of folders if you don't have them sorted b/c A.INBOX B.INBOX A.archive B.archive gets displayed as A INBOX B INBOX archive archive Something is wrong. The problem is present in -r5
I didn't apply the dotted patch because it's broken by design. Instead I wrote a patch that is a little less broken. The behaviour you see is the original behaviour of the sidebar patch for "normal" folders (those that have a / as path separator). Perhaps it makes little to no sense not to sort the list here. However, as I suspected before, the sidebar patch itself is also of questionable quality. I'd say the workaround here is to sort your folder list. Note that the sidebar patch doesn't try to reconstruct a tree or something. It just replaces leading "directories" by spaces and assumes the tree is built of a properly setup buffy (your mailboxes thing).
(In reply to comment #8) > I didn't apply the dotted patch because it's broken by design. Instead I wrote > a patch that is a little less broken. > > The behaviour you see is the original behaviour of the sidebar patch for > "normal" folders (those that have a / as path separator). Perhaps it makes > little to no sense not to sort the list here. However, as I suspected before, > the sidebar patch itself is also of questionable quality. I'd say the > workaround here is to sort your folder list. > > Note that the sidebar patch doesn't try to reconstruct a tree or something. It > just replaces leading "directories" by spaces and assumes the tree is built of > a properly setup buffy (your mailboxes thing). Maybe there are some unintended consequences of your patch. I sync my IMAP folders from various accounts to a local maildir. I use dots to indicate folder separators on the remote server, that is my folder layout on the file system A -> a (this the inbox) -> a.x (this is a folder) -> a.y B -> b -> b.x -> b.y When I sort them like I want them (inboxes first), then -r3 displays them as a b a.x a.y b.x b.y -r5 displays them as a b x y x y That makes me believe that something is wrong with the patch?
Thomas, you could try also applying the 'sorted' patch in your ebuild and see if it helps.
Tomas, Yes and no. It's not per-se my patch, rather than that you use . and now see behaviour that is intended for /. I'm willing to accept that you perhaps want to control the characters to split on instead of always taking / and ., like imap_delim_chars. The rest is just implicit to what sidebar does. It should have done better to build a graph internally and fill in the nodes with numbers if they happen to be watched or something so your example would result in something more expected.
updated patch is here in case you want to try it (feedback appreciated) http://prefix.gentooexperimental.org:8000/mutt-patches/file/e31dea94d61b/sidebar-dotpathsep.patch
set sidebar_delim_chars = "/" brings back the 'old' behaviour. +1 Many thanks. -> Reclosing.
I still need to update the patch ball and commit it, sorry. Thanks a lot for testing and reporting back. I'll commit it tonight.
committed in -r6, thanks
Created attachment 304987 [details] Correct bug in "basename" replacement I think there is an error in the current sidebar-dotpathsep.patch that replaces the standard "basename" function. If "tmp->path" ends with "/foobar/", the current patch will return "" and not "foobar" as basename does. In my case this results in lines as the following for the "/"(/INBOX) of imap mailboxes: " 5221| [... (mails) ...]" This is a simple patch that skip the last character in order to correct this behavior.
please reopen bugs in the future, or they'll easily get lost in the pile of other bugmails... Thanks for your patch, I think it's ok. I'll look into applying it later.
http://prefix.gentooexperimental.org:8000/mutt-patches/rev/7713404dce38
in -r8 (without a bump).