[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turning colors off

From: Tim X
Subject: Re: turning colors off
Date: Wed, 13 Feb 2008 18:46:12 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

address@hidden (Karl Berry) writes:

>     I'm having a lot of trouble with recent versions of emacs which try to 
>     use color as a means of syntax highlighting.  
> Me too.  I also wanted to turn off faces (bold, etc.), which look
> especially bad in a tty emacs.
>     I'm sure many people must like this, but I find them illegible
>     mostly due to contrast issues.
> Me too.  
>     Is there some way I can shut this off globally?
> My experience was that (global-font-lock 0) is insufficient to do what I
> want.  (There is a long thread on emacs-devel about it when I reported
> this in August 2007.)
> The best approach for me was suggested by Juri Linkov (, which
> is to explicitly reset all faces, except for the mode line.  Here is the
> code, mostly written by him.  Hope this helps.
> karl
> ;; Kill all faces except mode lines
> (defun my-faces-fix (&optional frame)
>   "Fix defined faces."
>   (interactive)
>   ;; Check if this function is called by `custom-define-hook' from
>   ;; `custom-declare-face' where the variable `face' is bound locally.
>   (when (boundp 'face)
>     (dolist (face (face-list))
>       (unless (string-match "^mode-line" (symbol-name face))
>         ;; Reset all face attributes
>         (modify-face face)))))
> ;;
> ;; 1. Fix existing faces
> (let ((face t)) (my-faces-fix))
> ;;
> ;; 2. Call `my-faces-fix' every time some new face gets defined
> (add-to-list 'custom-define-hook 'my-faces-fix)
> ;; for mode line background under X.
> (set-face-attribute 'mode-line nil :background "white")
> ;; Juri needed this for tty, but I don't seem to:
> ;(set-face-attribute 'mode-line nil :inverse-video t)

What I've found useful is to use lM-x list-colors-display, which will
give you a window showing all the currently defined faces (remembering
that some faces don't get defined until the mode they belong to has been

While in the buffer, you can see the name of the face and a sample of
what it looks like. You can then click on a face with colors you don't
like (e.g. one with bad contrast) and a customize buffer opens for that
face. Set the attributes you want (i.e. weight, slant, foreground,
background etc), save it and now that face will hve the new definition
each time you run emacs. 

Another alternative already mentioned is the color-themes package. It
works quite well. I don't use it becuase there is no theme I like as
much as what I get defining the faces myself. I've thought about
defining a new theme and submitting it to be included, but its low on
the ever growing todo list!



tcross (at) rapttech dot com dot au

reply via email to

[Prev in Thread] Current Thread [Next in Thread]