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

Already on GitHub? Sign in to your account

Foldable threads in header view #330

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
9 participants

xaiki commented Dec 21, 2013

The implementation is pretty silly:

  • put a marker everytime we come across a message that has a
    'thread-level' of 0.
  • look for that marker, the line that has it is the thread header,
    create an overlay for it.
  • the thread header is given different faces depending of it's folded
    state
  • all lines after that marker up to another marker or end-of-file are
    the subthreads, they are given another overlay.
  • the subthreads block overlay is given a face to customize it's look.
  • we only set-up overlays on demand (after rendering) so that we don't
    slow header-view rendering.
  • as a bonus track, a function to recurse all thread groups is provided.

Signed-off-by: Niv Sardi xaiki@evilgiggle.com

@xaiki xaiki Foldable threads in header view
The implementation is pretty silly:

+ put a marker everytime we come across a message that has a
 'thread-level' of 0.
+ look for that marker, the line that has it is the thread header,
  create an overlay for it.
+ the thread header is given different faces depending of it's folded
  state
+ all lines after that marker up to another marker or end-of-file are
  the subthreads, they are given another overlay.
+ the subthreads block overlay is given a face to customize it's look.
+ we only set-up overlays on demand (after rendering) so that we don't
  slow header-view rendering.
+ as a bonus track, a function to recurse all thread groups is provided.

Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>
21524fd
Owner

djcb commented Dec 24, 2013

Ah, cool stuff! I'll review it... It would be something for after the current release though.

philc commented Feb 10, 2014

Exciting. What's the status of this?

+1

Contributor

xuhdev commented Dec 4, 2014

👍

Status? I'm willing to work on the code if that is needed...

gburch commented May 26, 2015

+1

dakrone commented Nov 11, 2015

This would be great to have, especially for very long threads so they can easily be folded. Any idea what's up with this PR?

Contributor

avar commented Nov 22, 2015

I did a trivial rebase of this in my avar-xaiki/thread-foldable-headers branch to solve the conflicts, but the code doesn't work anymore if it ever did. @xaiki, is this something you still use or can you notice what's broken?

Contributor

avar commented Nov 22, 2015

Actually. It sort of works if you set mu4e-use-fancy-chars nil, but doesn't work at all without it. But it's still buggy. I.e. when you collapse a thread from the first message in the thread the pointer ends up on the line above it.

If you collapse it in a message after the first the pointer correctly ends up at the first message, but you have to press n twice to navigate to the next line. Other than that it seems to work.

Contributor

avar commented Nov 23, 2015

Oh, and it doesn't work at all for collapsing subcomponents of the thread, which would be neat. It just collapses the whole thing or expands it entirely.

Owner

djcb commented Nov 29, 2015

I like the idea, but it seems a slightly different approach is needed - so closing this PR.

@djcb djcb closed this Nov 29, 2015

Contributor

avar commented Nov 29, 2015

@djcb For people interested in this, could you elaborate on that please?

I don't fully understand the patch, but from what I see it's basically placing an invisible marker at the start & end of threads, and then when you press <TAB> it checks if you're within one of those and collapses the thread using some search + mark + hide hackery. It seems this hack is used for some existing things in the header view.

What sort of approach do you think makes sense instead?

B.t.w. just to clarify the ambiguities of text-based communication the above is not a rhetorical question. I have very little experience with elisp mode programming and haven't seen how this sort of thing is usually solved, but would be interested in your thoughts on this if I find some time to try to implement this.

dakrone commented Dec 9, 2015

I applied this patch locally to play around with it to see what it was like, and it seems to work for the most part. It's missing something where threads can be automatically folded, but that would be pretty easy to add I think.

@djcb I'm curious about the same thing as @avar, if there is any plan for this in the future or what can be changed to get it in. I'm happy to try and contribute to get it to whatever approach is desired. For me, this is the only thing gnus does better than mu4e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment