Weird thing happening with the point when threads are collapsed
If I have the point at the message just below a collapsed thread and I do an action (say press d for Delete) the action applies to one of the messages inside the fold instead of the one where the point is at. It could be related to #7
The reason might be that the cursor is not moved after folding and still relate to the message before collapsing. Not moving the cursor is useful when you fold/unfold (your cursor does not move) but in your case it is annoying. Nott sure what would be the best behavior.
However, this does not just happen after folding. My buffer has all messages folded. I move the cursor to the message below the fold, and when I hit Enter the last message within the fold is displayed. You can also see it in the message list: the underline that shows the current message disappears (I assume that it is somewhere within the fold).
Regarding what you mentioned about the best behavior, in my case at least I think that having the cursor move when you fold/unfold is a lot less annoying than having the wrong message be current. At least if the cursor moves the visual feedback actually matches what is happening behind the scenes.
If you don't want the cursor to move, when you fold you could change the current message to be the first message within the fold. That would fix both problems: the visual feedback matches what is displayed, and you still don't move the cursor. However, it might be a bit jarring/inconvenient if you are viewing a different message within the fold at that point.
This is what I mean:
- I am in the headers view, with no message opened. All threads are folded.
- The cursor is on a message right above a folded conversation
- I press J. The current message indicator (the underline) is the fold.
- I press J. The current message indicator disappears.
- I press J. The current message indicator appears on the message just below the fold.
If the fold contains an unread message, the message indicator disappears after trying moving to the message AFTER the unread message (not when moving to the unread message itself).
The case with the fold containing an unread message can be even weirder. I just saw this happen:
- The cursor is on the fold. There is an unread message from the fold right below the fold.
- I press J. The current message indicator disappears.
- I press J. The current message indicator appears on the message BELOW the unread message (i.e. there is no way to select the unread message short of unfolding)
Do you get the same behavior if you use (n)ext (p)revious keys?
I'm using Doom Emacs (therefore evil-mode), so J above is actually mu4e-headers-next (and I should actually have said j instead of J). The down arrow actually works correctly.
In the case of a single fold (whether the message below the fold is an unread message on the same thread, or is an unrelated message):
-
C-jon a fold moves the cursor to the message after the fold and the underline disappears. - The next
C-jmoves the cursor RIGHT one space, the underline is appears on the message after the fold (where the cursor is). - The next
C-jmoves the cursor to the next message, the underline reappears.
In the case of a two consecutive folds the same thing happens, except that the cursor does not move right when pressing C-j on the second fold.
Correction: the down arrow does the same thing as j / C-j.
By the way, I experienced an alternative thread folding which is simpler and faster: https://gist.github.com/rougier/98e83fb50e19fb73fe34a7ecc5fc1ccc
I think the behavior is more consistent but I'm not sure if it can be adapter to mu4e-thread-folding.