Emacs: persistent highlighting of a region
Asked Answered
K

3

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.

Konstanz answered 11/10, 2010 at 2:14 Comment(1)
An interesting alternative seems to be the fic-mode (emacswiki.org/emacs/fic-mode.el). This mode is discussed in another stackoverflow question about highlighting in emacs (#2368111)Konstanz
T
4

Try enriched-mode.

Thermodynamics answered 11/10, 2010 at 8:4 Comment(3)
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.Konstanz
The link you provided is no longer valid. Try navigating to emacswiki.org/emacs/EnrichedMode insteadPhalanger
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.Simoneaux
P
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

Pogey answered 20/8, 2011 at 21:44 Comment(0)
F
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.

Frontolysis answered 11/10, 2010 at 4:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.