unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: turning colors off
Date: Wed, 13 Feb 2008 18:46:12 +1100	[thread overview]
Message-ID: <87prv1ti2j.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.7360.1202878396.18990.help-gnu-emacs@gnu.org

karl@freefriends.org (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 (jurta.org), 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
loaded). 

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!

HTH

Tim

-- 
tcross (at) rapttech dot com dot au


       reply	other threads:[~2008-02-13  7:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.7360.1202878396.18990.help-gnu-emacs@gnu.org>
2008-02-13  7:46 ` Tim X [this message]
2008-02-13 15:19   ` turning colors off Drew Adams
     [not found]   ` <mailman.7371.1202915992.18990.help-gnu-emacs@gnu.org>
2008-02-14  9:18     ` Tim X
     [not found] <mailman.7313.1202795603.18990.help-gnu-emacs@gnu.org>
2008-02-12 16:02 ` Joel J. Adamson
2008-02-12 16:47   ` Bastien Guerry
2008-02-14 19:52 ` Stefan Monnier
2008-02-11 21:25 Rich Pixley
2008-02-12  6:31 ` Drew Adams
2008-02-13  0:08 ` Karl Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87prv1ti2j.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).