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.


Whoever scrolls in XEmacs using the PgUp and PgDn keys (or C-v and M-v) might be slightly confused and might need a second for orientation. Of course this counts 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 really wonder why I don't see this killer feature more often these days!

So, here we go... After having a short glimpse at XEmacs' Glyphs and Widgets I decided to simply draw the last visible line with a different background color.


Download: highlight-context-line.el

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

     (load "highlight-context-line.el")
     that's it.

Emacs Version

This is working in GNU Emacs and XEmacs.

I've been using it for years in XEmacs and quite a while in Gnu Emacs, too. Since this works somewhere in the subconscious areas of my mind I can't tell whether it works in all circumstances.


I encountered some problems with itimer (responsible for scheduled actions), it simply didn't always work as wished and I didn't understand why. So I switched to using the pre-command-hook like I saw it in the sources of speedbar.el to remove the highlighting again.

Of course I'd prefer a black line across the whole screen. Especially emtpy lines cause problems because there is nothing to give a different background to ;-), although newer versions fontify one more line if the context line is empty.