This package helps you with your orientation when you are scrolling full screens (using PgUp and PgDn) by colorizing the last visible line before you scrolled.


This started back in 2002 when we didn't have Okular or Evince but gv was a pretty good reader for Postscript documents.

Sometimes, when I scroll in Emacs using PgUp and PgDn (or C-v and M-v) I need a second for orientation. Where is my cursor now? Where have I been before.

Of course this is true for several other programms as well, like xterm, but not so for gv. Why is this so? The postscript viewer gv draws a black line where the boundary of the last displayed fracture of the page was. I found that very helpful and wonder why it wasn't widely adopted.

This Emacs package mimicks the behavior found in gv and highlights the line that was at the edge of your window before you scrolled.


See https://github.com/ska2342/highlight-context-line


Install via MELPA.

  M-x package-install highlight-context-line RET

Put into your init file (.emacs or .xemacs/init.el or personal.el):

     (highlight-context-line-mode 1)

that's it.

Emacs Version

This works in GNU Emacs >24, maybe older versions, too.

Since the 2017 rewrite XEmacs is not supported anymore. Sorry. You can still use the old 1.5 version (get from source repo or download here highlight-context-line.el) which is less good looking and sometimes a bit ugly. But it was good enough for me for 14+ years.