pazz/alot — Issue #272: parse external message/part formatter's VT output
Author: pazz
Created: 2012-01-18 15:37:37+00:00
State: open
Labels: feature

```
12:43:59 I would really love to have extensible message display, the way ranger does it. That would mean rewriting message
display anyway. I think such mime explorer should show non-attachment parts too, as eg. you may want to select a
patch that is sent as text/plain. Or try to figure out whatever weirdness someone sent to you.
12:46:47 ranger?
12:47:25 http://ranger.nongnu.org/ as I mentioned it in https://github.com/pazz/alot/issues/134#issuecomment-3378245
12:47:55 altough I don't really use it as a file manager, I think the idea is brilliant
12:48:41 and email is something where you need customisable preview/formatting much more than regular filemanager
12:50:35 this is my scope.sh, for reference: http://wpr.cz/ccx/paste/2012-01-17/0.html
12:51:15 neat.
12:52:07 trouble with the current approach in alot is that a message preview is not just text but a pile of widgets..
12:52:21 also, ranger is pure python, so we can steal some of relevant bits
12:52:39 yes I know, but the body is a single widget, right?
12:53:18 this would ofc need writing a widged for colored/rich text, but that shouldn't be that hard
12:53:28 s/widged/widget/
12:56:42 the body is a single text widget atm yes. but in the distant future this *will* change: if we are able to neatly
parse indented substrings into a tree and fold/colour them.
12:57:10 atm urwids treewidgets suck unfortunately.
12:58:09 if we would not care about folding, external formatter would be superior approach
12:59:57 well, you have to wrap its output into urwid text widgets again, which does teh colouring. if done naively, the
colour info of your formatter is ignored when you take its output and put it into a urwid.Text
12:59:58 we can ofc specify microformat to let formatter put folds inside the document (probably use the vim fold syntax)
13:00:29 good idea.
13:00:38 pazz: indeed, it has to be parsed and we need to create a sequence of text fields from that
13:01:16 parsing VT sequences is not hard (about 40 lines looking into ranger source code)
```