Log in

No account? Create an account
Who, me? [userpic]

Highlighter pens for Emacs

April 26th, 2012 (06:50 am)

I already mentioned this in siderea's post where she gave me the idea, but:

I've written an extension for Emacs that lets you highlight stretches of text, like with a highlighter pen. It should work in any major mode. Three colors of highlighter; saves and loads when you save and load the file; switch colors with meta-+; highlight the current region with meta-_; or press shift and drag the right mouse button. To erase, set a negative prefix argument; that is, meta-- meta-_ erases all highlights in the current region. For a file /foo/bar/baz.txt, highlights are saved in /foo/bar/.highlights/baz.txt.el.

One caveat: when you copy text, highlights do not go with it. This is because I didn't use the text-properties system (since it's already used by syntax highlighting, and I was concerned about interactions); I used the overlay system. Overlays do take care of moving when you insert and delete text; but you will see some odd behavior when you use transpose commands.

I released it on Github. GPLv2. Let me know if the directions aren't clear, or if it summons eldritch horrors that eat your soul, flay your marshmallows, and swap point and mark.


Posted by: Siderea (siderea)
Posted at: April 26th, 2012 08:59 pm (UTC)

Hurray! Thanks for doing this. I might be back with questions, but it's going to be a little while before I can try this out. I'm still moving in to my new hosting environment (they JUST got spamassassin unborked for me).

Posted by: Who, me? (metageek)
Posted at: April 27th, 2012 12:23 pm (UTC)

Yeah, I thought that might be the case. No worries. (I also thought you might not have gotten any notifications, with the "no LJ email on old posts" bug metahacker mentioned, which is part of why I posted separately.)

2 Read Comments