On Thu, Aug 4, 2016 at 5:30 AM, Nikolai Weibull <[email protected]> wrote:
> Hi! > > I was thinking a bit about how one would go about implementing a TODO > system on top of Koutliner. My simple thought was that one would use > a cell attribute to store the state and then add various functions > that used that attribute. What I like about Koutliner over Org-mode > is that the state isn’t a magical part of the heading and all you need > to do is use the builtin support for attributes instead of a lot of > regular expression parsing of the buffer. What I would like to > support, which I can’t find a simple way to do, is highlighting the > current state in the header somehow. For example, cells with a todo > state of, say, “TODO”, could have their label displayed with a green > background. As I said, I don’t see an obvious way of doing that, > albeit I’m not very familiar with Koutliner’s possibilites, nor Emacs’ > text properties, which I assume one would use. Do you have any > pointers on how one would proceed? > > Thanks! > Hi Nikolai: That is a good idea. We would definitely have to add some additional hooks into the Koutliner to make this much easier to do. But I think you could look at the kview:map-tree function to apply a function across the whole outline like so: (kview:map-tree <your-function> kview t) <your-function> works on an individual tree node, so all you have to do is figure out how to deal with each node individually and Hyperbole takes care of the rest. For now, I would create a command that you can bind to a key and invoke that when you want the highlighting applied unless you want to try using something like pre-command-hook. Bob
