>>> David Wallin <david.wallin@...> seems to think that:
>Hi,
>
>I've been thinking about using the incremental parser in semantic to color code
>the different nesting levels in LISP, or any language for that matter, where it
>makes sense.
>
>An example of what I mean can be seen here:
>
>http://jennifermadden.com/scripts/vrs.png
>http://www.foldr.org/~michaelw/emacs/color-box.png
>
>The last one seem to do exactly what I want apart from not updating color boxes
>while editing.
>
>However, digging through semantics code, it's not obvious to me whether this is
>actually possible to do. Any ideas? Am I on the wrong track here?
[ ... ]
Hi,
The ideal way to do the decorations you are looking at is with
`semantic-decoration-mode' in semantic-decorate-mode.el. In the
senator menu, there is a 'Tag Decorations' sub-menu with three
alternate modes in it, one of which puts the over-line in front of
large tags. Two others highlight tags based on protected/private
attributes in a class.
This mode will handle the overlay management for you, so all you
need to do is define where secondary overlays go. It also only calls
your functions when code in a tag changes, and is fully parseable.
For doing the work you want, there is no parsing inside function
bodies, so there is nothing there you could use to determine where to
put the highlighting. There are API's in semantic-ctxt for local
navigation including `semantic-beginning-of-context' (where a context
signifies some block of code.) and a few others. No 'down' though,
mostly because it was for figuring out where the cursor is.
Good Luck
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
|