问题
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.
回答1:
Try enriched-mode.
回答2:
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
回答3:
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.
来源:https://stackoverflow.com/questions/3903137/emacs-persistent-highlighting-of-a-region