6

The Emacs extension markerpen.el (link text) allows you to hightlight arbitrary regions in your buffer. With this extension, the added highlighting is lost once you kill the buffer though. However, it would be nice to be able to highlight arbitrary regions of a file in a "persistent" way -- in the sense that the added hightlighting is not lost after I close the file.

Do you know of any way I could have such a "persistent" highlighting?

Thanks very much.

falsum
  • 349
  • 1
  • 7
  • An interesting alternative seems to be the fic-mode (http://www.emacswiki.org/emacs/fic-mode.el). This mode is discussed in another stackoverflow question about highlighting in emacs (http://stackoverflow.com/questions/2367611/emacs-highlighting-todo-only-in-comments) – falsum Dec 15 '10 at 07:25

3 Answers3

4

Try enriched-mode.

huaiyuan
  • 26,129
  • 5
  • 57
  • 63
  • Enriched mode is in fact a very interesting mode. However, at least in my case, I noticed that the font lock mode overwrites the faces I try to introduce with the enriched-mode. In this way, it seems to me that I can only have the nice features of the enriched-mode if I turn off the font lock mode. – falsum Dec 15 '10 at 07:19
  • 2
    The link you provided is no longer valid. Try navigating to http://www.emacswiki.org/emacs/EnrichedMode instead – rmiesen Sep 23 '13 at 11:32
  • It's nice to know enriched-mode, but after `M-x enriched-mode`, the menu in `Edit->Text Properties->Face...` of my Emacs is impossible to be enabled, it's grey. Both normal `emacs` or `emacs -q`, I googled, but I couldn't find anything. – CodyChan Dec 30 '14 at 01:59
3

Yes, such a feature does exist. And you can add the highlighting in any number of ways, including sweeping the mouse marker pen-style.

http://www.emacswiki.org/emacs/HighLight#PermanentHighlighting

Drew
  • 29,895
  • 7
  • 74
  • 104
1

At the moment, no feature like this exists, so you'd need to create an extension to markerpen.el which created a metafile containing highlight points in each file that had them. (I'd suggest creating a metafile for each file)

When setting marks, each time one is added to markerpen-overlays you could update the related metafile.

When you load any file, you could check for the existence of the metafile (or when you invoked the markerpen library)

Then load the metafile and create the marks.

ocodo
  • 29,401
  • 18
  • 105
  • 117