highlight-context-line

Last edit

Summary: Reflect 2017 rewrite

Changed:

< 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.

to

> 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.
> == Code ==
> See https://github
.com/ska2342/highlight-context-line

Changed:

< Download: [[highlight-context-line.el]]

to

> Install via MELPA.
> M-x package-install
highlight-context-line RET

Changed:

< (load "highlight-context-line.el")
<

to

> (highlight-context-line-mode 1)

Changed:

< 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.
< == Problems ==
< 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.

to

> 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.


Introduction

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.

Motivation

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.

Code

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

Installation

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.