emacs-devel
[Top][All Lists]
Advanced

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

indistinguishable faces


From: Sam Steingold
Subject: indistinguishable faces
Date: 07 Dec 2000 11:15:08 -0500

I asked on the Usenet:
-----------------------------------------------------------------
Often I find that some faces, such as `bold', `italic', `bold-italic' &c
are indistinguishable from `default'.
I can use (set-face-foreground 'bold "red") to fix `bold', but this is
no help since there are plenty of faces, like `gnus-emphasis-bold',
which have to be hunted down and fixed separately.

Is there a way to tell Emacs to display the bold attribute of a face as
color?

(I prefer a lisp solution to an xrdb one since I use Emacs on both X and
w32). 
-----------------------------------------------------------------
Eli Zaretskii replied that there is no way to do this.

What about using this (in, say, faces.el):

(defvar font-add-color-alist '((bold . "red") (italic . "maroon")
                               (bold-italic . "magenta"))
  "*The alist of fonts and colors for `font-add-color'.")

(defun font-add-colors ()
  "Add `foreground-color' to some fonts using `font-add-color-alist'."
  (interactive)
  (let ((all-faces (apropos-internal "" 'facep))
        (bold (cdr (assq 'bold font-add-color-alist)))
        (italic (cdr (assq 'italic font-add-color-alist)))
        (bold-italic (cdr (assq 'bold-italic font-add-color-alist))))
    (when bold
      (dolist (face all-faces)
        (when (and (face-bold-p face)
                   (not (face-italic-p face))
                   (not (face-foreground face)))
          (set-face-foreground face bold))))
    (when italic
      (dolist (face all-faces)
        (when (and (face-italic-p face)
                   (not (face-bold-p face))
                   (not (face-foreground face)))
          (set-face-foreground face italic))))
    (when bold-italic
      (dolist (face all-faces)
        (when (and (face-bold-p face)
                   (face-italic-p face)
                   (not (face-foreground face)))
          (set-face-foreground face bold-italic))))))


-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arabs leaders say to their people on http://www.memri.org/
Press any key to continue or any other key to quit.




reply via email to

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