[Top][All Lists]

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

Re: turning colors off

From: Karl Berry
Subject: Re: turning colors off
Date: Tue, 12 Feb 2008 18:08:21 -0600

    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.


;; Kill all faces except mode lines
(defun my-faces-fix (&optional frame)
  "Fix defined faces."
  ;; 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)

reply via email to

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