Fri, 03 Jun 2016 23:44:44 +0200

> Certain keywords display with an unreadable
> dark blue, on a black background. Like:
> getopts or echo or source, with emacs mode
> Shell-script[bash]. Other things are too dark
> in sql-mode: SQL[ansi]
> Is it best to change the dark blue in PuTTY
> settings or in emacs?


Start by setting up the terminal colors.

It is a good help to have a test function to
output all colors.

For example the below zsh. Here is a dump what
it shows for me:

Then get the colors right. I don't know how to
do that for PuTTY - for the Linux VTs and
X (e.g., xterm) tho there are some material

After you have done this, nine out of ten
colors in Emacs should look good. If you see
one that doesn't, place point at it and use
this function to find out what face it is:

    (defun what-face (pos)
      (interactive "d")
      (let((face (or (get-char-property pos 'face)
                     (get-char-property pos 'read-cf-name) )))
        (message " Face: %s" (or face "(no face!)")) ))

Then re-assign the face some other color which
is better in that context.

Oh, the zsh - change into bash if needed:

set-fg-color () { tput setaf $1 } # color ($1) is 0-7
set-bg-color () { tput setab $1 }
set-bold     () { tput bold }
reset-color  () { tput sgr0 }

test-colors () {
    local color_number
    local color

    local -a color_names
    color_names=(black red green yellow blue magenta cyan white)

    for color_number in {0..7}; do
        echo -n "   $color_number   "
        set-fg-color $color_number
        color=$color_names[(( $color_number + 1 ))]
        echo -n $color "	"; tput bold; echo $color

From the file:

Good luck!

Back to Blogomatic.