-
Notifications
You must be signed in to change notification settings - Fork 164
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
[feature] fold message body parts #3
Comments
replaced dict.has_key(foo) with foo in dict
Uber-Feature. Would be great to fold all full-quotes. |
hmmyea: i am waiting for s/o to write proper tree widgets in urwid :/ go for it :) |
Is this feature still on the agenda? |
Yes, but afaik, nobody is working on it |
@pazz since you've written foldable tree widgets, this should be doable, right? |
everything is doable.. the problem is how to parse the mail (i.e. the "body" text) into a tree, |
I don't agree. But I guess we are not here to talk about computer science :) Right know I really struggle when browsing through long discussions on mailing lists: lots of inline comments, top posters, bottom posters, different quotation styles — I'm assuming this feature will be a real challenge. I'll definitely try to hack something. |
So I spent some time on reading about email quoting practices and here are my thoughts:
|
I've started to experiment a bit with this. For now, my quick hack can find, for top posting, where to fold (only for '>' characters, which is good enough for me), and implements a custom CollapsableTreeWidget. While I plan to get it into alot, don't get too excited: I have a bad history of hacking on something and than not finishing it up. What's "left" to do here:
Anyone wants to collaborate on this? |
See here as well https://github.com/geier/alot/tree/fold_quoted_replies
|
Cool stuff. One issue I found was that this ignores the
`thread_focus_linewise` setting and switches the default to `False`..
You could also think about custom regular expressions and
interactive (re)folding..
Quoting Christian Geier (2017-09-23 00:05:41)
… See here as well https://github.com/geier/alot/tree/fold_quoted_replies
current issues:
• quotes are folded and cannot be unfolded
• line highlighting is broken
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.*
|
That's what I meant with highlighting is broken. My problem is, when I use TextlinesList, those get folded and only the very first ones get shown. Probably the same problem that makes the it not unfold when used in alot. I just tried to fix it, but I guess I don't grok urwidtrees yet. I'll carefully look at the examples again later this week. |
thanks. let us know if you need any help with this. |
So my problem at the moment is, that I have a tree which contains only subtrees, like this:
The collapsible tree collapses the first TextLinesList and hides all the other ones. I guess this makes sense, because the content has children itself. If I use Piles instead of TextLinesList it works (because there is nothing to collapse), or wrap the TextLinesLists in BlockAdapters (which sureley isn't the way to go). Can I wrap the TextLinesLists somehow? Or do I need to subclass CollapsibleTree? A minimal example can be found here: https://gist.github.com/geier/740580e2a4193088964a3b4d2c5eb4af Also, why are you using Trees for the text in the first place (instead of Piles or ListsWalker)? Are they more efficient? Am I missing something? Thanks for taking a look. |
geier. It's been a while since i looked at this so take this with a gain of salt: |
To fold away body parts of messages, define MessageBodyWidget
as urwid.Pile that contains foldable subparts.
Maybe we can subclass urwid.Text to define a FoldableText widget for this.
These should be selectable so that command.ThreadSelect can handle them
The text was updated successfully, but these errors were encountered: