This code provides the ability to ‘scribble’ on top of any buffer. (It has only been tested on a CVS Build of GNU Emacs, but I don’t know of any reason why it shouldn’t work fairly widely).

See Also: MarkerPenPicTwo


Save the file called “markerpen.el” in a directory in your load-path and add (load-library “markerpen”) to your ~/.emacs file. Alternatively if you don’t have much customization of your own and aren’t familiar with load-paths etc, you could just paste the code below straight into your ~/.emacs file.

See also HighlightTemporarily for a comparison of similar libraries.

I think it is rude to ‘define-key’ when the file is loaded.

;; disable global-set-key when loading
(flet ((global-set-key (&rest args)()))
  (require 'markerpen))

To change markerpen with sequence of calls, depends on RepeatKeyDifferentBehaviors.

(defun markerpen-mark-region-seq ()
  "Change markerpen with sequence of calls."
  (flet ((prefix-numeric-value (x) (identity x)))
    (markerpen-mark-region (1+ (seq-times 'markerpen-mark-region-seq 10)))))

I think it is important to state on this page that the markings are not saved with the file. They are only good until the buffer holding the file is exited. That being said it is a nice library. Handy for some quick scribbling.

I think that if you want persist highlights then Bookmark+ provides this functionality. I’m sure that several other of DrewAdams’ [| packages provide this functionality. I generally assume that I need some a clever add-on, I can find a package to do it in DrewsElispLibraries or get it install Icicles as that seems to do everything in one package. – NeilSmithline at June 26, 2011 at 01:42 ET (GMT-04:00)

That is because MarkerPens uses only overlays, not text properties. Library highlight.el also provides marker-pen drag highlighting. If you use highlight.el then you can use either overlay or text-property highlighting, and with the latter you can save the highlighting with the file. – DrewAdams

CategoryFaces HighlightTemporarily