Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort threads according to their newest message not wrt the first message in mu4e headers view. #164

Closed
tmalsburg opened this issue Mar 13, 2013 · 14 comments
Labels

Comments

@tmalsburg
Copy link
Contributor

(This topic has been discussed by Jacek Generowicz and Dirk-Jan on the mailing list. I add it here for the record.)

Mu4e sorts threads according to the date of their first message. The drawback is that new messages in old threads may not show up in the list of recent mails (mails within the mu4e-headers-results-limit). Therefore, it's easy to miss them. Apart from checking their (threaded) inbox users have to perform additional steps to ensure that they don't miss messages. Sorting threads according to the date of their newest message is more desirable. This way new messages always show up at the top.

Dirk-Jan pointed out that it may be difficult to make this work as long as the database doesn't understand threads. However, this discussion suggests that mu has in fact learned a few things about threads recently. Perhaps sorting threads according to the newest message is more feasible now?

@djcb
Copy link
Owner

djcb commented Mar 16, 2013

mu4e/mu do understand threads now, but not to the extent that you could implement sorting by some specific message within the thread...

@technomancy
Copy link
Contributor

This is literally my only complaint about mu4e these days. Is it something that could be added by hacking elisp, or does it require writing C?

@technomancy
Copy link
Contributor

I know money doesn't necessarily help get features written, but I'd be willing to put some money towards this on bountysource.com if it would help. Let me know if it's something worth considering and I can set up a bounty.

@tmalsburg
Copy link
Contributor Author

I would happly join in and contribute something.

@pmetzner
Copy link

Me, too.

@jhelberg
Copy link

can anyone confirm this feature as done? We implemented this; I'm very much interested in feedback.

@tmalsburg
Copy link
Contributor Author

In my setup it seems to work properly. I haven't done any systematic testing though. Thank you very much for implementing this, @omfgroflbbq!

@technomancy
Copy link
Contributor

Holy smokes; it's working. Nice job!

@jhelberg
Copy link

this issue can be closed now, can't it?

jsitnicki added a commit to jsitnicki/mu that referenced this issue Jul 21, 2014
Traverse the container tree depth first and for each container find
the node in the subtree rooted at this container which comes first in
the descending sort order. Remember it as the subtree leader. Then,
while sorting siblings, compare their subtree leaders instead of the
sibling containers themselves.

IOW, make threads containing the newest message float to the top when
sorting by date in the descending order.

There is no significant performance degradation when sorting a
mailbox with ~16k messages:

$ mu find maildir:/INBOX | wc -l
16503

Current state:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1231.761588      task-clock (msec)         #    0.996 CPUs utilized            ( +-  1.02% )

       1.236209133 seconds time elapsed                                          ( +-  1.08% )

With patch applied:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1459.883316      task-clock (msec)         #    0.998 CPUs utilized            ( +-  0.72% )

       1.462540088 seconds time elapsed                                          ( +-  0.77% )

This implements djcb#164.
@tmalsburg
Copy link
Contributor Author

Apparently this is working now. Thanks!

@ArneBab
Copy link

ArneBab commented Nov 14, 2015

Thank you!

@jhelberg
Copy link

jhelberg commented Mar 3, 2021

bug seems back. no?

@Gavinok
Copy link

Gavinok commented Apr 11, 2024

Is it possible to take advantage of this in mu4e? I can't find any documentation on it.

@djcb
Copy link
Owner

djcb commented Apr 12, 2024

This is not currently implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants