Change the color of hl-line in Emacs in the terminal
====================================================
During the last edition of the Old Computer Challenge I used an old
Acer Aspire One 522 POVE6, which I ran without X11 or Xorg.
The small form factor and the low weight make this laptop fine to use,
as long as the workload is not to high, to keep the performance within
reasonable limits.
After the challenge I installed Xorg and run it together with the
ratpoison window manager, Urxvt terminal emulator and Tmux.
I installed the 'normal' Emacs package, but running a graphical Emacs
is too heavy for this laptop, and I reverted to the Emacs-nox package.
Although the keyboard of my X201 is much better and the performance is
totally incomparable with this Acer, I still make regular use of this
laptop, like for reading mail and RSS-feeds with Gnus, writing text in
Emacs and some development in Common Lisp. This phlog post is also
written on it.
Depending on how I start Emacs, it either runs in a separate Urxvt
window, or in a Tmux window (also on Urxvt).
global-hl-line-mode
-------------------
The minor mode hl-line highlights the line where point is in.
In many cases, this is very useful.
For example, when reading RSS feeds, in both the list with the feeds
and the list with the articles within a feed, it is much easier to see
which feed or article will be opened by the Enter-key.
When reading longer texts, like in eww or in Elpher, or writing
proza, it guides the eye and makes it easier to return to where
you were after being distracted.
Acer Aspire Display
-------------------
The display of the Acer Aspire is only 10.1 inch. In Urxvt I have set
the font to 8x13. With this font, the display shows 55 lines of text.
and with two windows opened in Emacs side by side, each window can
show about 80 chars per line.
This represents a workable setup.
Of course, the 8x13 chars on a 10.1 inch display are small, which
makes the option to highlight the current line even more important.
Changing the color of the highlighted line
------------------------------------------
On this laptop, and in an unconfigured Emacs, the highlight is shown
with the text color `white' on a background color `darkolivegreen'. In
my setup up, the text color is black and the background color is
green. Apparently, one of the packages has influenced the color
settings.
Because black on green is hard to read I searched for the option
to change this.
Luckily, even when running a text-mode Emacs, the color setting can be
changed.
The easiest way is to use the build-in `customize' functionality.
`C-h v' followed by `hl-line-face retrieves the documentation of this
face. The documentation shows the link to the customization function
for this face. There you can choose a color for the text and a color
for the background.
At the top of the customize-buffer are three buttons, "revert",
"apply", and "apply and save". Enter on the "apply" button to see how
your selection works. Switch to some other buffers and move the point
up and down to see the new highlight colors in action. Go back to the
customize buffer and either change some settings, or choose "apply
and save" to make the change persistent.
I choose for white text on a blue background and will work with this
for some time, to experience how it works in practice.