unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* supporting more faces on 256 colors xterms
@ 2004-02-08  4:13 Dan Nicolaescu
  2004-02-08  6:08 ` Eli Zaretskii
  2004-02-09  9:38 ` Richard Stallman
  0 siblings, 2 replies; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-08  4:13 UTC (permalink / raw)


Hi!

I am looking for a way to add support for faces on 256 colors xterms. 
Specifically, it would be nice to be able to have the save colors for
the standard emacs predefined faces when running on X11 or using -nw
on a 256 colors xterm. 

Eli Zaretskii suggested adding another face specifier `nrcolors>='. 
`nrcolors>=' can be used in `defface' to have common face specifications
for 256 colors xterms and color X11.

For example `font-lock-comment-face' could be changed to look like
this: 

(defface font-lock-comment-face
  '((((class color) (colornr>= 256) (background light))
     (:foreground "Firebrick"))
    (((class color) (colornr>= 256) (background dark))
     (:foreground "chocolate1"))
    (((class color) (colornr>= 8) (background light)) (:foreground "red"))
    (((class color) (colornr>= 8) (background dark)) (:foreground "red1"))
    (((class grayscale) (background light))
     (:foreground "DimGray" :weight bold :slant italic))
    (((class grayscale) (background dark))
     (:foreground "LightGray" :weight bold :slant italic))
    (t (:weight bold :slant italic)))
  "Font Lock mode face used to highlight comments."
  :group 'font-lock-highlighting-faces)


Implementing the nrcolors>= specifier needs just the following 2 line patch:
(+ some docs)

*** faces.el~   Tue Oct 14 13:20:17 2003
--- faces.el    Sat Feb  7 19:59:00 2004
*************** If FRAME is nil, the current FRAME is us
*** 1314,1319 ****
--- 1314,1321 ----
                                  (not (featurep 'motif)))
                             (and (memq 'x-toolkit options)
                                  (featurep 'x-toolkit))))
+                       ((eq req 'colornr>=)
+                        (>= (display-color-cells) (car options)))
                        ((eq req 'class)
                         (memq (frame-parameter frame 'display-type) options))
                        ((eq req 'background)

Next step would be to make xterm.el understand color names, currently
xterm.el generates color names that look like "color-XXX".

I tried to use the color names from `color-name-rgb-alist' using the
following patch:


*** xterm.el~   Tue Oct 14 13:21:55 2003
--- xterm.el    Sat Feb  7 19:27:40 2004
*************** versions of xterm."
*** 143,158 ****
        (cond
         ((= ncolors 240)       ; 256-color xterm
        ;; 216 non-gray colors first
!       (let ((r 0) (g 0) (b 0))
          (while (> ncolors 24)
            ;; This and other formulae taken from 256colres.pl and
            ;; 88colres.pl in the xterm distribution.
!           (tty-color-define (format "color-%d" (- 256 ncolors))
!                             (- 256 ncolors)
!                             (mapcar 'xterm-rgb-convert-to-16bit
!                                     (list (round (* r 42.5))
!                                           (round (* g 42.5))
!                                           (round (* b 42.5)))))
            (setq b (1+ b))
            (if (> b 5)
                (setq g (1+ g)
--- 143,164 ----
        (cond
         ((= ncolors 240)       ; 256-color xterm
        ;; 216 non-gray colors first
!       (let ((r 0) (g 0) (b 0) colortriplet colorname)
          (while (> ncolors 24)
            ;; This and other formulae taken from 256colres.pl and
            ;; 88colres.pl in the xterm distribution.
!           (setq colortriplet 
!                 (mapcar 'xterm-rgb-convert-to-16bit
!                         (list (round (* r 42.5))
!                               (round (* g 42.5))
!                               (round (* b 42.5))))
!                 colorname (car (rassoc colortriplet color-name-rgb-alist)))
!           (message "%s %s" colortriplet colorname)
!           (tty-color-define 
!            (if colorname
!                colorname 
!              (format "color-%d" (- 256 ncolors)))
!              (- 256 ncolors) colortriplet)
            (setq b (1+ b))
            (if (> b 5)
                (setq g (1+ g)

but this does not seem to work,  only "navy"  and "gray83" are found
by rassoc... 

Any advice on how to proceed with all these would be appreciated. 

I know there is another xterm mutant that supports 88 colors, that
one can be probably treated the same way as a 256 colors one. 

Thanks.

        --dan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08  4:13 supporting more faces on 256 colors xterms Dan Nicolaescu
@ 2004-02-08  6:08 ` Eli Zaretskii
  2004-02-08  8:15   ` Dan Nicolaescu
  2004-02-09  9:38 ` Richard Stallman
  1 sibling, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-08  6:08 UTC (permalink / raw)
  Cc: emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Sat, 07 Feb 2004 20:13:19 -0800
> 
> Eli Zaretskii suggested adding another face specifier `nrcolors>='. 
> `nrcolors>=' can be used in `defface' to have common face specifications
> for 256 colors xterms and color X11.

Actually, I suggested `ncolors>=' etc., but I'm known to be a bad
player of the naming game.

> Next step would be to make xterm.el understand color names, currently
> xterm.el generates color names that look like "color-XXX".

Sorry, I don't see why is this needed.  tty-colors.el should already
cause Emacs to find the nearest color-ZZZ that approximates every X
color best.  What am I missing?

> I know there is another xterm mutant that supports 88 colors, that
> one can be probably treated the same way as a 256 colors one. 

The CVS version of xterm.el should support both of them (and also the
16-color variety) already.  Doesn't it?

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08  6:08 ` Eli Zaretskii
@ 2004-02-08  8:15   ` Dan Nicolaescu
  2004-02-08 13:45     ` Andreas Schwab
  2004-02-08 18:35     ` Eli Zaretskii
  0 siblings, 2 replies; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-08  8:15 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii <eliz@elta.co.il> writes:

  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Sat, 07 Feb 2004 20:13:19 -0800
  > > 
  > > Eli Zaretskii suggested adding another face specifier `nrcolors>='. 
  > > `nrcolors>=' can be used in `defface' to have common face specifications
  > > for 256 colors xterms and color X11.
  > 
  > Actually, I suggested `ncolors>=' etc., but I'm known to be a bad
  > player of the naming game.

IMHO, the name is OK, it was just a typo. If there's any other
suggestion we can change it before the patch is checked in. 

Can we get an agreement that adding this new face specifier NCOLORS>=
is the way to go? When we do, I will prepare a patch for the default and
font-lock deffaces to take advantage of NCOLORS>=.
I can see

  > > Next step would be to make xterm.el understand color names, currently
  > > xterm.el generates color names that look like "color-XXX".
  > 
  > Sorry, I don't see why is this needed.  tty-colors.el should already
  > cause Emacs to find the nearest color-ZZZ that approximates every X
  > color best.  What am I missing?

Nothing, I was confused. I thought that only colors that can be seen
when doing M-x list-colors-display can be used for faces. Good
nothing to worry in this are then. 

  > > I know there is another xterm mutant that supports 88 colors, that
  > > one can be probably treated the same way as a 256 colors one. 
  > 
  > The CVS version of xterm.el should support both of them (and also the
  > 16-color variety) already.  Doesn't it?

It does. Do we want another NCOLORS>= bracket for 88 color xterms?
IMHO no.

Thanks.

        --dan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08  8:15   ` Dan Nicolaescu
@ 2004-02-08 13:45     ` Andreas Schwab
  2004-02-08 18:24       ` Eli Zaretskii
  2004-02-08 18:35     ` Eli Zaretskii
  1 sibling, 1 reply; 23+ messages in thread
From: Andreas Schwab @ 2004-02-08 13:45 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> Eli Zaretskii <eliz@elta.co.il> writes:
>
>   > > From: Dan Nicolaescu <dann@ics.uci.edu>
>   > > Date: Sat, 07 Feb 2004 20:13:19 -0800
>   > > 
>   > > Eli Zaretskii suggested adding another face specifier `nrcolors>='. 
>   > > `nrcolors>=' can be used in `defface' to have common face specifications
>   > > for 256 colors xterms and color X11.
>   > 
>   > Actually, I suggested `ncolors>=' etc., but I'm known to be a bad
>   > player of the naming game.
>
> IMHO, the name is OK, it was just a typo. If there's any other
> suggestion we can change it before the patch is checked in. 

How about min-colors?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08 13:45     ` Andreas Schwab
@ 2004-02-08 18:24       ` Eli Zaretskii
  2004-02-08 19:11         ` Andreas Schwab
  2004-02-08 23:52         ` Dan Nicolaescu
  0 siblings, 2 replies; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-08 18:24 UTC (permalink / raw)
  Cc: dann, emacs-devel

> From: Andreas Schwab <schwab@suse.de>
> Date: Sun, 08 Feb 2004 14:45:28 +0100
> 
> How about min-colors?

Okay, but what to do with the opposite clause, `ncolors<='?  That
would be handy for color-challenged devices.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08  8:15   ` Dan Nicolaescu
  2004-02-08 13:45     ` Andreas Schwab
@ 2004-02-08 18:35     ` Eli Zaretskii
  1 sibling, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-08 18:35 UTC (permalink / raw)
  Cc: emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Sun, 08 Feb 2004 00:15:06 -0800
> 
> Can we get an agreement that adding this new face specifier NCOLORS>=
> is the way to go?

Obviously, I agree.  Please wait for a day or two for the other
developers, including Richard Stallman, to respond.

>   > The CVS version of xterm.el should support both of them (and also the
>   > 16-color variety) already.  Doesn't it?
> 
> It does. Do we want another NCOLORS>= bracket for 88 color xterms?
> IMHO no.

I suspect that 88 colors should be enough to support all the default
faces nicely.  So (assuming this idea gets approved) perhaps using 88
_instead_ of 256 would be good enough.

That would leave us with 16-color terminals, which include the
16-color xterm, rxvt, and the MS-Windows and MS-DOS terminals; and
with 8-color terminals.

What to do with the number of colors between 88 and 16, I don't know.
Perhaps for now just let that behave like 16-color terminals, since we
don't have such devices (AFAIK).

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08 18:24       ` Eli Zaretskii
@ 2004-02-08 19:11         ` Andreas Schwab
  2004-02-08 23:19           ` Miles Bader
  2004-02-08 23:52         ` Dan Nicolaescu
  1 sibling, 1 reply; 23+ messages in thread
From: Andreas Schwab @ 2004-02-08 19:11 UTC (permalink / raw)
  Cc: dann, emacs-devel

"Eli Zaretskii" <eliz@elta.co.il> writes:

>> From: Andreas Schwab <schwab@suse.de>
>> Date: Sun, 08 Feb 2004 14:45:28 +0100
>> 
>> How about min-colors?
>
> Okay, but what to do with the opposite clause, `ncolors<='?  That
> would be handy for color-challenged devices.

Wouldn't max-colors fit?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08 19:11         ` Andreas Schwab
@ 2004-02-08 23:19           ` Miles Bader
  0 siblings, 0 replies; 23+ messages in thread
From: Miles Bader @ 2004-02-08 23:19 UTC (permalink / raw)
  Cc: Eli Zaretskii, dann, emacs-devel

On Sun, Feb 08, 2004 at 08:11:36PM +0100, Andreas Schwab wrote:
> >> How about min-colors?
> 
> Wouldn't max-colors fit?

I like `max-colors' and `min-colors' better.

-Miles
-- 
��������������������

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08 18:24       ` Eli Zaretskii
  2004-02-08 19:11         ` Andreas Schwab
@ 2004-02-08 23:52         ` Dan Nicolaescu
  2004-02-09  6:03           ` Eli Zaretskii
  1 sibling, 1 reply; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-08 23:52 UTC (permalink / raw)
  Cc: Andreas Schwab, emacs-devel

"Eli Zaretskii" <eliz@elta.co.il> writes:

  > > From: Andreas Schwab <schwab@suse.de>
  > > Date: Sun, 08 Feb 2004 14:45:28 +0100
  > > 
  > > How about min-colors?
  > 
  > Okay, but what to do with the opposite clause, `ncolors<='?  That
  > would be handy for color-challenged devices.

We don't really need both `ncolors>=' and `ncolors<=', `ncolors>=' (or
whatever we decide to call it) is enough. 

Ordering the `ncolors>=' clauses in decreasing order should be enough.
Example:

(defface foo-face
  '((((class color)(ncolors>= 88)) (:foreground "Firebrick"))
    (((class color)(ncolors>= 16)) (:foreground "red"))
    (t (:weight bold :slant italic)))
  "Foo."
  :group 'foo)


The screenshot at http://www.ics.uci.edu/~dann/emacs.jpg
shows of 2 emacs sessions:
emacs -nw -q --no-site-file
emacs  -q --no-site-file&
that show the font-lock faces changed to use the ncolors>= attribute.

As for the name. I would vote for `min-colors'. 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08 23:52         ` Dan Nicolaescu
@ 2004-02-09  6:03           ` Eli Zaretskii
  2004-02-12 22:13             ` Dan Nicolaescu
  0 siblings, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-09  6:03 UTC (permalink / raw)
  Cc: schwab, emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Sun, 08 Feb 2004 15:52:36 -0800
> 
> We don't really need both `ncolors>=' and `ncolors<=', `ncolors>=' (or
> whatever we decide to call it) is enough. 

Perhaps that's true, but implementing both is trivial, and there
could be some situations where we might want that.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-08  4:13 supporting more faces on 256 colors xterms Dan Nicolaescu
  2004-02-08  6:08 ` Eli Zaretskii
@ 2004-02-09  9:38 ` Richard Stallman
  2004-02-12 18:40   ` small grep.el fix Dan Nicolaescu
  1 sibling, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2004-02-09  9:38 UTC (permalink / raw)
  Cc: emacs-devel

    Eli Zaretskii suggested adding another face specifier `nrcolors>='. 

That name is really ugly.  If we go with this idea, please call it
`colors' or `color-count'.  (I don't know whether there is a better
approach.)

^ permalink raw reply	[flat|nested] 23+ messages in thread

* small grep.el fix
  2004-02-09  9:38 ` Richard Stallman
@ 2004-02-12 18:40   ` Dan Nicolaescu
  2004-02-15 13:13     ` Thien-Thi Nguyen
  0 siblings, 1 reply; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-12 18:40 UTC (permalink / raw)


It seems that there's a typo in grep.el, it uses
executable-command-find-unix-p, that does not exist instead of
executable-command-find-posix-p. 

It seems to be the result of this checkin:

2004-01-29  Jari Aalto  <jari.aalto@poboxes.com>

	* progmodes/executable.el (executable-command-find-posix-p):
	New.  Check if find handles arguments Posix-style.

	* progmodes/grep.el (grep-compute-defaults):
	Use executable-command-find-posix-p.
	(grep-find): Check `grep-find-command'.

Can somebody please apply this patch? 


2004-02-12  Dan Nicolaescu  <dann@ics.uci.edu>

	* progmodes/grep.el (grep-compute-defaults): Fix typos.

*** grep.el.~1.6.~	Mon Feb  9 23:56:10 2004
--- grep.el	Thu Feb 12 10:39:28 2004
***************
*** 318,326 ****
  	      'gnu)))
    (unless grep-find-command
      (setq grep-find-command
!           (cond ((not (executable-command-find-unix-p "find"))
  		 (message
! 		  (concat "compile.el: Unix type find(1) not found. "
  			  "Please set `grep-find-command'."))
  		 nil)
  		((eq grep-find-use-xargs 'gnu)
--- 318,326 ----
  	      'gnu)))
    (unless grep-find-command
      (setq grep-find-command
!           (cond ((not (executable-command-find-posix-p "find"))
  		 (message
! 		  (concat "compile.el: Posix type find(1) not found. "
  			  "Please set `grep-find-command'."))
  		 nil)
  		((eq grep-find-use-xargs 'gnu)

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-09  6:03           ` Eli Zaretskii
@ 2004-02-12 22:13             ` Dan Nicolaescu
  2004-02-13  8:57               ` Eli Zaretskii
                                 ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-12 22:13 UTC (permalink / raw)
  Cc: schwab, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

Eli Zaretskii <eliz@elta.co.il> writes:

  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Sun, 08 Feb 2004 15:52:36 -0800
  > > 
  > > We don't really need both `ncolors>=' and `ncolors<=', `ncolors>=' (or
  > > whatever we decide to call it) is enough. 
  > 
  > Perhaps that's true, but implementing both is trivial, and there
  > could be some situations where we might want that.

IMHO, `min-colors' should be enough, what situations do you have in
mind that would need `max-colors' too?. Because it's trivial to
implement, we can add it whenever the need arises. It's easier to add
features that to add features that to remove unneeded features.  

But in order to expedite the process of getting this patch in, and
because I don't have strong feelings about this, I implemented both
versions, both attached as separate patches. Just pick one.

Of all options, `min-colors' seemed the best name, so that is what is
used in the patches.

The default faces and the font-lock faces have been changed to take
advantage of `min-colors'. These faces look very similar now on a 256
colors xterm and on X11.

If the patch is OK, please check it in. If anything else is needed
please let me know. 

Thanks. 
                --dan


[-- Attachment #2: Patch that implements only min-colors --]
[-- Type: text/plain, Size: 19105 bytes --]

For the etc/NEWS file, I don't know where this would fit, so it's not
a patch.

A new attribute `min-colors' has been added to the `defface' face
specification language. It is used to specify the face characteristics
depending on the number of colors supported by the display.


lisp/ChangeLog
2004-02-12  Dan Nicolaescu  <dann@ics.uci.edu>

	* faces.el (face-spec-set-match-display): Add a new  attribute,
	`min-colors'. 
	(region, highlight, secondary-selection): Use `min-colors`.

	* custom.el (defface): Add documentation for `min-colors'.

	* font-lock.el (font-lock-comment-face, font-lock-string-face,
	font-lock-keyword-face, font-lock-function-name-face,
	font-lock-variable-name-face, font-lock-constant-face): Use
	`min-colors`.

	* isearch.el (isearch, isearch-lazy-highlight-face): Use
	`min-colors'. 

lispref/ChangeLog

2004-02-12  Dan Nicolaescu  <dann@ics.uci.edu>

	* display.texi (Defining Faces): Add description for min-colors.


Index: lisp/faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.280
diff -c -3 -p -r1.280 faces.el
*** lisp/faces.el	1 Sep 2003 15:45:11 -0000	1.280
--- lisp/faces.el	12 Feb 2004 21:42:10 -0000
*************** If FRAME is nil, the current FRAME is us
*** 1314,1319 ****
--- 1314,1321 ----
  				  (not (featurep 'motif)))
  			     (and (memq 'x-toolkit options)
  				  (featurep 'x-toolkit))))
+ 			((eq req 'min-colors)
+ 			 (>= (display-color-cells frame) (car options)))
  			((eq req 'class)
  			 (memq (frame-parameter frame 'display-type) options))
  			((eq req 'background)
*************** created."
*** 1892,1905 ****
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((type tty) (class color))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
-     (((class color) (background dark))
-      :background "blue3")
-     (((class color) (background light))
-      :background "lightgoldenrod2")
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
--- 1894,1907 ----
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((class color) (min-colors 88) (background dark))
!      :background "blue3")
!     (((class color) (min-colors 88) (background light))
!      :background "lightgoldenrod2")
!     (((class color) (min-colors 8))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
*************** created."
*** 1990,2013 ****
  
  
  (defface highlight
!   '((((type tty) (class color))
!      :background "green" :foreground "black")
!     (((class color) (background light))
       :background "darkseagreen2")
!     (((class color) (background dark))
       :background "darkolivegreen")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((type tty) (class color))
!      :background "cyan" :foreground "black")
!     (((class color) (background light))
       :background "yellow")
!     (((class color) (background dark))
       :background "SkyBlue4")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
--- 1992,2015 ----
  
  
  (defface highlight
!   '((((class color) (min-colors 88) (background light))
       :background "darkseagreen2")
!     (((class color) (min-colors 88) (background dark))
       :background "darkolivegreen")
+     (((class color) (min-colors 8))
+      :background "green" :foreground "black")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((class color) (min-colors 88) (background light))
       :background "yellow")
!     (((class color) (min-colors 88) (background dark))
       :background "SkyBlue4")
+     (((class color) (min-colors 8))
+      :background "cyan" :foreground "black")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
Index: lisp/custom.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/custom.el,v
retrieving revision 1.70
diff -c -3 -p -r1.70 custom.el
*** lisp/custom.el	29 Dec 2003 11:53:19 -0000	1.70
--- lisp/custom.el	12 Feb 2004 21:42:10 -0000
*************** following REQ are defined:
*** 306,311 ****
--- 306,315 ----
  `background' (what color is used for the background text)
    Should be one of `light' or `dark'.
  
+ `min-colors' (the minimum number of colors the frame should support)
+   Should be an integer, it is compared with the result of
+   `display-color-cells'.
+ 
  Read the section about customization in the Emacs Lisp manual for more
  information."
    ;; It is better not to use backquote in this file,
Index: lisp/font-lock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/font-lock.el,v
retrieving revision 1.214
diff -c -3 -p -r1.214 font-lock.el
*** lisp/font-lock.el	26 Jan 2004 23:03:43 -0000	1.214
--- lisp/font-lock.el	12 Feb 2004 21:42:11 -0000
*************** Sets various variables using `font-lock-
*** 1560,1583 ****
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((type tty pc) (class color) (background light)) (:foreground "red"))
!     (((type tty pc) (class color) (background dark)) (:foreground "red1"))
!     (((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "Firebrick"))
!     (((class color) (background dark)) (:foreground "chocolate1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (background light)) (:foreground "RosyBrown"))
!     (((class color) (background dark)) (:foreground "LightSalmon"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
--- 1560,1587 ----
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) 
!      (:foreground "Firebrick"))
!     (((class color) (min-colors 88) (background dark)) 
!      (:foreground "chocolate1"))
!     (((class color) (min-colors 8) (background light)) 
!      (:foreground "red"))
!     (((class color) (min-colors 8) (background dark)) 
!      (:foreground "red1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "RosyBrown"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSalmon"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
*************** Sets various variables using `font-lock-
*** 1588,1658 ****
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Purple"))
!     (((class color) (background dark)) (:foreground "Cyan"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((type tty) (class color)) (:foreground "blue" :weight light))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Orchid"))
!     (((class color) (background dark)) (:foreground "LightSteelBlue"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((type tty) (class color)) (:foreground "blue" :weight bold))
!     (((class color) (background light)) (:foreground "Blue"))
!     (((class color) (background dark)) (:foreground "LightSkyBlue"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((type tty) (class color)) (:foreground "yellow" :weight light))
!     (((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (background dark)) (:foreground "LightGoldenrod"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "ForestGreen"))
!     (((class color) (background dark)) (:foreground "PaleGreen"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((type tty) (class color)) (:foreground "magenta"))
!     (((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (background light)) (:foreground "CadetBlue"))
!     (((class color) (background dark)) (:foreground "Aquamarine"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((type tty) (class color)) (:foreground "red"))
!     (((class color) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (background dark)) (:foreground "Pink" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
--- 1592,1662 ----
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Cyan"))
!     (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Orchid"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Blue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
!     (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
!     (((class color) (min-colors 8)) (:foreground "magenta"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
!     (((class color) (min-colors 8)) (:foreground "red"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.223
diff -c -3 -p -r1.223 isearch.el
*** lisp/isearch.el	1 Nov 2003 17:00:02 -0000	1.223
--- lisp/isearch.el	12 Feb 2004 21:42:11 -0000
*************** A value of nil means highlight all match
*** 2128,2153 ****
    :group 'isearch)
  
  (defface isearch
!   '((((type tty pc) (class color))
!      (:background "magenta4" :foreground "cyan1"))
!     (((class color) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((type tty pc) (class color))
!      (:background "turquoise3"))
!     (((class color) (background light))
       (:background "paleturquoise"))
!     (((class color) (background dark))
       (:background "paleturquoise4"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)
--- 2128,2153 ----
    :group 'isearch)
  
  (defface isearch
!   '((((class color) (min-colors 88) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (min-colors 88) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
+     (((class color) (min-colors 8))
+      (:background "magenta4" :foreground "cyan1"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((class color) (min-colors 88) (background light))
       (:background "paleturquoise"))
!     (((class color) (min-colors 88) (background dark))
       (:background "paleturquoise4"))
+     (((class color) (min-colors 8))
+      (:background "turquoise3"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)
Index: lispref/display.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/display.texi,v
retrieving revision 1.112
diff -c -3 -p -r1.112 display.texi
*** lispref/display.texi	6 Feb 2004 09:23:38 -0000	1.112
--- lispref/display.texi	12 Feb 2004 21:42:11 -0000
*************** What kinds of colors the frame supports-
*** 1613,1618 ****
--- 1613,1622 ----
  @item background
  The kind of background---either @code{light} or @code{dark}.
  
+ @item min-colors
+ An integer that represents the minimum number of colors the frame should
+ support, it is compared with the result of @code{display-color-cells}.
+ 
  @item supports
  Whether or not the frame can display the face attributes given in
  @var{value}@dots{} (@pxref{Face Attributes}).  See the documentation

[-- Attachment #3: Patch that implements both min-colors and max-colors --]
[-- Type: text/plain, Size: 19586 bytes --]

For the etc/NEWS file, I don't know where this would fit, so it's not
a patch.

New attributes `min-colors' adn `max-colors' have been added to the
`defface' face specification language. They are used to specify the
face characteristics depending on the number of colors supported by
the display.

lisp/ChangeLog
2004-02-12  Dan Nicolaescu  <dann@ics.uci.edu>

	* faces.el (face-spec-set-match-display): Add a new attributes,
	`min-colors' and `max-colors'. 
	(region, highlight, secondary-selection): Use `min-colors`.

	* custom.el (defface): Add documentation for `min-colors' and
	`max-colors`.

	* font-lock.el (font-lock-comment-face, font-lock-string-face,
	font-lock-keyword-face, font-lock-function-name-face,
	font-lock-variable-name-face, font-lock-constant-face): Use
	`min-colors`.

	* isearch.el (isearch, isearch-lazy-highlight-face): Use
	`min-colors'. 
	
lispref/ChangeLog
2004-02-12  Dan Nicolaescu  <dann@ics.uci.edu>

	* display.texi (Defining Faces): Add description for min-colors
	and max-colors.

Index: lisp/faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.280
diff -c -3 -p -r1.280 faces.el
*** lisp/faces.el	1 Sep 2003 15:45:11 -0000	1.280
--- lisp/faces.el	12 Feb 2004 21:48:47 -0000
*************** If FRAME is nil, the current FRAME is us
*** 1314,1319 ****
--- 1314,1323 ----
  				  (not (featurep 'motif)))
  			     (and (memq 'x-toolkit options)
  				  (featurep 'x-toolkit))))
+ 			((eq req 'min-colors)
+ 			 (>= (display-color-cells frame) (car options)))
+ 			((eq req 'max-colors)
+ 			 (<= (display-color-cells frame) (car options)))
  			((eq req 'class)
  			 (memq (frame-parameter frame 'display-type) options))
  			((eq req 'background)
*************** created."
*** 1892,1905 ****
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((type tty) (class color))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
-     (((class color) (background dark))
-      :background "blue3")
-     (((class color) (background light))
-      :background "lightgoldenrod2")
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
--- 1896,1909 ----
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((class color) (min-colors 88) (background dark))
!      :background "blue3")
!     (((class color) (min-colors 88) (background light))
!      :background "lightgoldenrod2")
!     (((class color) (min-colors 8))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
*************** created."
*** 1990,2013 ****
  
  
  (defface highlight
!   '((((type tty) (class color))
!      :background "green" :foreground "black")
!     (((class color) (background light))
       :background "darkseagreen2")
!     (((class color) (background dark))
       :background "darkolivegreen")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((type tty) (class color))
!      :background "cyan" :foreground "black")
!     (((class color) (background light))
       :background "yellow")
!     (((class color) (background dark))
       :background "SkyBlue4")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
--- 1994,2017 ----
  
  
  (defface highlight
!   '((((class color) (min-colors 88) (background light))
       :background "darkseagreen2")
!     (((class color) (min-colors 88) (background dark))
       :background "darkolivegreen")
+     (((class color) (min-colors 8))
+      :background "green" :foreground "black")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((class color) (min-colors 88) (background light))
       :background "yellow")
!     (((class color) (min-colors 88) (background dark))
       :background "SkyBlue4")
+     (((class color) (min-colors 8))
+      :background "cyan" :foreground "black")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
Index: lisp/custom.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/custom.el,v
retrieving revision 1.70
diff -c -3 -p -r1.70 custom.el
*** lisp/custom.el	29 Dec 2003 11:53:19 -0000	1.70
--- lisp/custom.el	12 Feb 2004 21:48:47 -0000
*************** following REQ are defined:
*** 306,311 ****
--- 306,319 ----
  `background' (what color is used for the background text)
    Should be one of `light' or `dark'.
  
+ `min-colors' (the minimum number of colors the frame should support)
+   Should be an integer, it is compared with the result of
+   `display-color-cells'.
+ 
+ `max-colors' (the maximum number of colors the frame should support)
+   Should be an integer, it is compared with the result of
+   `display-color-cells'.
+ 
  Read the section about customization in the Emacs Lisp manual for more
  information."
    ;; It is better not to use backquote in this file,
Index: lisp/font-lock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/font-lock.el,v
retrieving revision 1.214
diff -c -3 -p -r1.214 font-lock.el
*** lisp/font-lock.el	26 Jan 2004 23:03:43 -0000	1.214
--- lisp/font-lock.el	12 Feb 2004 21:48:47 -0000
*************** Sets various variables using `font-lock-
*** 1560,1583 ****
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((type tty pc) (class color) (background light)) (:foreground "red"))
!     (((type tty pc) (class color) (background dark)) (:foreground "red1"))
!     (((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "Firebrick"))
!     (((class color) (background dark)) (:foreground "chocolate1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (background light)) (:foreground "RosyBrown"))
!     (((class color) (background dark)) (:foreground "LightSalmon"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
--- 1560,1587 ----
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) 
!      (:foreground "Firebrick"))
!     (((class color) (min-colors 88) (background dark)) 
!      (:foreground "chocolate1"))
!     (((class color) (min-colors 8) (background light)) 
!      (:foreground "red"))
!     (((class color) (min-colors 8) (background dark)) 
!      (:foreground "red1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "RosyBrown"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSalmon"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
*************** Sets various variables using `font-lock-
*** 1588,1658 ****
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Purple"))
!     (((class color) (background dark)) (:foreground "Cyan"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((type tty) (class color)) (:foreground "blue" :weight light))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Orchid"))
!     (((class color) (background dark)) (:foreground "LightSteelBlue"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((type tty) (class color)) (:foreground "blue" :weight bold))
!     (((class color) (background light)) (:foreground "Blue"))
!     (((class color) (background dark)) (:foreground "LightSkyBlue"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((type tty) (class color)) (:foreground "yellow" :weight light))
!     (((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (background dark)) (:foreground "LightGoldenrod"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "ForestGreen"))
!     (((class color) (background dark)) (:foreground "PaleGreen"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((type tty) (class color)) (:foreground "magenta"))
!     (((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (background light)) (:foreground "CadetBlue"))
!     (((class color) (background dark)) (:foreground "Aquamarine"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((type tty) (class color)) (:foreground "red"))
!     (((class color) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (background dark)) (:foreground "Pink" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
--- 1592,1662 ----
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Cyan"))
!     (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Orchid"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Blue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
!     (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
!     (((class color) (min-colors 8)) (:foreground "magenta"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
!     (((class color) (min-colors 8)) (:foreground "red"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.223
diff -c -3 -p -r1.223 isearch.el
*** lisp/isearch.el	1 Nov 2003 17:00:02 -0000	1.223
--- lisp/isearch.el	12 Feb 2004 21:48:48 -0000
*************** A value of nil means highlight all match
*** 2128,2153 ****
    :group 'isearch)
  
  (defface isearch
!   '((((type tty pc) (class color))
!      (:background "magenta4" :foreground "cyan1"))
!     (((class color) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((type tty pc) (class color))
!      (:background "turquoise3"))
!     (((class color) (background light))
       (:background "paleturquoise"))
!     (((class color) (background dark))
       (:background "paleturquoise4"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)
--- 2128,2153 ----
    :group 'isearch)
  
  (defface isearch
!   '((((class color) (min-colors 88) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (min-colors 88) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
+     (((class color) (min-colors 8))
+      (:background "magenta4" :foreground "cyan1"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((class color) (min-colors 88) (background light))
       (:background "paleturquoise"))
!     (((class color) (min-colors 88) (background dark))
       (:background "paleturquoise4"))
+     (((class color) (min-colors 8))
+      (:background "turquoise3"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)
Index: lispref/display.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/display.texi,v
retrieving revision 1.112
diff -c -3 -p -r1.112 display.texi
*** lispref/display.texi	6 Feb 2004 09:23:38 -0000	1.112
--- lispref/display.texi	12 Feb 2004 21:48:48 -0000
*************** What kinds of colors the frame supports-
*** 1613,1618 ****
--- 1613,1626 ----
  @item background
  The kind of background---either @code{light} or @code{dark}.
  
+ @item min-colors
+ An integer that represents the minimum number of colors the frame should
+ support, it is compared with the result of @code{display-color-cells}.
+ 
+ @item max-colors
+ An integer that represents the maximum number of colors the frame should
+ support, it is compared with the result of @code{display-color-cells}.
+ 
  @item supports
  Whether or not the frame can display the face attributes given in
  @var{value}@dots{} (@pxref{Face Attributes}).  See the documentation

[-- Attachment #4: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-12 22:13             ` Dan Nicolaescu
@ 2004-02-13  8:57               ` Eli Zaretskii
  2004-02-13 20:29                 ` Dan Nicolaescu
  2004-02-13  9:02               ` Eli Zaretskii
  2004-06-04 19:42               ` Juri Linkov
  2 siblings, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-13  8:57 UTC (permalink / raw)
  Cc: emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Thu, 12 Feb 2004 14:13:34 -0800
> 
> The default faces and the font-lock faces have been changed to take
> advantage of `min-colors'. These faces look very similar now on a 256
> colors xterm and on X11.

Thanks.

I see one problem with these changes: it seems like you assumed that
there are no devices supported by the current defface definitions that
can support between 8 and 256 colors.  But that is not true: the MSDOS
terminal and the Windows character terminal (you get the latter when
you start the Windows port with -nw) both support 16 colors, not 8.
The current defface definitions distinguish between the Unix 8-color
displays and the 16-color displays using several techniques:

  . Define colors for (type tty), which doesn't catch the DOS
    terminal, then let (class color) catch the DOS case.

  . Use (type pc) to catch the DOS case explicitly (this is ugly, but
    sometimes cannot be avoided).

  . Use a color definition, like "red3", that maps to appropriate
    colors on both Unix tty's and Windows/DOS 16-color terminals.

As far as I could see, your changes will modify the standard face
definitions for Windows and DOS terminals, because they treat them as
if they had only 8 colors.  It would be nice if this side effect could
be avoided.  One way to avoid this is to add face definitions for
16-color displays.

I think that adding a definition for (min-colors 16) is a Good
Thing regardless, as there's rxvt and a 16-color xterm out there.

So please consider adding face definitions for 16-color displays.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-12 22:13             ` Dan Nicolaescu
  2004-02-13  8:57               ` Eli Zaretskii
@ 2004-02-13  9:02               ` Eli Zaretskii
  2004-06-04 19:42               ` Juri Linkov
  2 siblings, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-13  9:02 UTC (permalink / raw)
  Cc: emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Thu, 12 Feb 2004 14:13:34 -0800
> 
> For the etc/NEWS file, I don't know where this would fit, so it's not
> a patch.

It doesn't really matter; the standard practice is to put it at the
beginning of the relevant section (Installation, User-level, or Lisp
changes).  The list of changes is reordered by importance when a
release is being prepared.

> A new attribute `min-colors' has been added to the `defface' face
> specification language. It is used to specify the face characteristics
> depending on the number of colors supported by the display.

This is a Lisp-level change, and the wording seems to say that it is a
rather obscure one.  I would suggest an entry in the user-level
changes saying something like "Emacs now uses the full range of colors
supported by multic-lor character terminals for the default faces."
Also, in the Lisp-level change, I would think we should tell people
who write Lisp programs to prefer min-colors over the previous methods
of defining face defaults.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-13  8:57               ` Eli Zaretskii
@ 2004-02-13 20:29                 ` Dan Nicolaescu
  2004-02-14 12:15                   ` Eli Zaretskii
  0 siblings, 1 reply; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-13 20:29 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2095 bytes --]

"Eli Zaretskii" <eliz@elta.co.il> writes:

  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Thu, 12 Feb 2004 14:13:34 -0800
  > > 
  > > The default faces and the font-lock faces have been changed to take
  > > advantage of `min-colors'. These faces look very similar now on a 256
  > > colors xterm and on X11.
  > 
  > Thanks.
  > 
  > I see one problem with these changes: it seems like you assumed that
  > there are no devices supported by the current defface definitions that
  > can support between 8 and 256 colors.  But that is not true: the MSDOS
  > terminal and the Windows character terminal (you get the latter when
  > you start the Windows port with -nw) both support 16 colors, not 8.

Right, I had no idea that this was the case. My intention was to keep
the status quo for everything except the 256/88 color xterms. 

  > I think that adding a definition for (min-colors 16) is a Good
  > Thing regardless, as there's rxvt and a 16-color xterm out there.

Thanks for the detailed explanations on how these things currently
work. I have an updated patch. Could you please test it on
MSDOS/Windows and tell me if the face colors are the same before and
after my patch? I don't have access to such a machine, so I cannot
test this myself.
If anything is changed, could you please email me the output of the
following function?

(defun list-faces-display-simple ()
  "Show fg and bg."
  (interactive)
  (let ((faces (sort (face-list) #'string-lessp))
	(face nil)
	(frame (selected-frame))
	disp-frame window face-name)
    (with-output-to-temp-buffer "*SimpleFaces*"
      (save-excursion
	(set-buffer standard-output)
	(setq truncate-lines t)
	(while faces
	  (setq face (car faces))
	  (setq faces (cdr faces))
	  (setq face-name (symbol-name face))
	  (insert (format "%32s fg: %-15s bg: %-15s\n" 
			  face-name
			  (face-foreground face)
			  (face-background face)
			  )))))))

I added separate "min-colors 16" categories everywhere I thought
they'd be needed. This way it would be easier to change the
corresponding colors later, if there's a desire to do so. 


[-- Attachment #2: PATCH --]
[-- Type: text/plain, Size: 19521 bytes --]

Index: faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.280
diff -c -3 -p -r1.280 faces.el
*** faces.el	1 Sep 2003 15:45:11 -0000	1.280
--- faces.el	13 Feb 2004 20:11:16 -0000
*************** If FRAME is nil, the current FRAME is us
*** 1314,1319 ****
--- 1314,1321 ----
  				  (not (featurep 'motif)))
  			     (and (memq 'x-toolkit options)
  				  (featurep 'x-toolkit))))
+ 			((eq req 'min-colors)
+ 			 (>= (display-color-cells frame) (car options)))
  			((eq req 'class)
  			 (memq (frame-parameter frame 'display-type) options))
  			((eq req 'background)
*************** created."
*** 1892,1905 ****
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((type tty) (class color))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
-     (((class color) (background dark))
-      :background "blue3")
-     (((class color) (background light))
-      :background "lightgoldenrod2")
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
--- 1894,1911 ----
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((class color) (min-colors 88) (background dark))
!      :background "blue3")
!     (((class color) (min-colors 88) (background light))
!      :background "lightgoldenrod2")
!     (((class color) (min-colors 16) (background dark))
!      :background "blue3")
!     (((class color) (min-colors 16) (background light))
!      :background "lightgoldenrod2")
!     (((class color) (min-colors 8))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
*************** created."
*** 1990,2013 ****
  
  
  (defface highlight
!   '((((type tty) (class color))
!      :background "green" :foreground "black")
!     (((class color) (background light))
       :background "darkseagreen2")
!     (((class color) (background dark))
       :background "darkolivegreen")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((type tty) (class color))
!      :background "cyan" :foreground "black")
!     (((class color) (background light))
       :background "yellow")
!     (((class color) (background dark))
       :background "SkyBlue4")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
--- 1996,2027 ----
  
  
  (defface highlight
!   '((((class color) (min-colors 88) (background light))
       :background "darkseagreen2")
!     (((class color) (min-colors 88) (background dark))
       :background "darkolivegreen")
+     (((class color) (min-colors 16) (background light))
+      :background "darkseagreen2")
+     (((class color) (min-colors 16) (background dark))
+      :background "darkolivegreen")
+     (((class color) (min-colors 8))
+      :background "green" :foreground "black")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((class color) (min-colors 88) (background light))
       :background "yellow")
!     (((class color) (min-colors 88) (background dark))
!      :background "SkyBlue4")
!     (((class color) (min-colors 16) (background light))
!      :background "yellow")
!     (((class color) (min-colors 16) (background dark))
       :background "SkyBlue4")
+     (((class color) (min-colors 8))
+      :background "cyan" :foreground "black")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
Index: font-lock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/font-lock.el,v
retrieving revision 1.214
diff -c -3 -p -r1.214 font-lock.el
*** font-lock.el	26 Jan 2004 23:03:43 -0000	1.214
--- font-lock.el	13 Feb 2004 20:11:17 -0000
*************** Sets various variables using `font-lock-
*** 1560,1583 ****
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((type tty pc) (class color) (background light)) (:foreground "red"))
!     (((type tty pc) (class color) (background dark)) (:foreground "red1"))
!     (((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "Firebrick"))
!     (((class color) (background dark)) (:foreground "chocolate1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (background light)) (:foreground "RosyBrown"))
!     (((class color) (background dark)) (:foreground "LightSalmon"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
--- 1560,1593 ----
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) 
!      (:foreground "Firebrick"))
!     (((class color) (min-colors 88) (background dark)) 
!      (:foreground "chocolate1"))
!     (((class color) (min-colors 16) (background light)) 
!      (:foreground "red"))
!     (((class color) (min-colors 16) (background dark)) 
!      (:foreground "red1"))
!     (((class color) (min-colors 8) (background light)) 
!      (:foreground "red"))
!     (((class color) (min-colors 8) (background dark)) 
!      (:foreground "red1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "RosyBrown"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSalmon"))
!     (((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
*************** Sets various variables using `font-lock-
*** 1588,1658 ****
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Purple"))
!     (((class color) (background dark)) (:foreground "Cyan"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((type tty) (class color)) (:foreground "blue" :weight light))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Orchid"))
!     (((class color) (background dark)) (:foreground "LightSteelBlue"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((type tty) (class color)) (:foreground "blue" :weight bold))
!     (((class color) (background light)) (:foreground "Blue"))
!     (((class color) (background dark)) (:foreground "LightSkyBlue"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((type tty) (class color)) (:foreground "yellow" :weight light))
!     (((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (background dark)) (:foreground "LightGoldenrod"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "ForestGreen"))
!     (((class color) (background dark)) (:foreground "PaleGreen"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((type tty) (class color)) (:foreground "magenta"))
!     (((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (background light)) (:foreground "CadetBlue"))
!     (((class color) (background dark)) (:foreground "Aquamarine"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((type tty) (class color)) (:foreground "red"))
!     (((class color) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (background dark)) (:foreground "Pink" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
--- 1598,1681 ----
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Cyan"))
!     (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
!     (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Orchid"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue"))
!     (((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Blue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
!     (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
!     (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
!     (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
!     (((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
!     (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
!     (((class color) (min-colors 8)) (:foreground "magenta"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
!     (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))    (((class color) (min-colors 8)) (:foreground "red"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
Index: custom.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/custom.el,v
retrieving revision 1.70
diff -c -3 -p -r1.70 custom.el
*** custom.el	29 Dec 2003 11:53:19 -0000	1.70
--- custom.el	13 Feb 2004 20:11:17 -0000
*************** following REQ are defined:
*** 306,311 ****
--- 306,315 ----
  `background' (what color is used for the background text)
    Should be one of `light' or `dark'.
  
+ `min-colors' (the minimum number of colors the frame should support)
+   Should be an integer, it is compared with the result of
+   `display-color-cells'.
+ 
  Read the section about customization in the Emacs Lisp manual for more
  information."
    ;; It is better not to use backquote in this file,
Index: isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.223
diff -c -3 -p -r1.223 isearch.el
*** isearch.el	1 Nov 2003 17:00:02 -0000	1.223
--- isearch.el	13 Feb 2004 20:11:17 -0000
*************** A value of nil means highlight all match
*** 2128,2153 ****
    :group 'isearch)
  
  (defface isearch
!   '((((type tty pc) (class color))
!      (:background "magenta4" :foreground "cyan1"))
!     (((class color) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((type tty pc) (class color))
!      (:background "turquoise3"))
!     (((class color) (background light))
       (:background "paleturquoise"))
!     (((class color) (background dark))
       (:background "paleturquoise4"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)
--- 2128,2157 ----
    :group 'isearch)
  
  (defface isearch
!   '((((class color) (min-colors 88) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (min-colors 88) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
+     (((class color) (min-colors 16))
+      (:background "magenta4" :foreground "cyan1"))
+     (((class color) (min-colors 8))
+      (:background "magenta4" :foreground "cyan1"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((class color) (min-colors 88) (background light))
       (:background "paleturquoise"))
!     (((class color) (min-colors 88) (background dark))
       (:background "paleturquoise4"))
+     (((class color) (min-colors 16))
+      (:background "turquoise3"))
+     (((class color) (min-colors 8))
+      (:background "turquoise3"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-13 20:29                 ` Dan Nicolaescu
@ 2004-02-14 12:15                   ` Eli Zaretskii
  2004-02-17 20:30                     ` Dan Nicolaescu
  0 siblings, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2004-02-14 12:15 UTC (permalink / raw)
  Cc: emacs-devel

> From: Dan Nicolaescu <dann@ics.uci.edu>
> Date: Fri, 13 Feb 2004 12:29:00 -0800
> 
>   > I think that adding a definition for (min-colors 16) is a Good
>   > Thing regardless, as there's rxvt and a 16-color xterm out there.
> 
> Thanks for the detailed explanations on how these things currently
> work. I have an updated patch. Could you please test it on
> MSDOS/Windows and tell me if the face colors are the same before and
> after my patch? I don't have access to such a machine, so I cannot
> test this myself.

I will try to do this ASAP, but my ASAP might be too long, given my
current lack of free time.

I've proofread your changes, and they seem to be okay.  So if someone
could actually test them on rxvt or a 16-color xterm or on the Windows
console, I think it's okay to go ahead and commit these changes.  Even
if no one tests them, I think they are still okay to commit (unless
others object to these changes); we can always fix later what might
become broken.

> I added separate "min-colors 16" categories everywhere I thought
> they'd be needed. This way it would be easier to change the
> corresponding colors later, if there's a desire to do so. 

An excellent decision, IMHO.  Thanks.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: small grep.el fix
  2004-02-12 18:40   ` small grep.el fix Dan Nicolaescu
@ 2004-02-15 13:13     ` Thien-Thi Nguyen
  0 siblings, 0 replies; 23+ messages in thread
From: Thien-Thi Nguyen @ 2004-02-15 13:13 UTC (permalink / raw)
  Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

   Can somebody please apply this patch? 

done.  i modifed the blurb to read "Posix-style" to be consistent w/
the docstring for `executable-command-find-posix-p'.  in ChangeLog, i
appended "(tiny change)" -- let me know if this is not applicable and
i will remove it -- and used today's date.

thi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-14 12:15                   ` Eli Zaretskii
@ 2004-02-17 20:30                     ` Dan Nicolaescu
  0 siblings, 0 replies; 23+ messages in thread
From: Dan Nicolaescu @ 2004-02-17 20:30 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1811 bytes --]

"Eli Zaretskii" <eliz@elta.co.il> writes:

  > > From: Dan Nicolaescu <dann@ics.uci.edu>
  > > Date: Fri, 13 Feb 2004 12:29:00 -0800
  > > 
  > >   > I think that adding a definition for (min-colors 16) is a Good
  > >   > Thing regardless, as there's rxvt and a 16-color xterm out there.
  > > 
  > > Thanks for the detailed explanations on how these things currently
  > > work. I have an updated patch. Could you please test it on
  > > MSDOS/Windows and tell me if the face colors are the same before and
  > > after my patch? I don't have access to such a machine, so I cannot
  > > test this myself.
  > 
  > I will try to do this ASAP, but my ASAP might be too long, given my
  > current lack of free time.
  > 
  > I've proofread your changes, and they seem to be okay.  So if someone
  > could actually test them on rxvt or a 16-color xterm or on the Windows
  > console, I think it's okay to go ahead and commit these changes.  Even
  > if no one tests them, I think they are still okay to commit (unless
  > others object to these changes); we can always fix later what might
  > become broken.

Based on what Eli says above, can somebody please commit this patch?

I will send a patch for etc/NEWS and display.texi next week , I am a
little short on time now.

lisp/ChangeLog
2004-02-12  Dan Nicolaescu  <dann@ics.uci.edu>

	* faces.el (face-spec-set-match-display): Add a new  attribute,
	`min-colors'. 
	(region, highlight, secondary-selection): Use `min-colors`.

	* custom.el (defface): Add documentation for `min-colors'.

	* font-lock.el (font-lock-comment-face, font-lock-string-face,
	font-lock-keyword-face, font-lock-function-name-face,
	font-lock-variable-name-face, font-lock-constant-face): Use
	`min-colors`.

	* isearch.el (isearch, isearch-lazy-highlight-face): Use
	`min-colors'. 


[-- Attachment #2: support for 256 color xterms --]
[-- Type: text/plain, Size: 19581 bytes --]

Index: lisp/faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.280
diff -c -3 -p -r1.280 faces.el
*** lisp/faces.el	1 Sep 2003 15:45:11 -0000	1.280
--- lisp/faces.el	17 Feb 2004 20:10:17 -0000
*************** If FRAME is nil, the current FRAME is us
*** 1314,1319 ****
--- 1314,1321 ----
  				  (not (featurep 'motif)))
  			     (and (memq 'x-toolkit options)
  				  (featurep 'x-toolkit))))
+ 			((eq req 'min-colors)
+ 			 (>= (display-color-cells frame) (car options)))
  			((eq req 'class)
  			 (memq (frame-parameter frame 'display-type) options))
  			((eq req 'background)
*************** created."
*** 1892,1905 ****
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((type tty) (class color))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
-     (((class color) (background dark))
-      :background "blue3")
-     (((class color) (background light))
-      :background "lightgoldenrod2")
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
--- 1894,1911 ----
        (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
  
  (defface region
!   '((((class color) (min-colors 88) (background dark))
!      :background "blue3")
!     (((class color) (min-colors 88) (background light))
!      :background "lightgoldenrod2")
!     (((class color) (min-colors 16) (background dark))
!      :background "blue3")
!     (((class color) (min-colors 16) (background light))
!      :background "lightgoldenrod2")
!     (((class color) (min-colors 8))
       :background "blue" :foreground "white")
      (((type tty) (class mono))
       :inverse-video t)
      (t :background "gray"))
    "Basic face for highlighting the region."
    :version "21.1"
*************** created."
*** 1990,2013 ****
  
  
  (defface highlight
!   '((((type tty) (class color))
!      :background "green" :foreground "black")
!     (((class color) (background light))
       :background "darkseagreen2")
!     (((class color) (background dark))
       :background "darkolivegreen")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((type tty) (class color))
!      :background "cyan" :foreground "black")
!     (((class color) (background light))
       :background "yellow")
!     (((class color) (background dark))
       :background "SkyBlue4")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
--- 1996,2027 ----
  
  
  (defface highlight
!   '((((class color) (min-colors 88) (background light))
       :background "darkseagreen2")
!     (((class color) (min-colors 88) (background dark))
       :background "darkolivegreen")
+     (((class color) (min-colors 16) (background light))
+      :background "darkseagreen2")
+     (((class color) (min-colors 16) (background dark))
+      :background "darkolivegreen")
+     (((class color) (min-colors 8))
+      :background "green" :foreground "black")
      (t :inverse-video t))
    "Basic face for highlighting."
    :group 'basic-faces)
  
  
  (defface secondary-selection
!   '((((class color) (min-colors 88) (background light))
       :background "yellow")
!     (((class color) (min-colors 88) (background dark))
!      :background "SkyBlue4")
!     (((class color) (min-colors 16) (background light))
!      :background "yellow")
!     (((class color) (min-colors 16) (background dark))
       :background "SkyBlue4")
+     (((class color) (min-colors 8))
+      :background "cyan" :foreground "black")
      (t :inverse-video t))
    "Basic face for displaying the secondary selection."
    :group 'basic-faces)
Index: lisp/custom.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/custom.el,v
retrieving revision 1.70
diff -c -3 -p -r1.70 custom.el
*** lisp/custom.el	29 Dec 2003 11:53:19 -0000	1.70
--- lisp/custom.el	17 Feb 2004 20:10:17 -0000
*************** following REQ are defined:
*** 306,311 ****
--- 306,315 ----
  `background' (what color is used for the background text)
    Should be one of `light' or `dark'.
  
+ `min-colors' (the minimum number of colors the frame should support)
+   Should be an integer, it is compared with the result of
+   `display-color-cells'.
+ 
  Read the section about customization in the Emacs Lisp manual for more
  information."
    ;; It is better not to use backquote in this file,
Index: lisp/font-lock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/font-lock.el,v
retrieving revision 1.214
diff -c -3 -p -r1.214 font-lock.el
*** lisp/font-lock.el	26 Jan 2004 23:03:43 -0000	1.214
--- lisp/font-lock.el	17 Feb 2004 20:10:17 -0000
*************** Sets various variables using `font-lock-
*** 1560,1583 ****
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((type tty pc) (class color) (background light)) (:foreground "red"))
!     (((type tty pc) (class color) (background dark)) (:foreground "red1"))
!     (((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "Firebrick"))
!     (((class color) (background dark)) (:foreground "chocolate1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (background light)) (:foreground "RosyBrown"))
!     (((class color) (background dark)) (:foreground "LightSalmon"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
--- 1560,1593 ----
  ;; But now we do it the custom way.  Note that `defface' will not overwrite any
  ;; faces declared above via `custom-declare-face'.
  (defface font-lock-comment-face
!   '((((class grayscale) (background light))
       (:foreground "DimGray" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "LightGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) 
!      (:foreground "Firebrick"))
!     (((class color) (min-colors 88) (background dark)) 
!      (:foreground "chocolate1"))
!     (((class color) (min-colors 16) (background light)) 
!      (:foreground "red"))
!     (((class color) (min-colors 16) (background dark)) 
!      (:foreground "red1"))
!     (((class color) (min-colors 8) (background light)) 
!      (:foreground "red"))
!     (((class color) (min-colors 8) (background dark)) 
!      (:foreground "red1"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight comments."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-string-face
!   '((((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
      (((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "RosyBrown"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSalmon"))
!     (((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:slant italic)))
    "Font Lock mode face used to highlight strings."
    :group 'font-lock-highlighting-faces)
*************** Sets various variables using `font-lock-
*** 1588,1658 ****
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Purple"))
!     (((class color) (background dark)) (:foreground "Cyan"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((type tty) (class color)) (:foreground "blue" :weight light))
!     (((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "Orchid"))
!     (((class color) (background dark)) (:foreground "LightSteelBlue"))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((type tty) (class color)) (:foreground "blue" :weight bold))
!     (((class color) (background light)) (:foreground "Blue"))
!     (((class color) (background dark)) (:foreground "LightSkyBlue"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((type tty) (class color)) (:foreground "yellow" :weight light))
!     (((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (background dark)) (:foreground "LightGoldenrod"))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((type tty) (class color)) (:foreground "green"))
!     (((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (background light)) (:foreground "ForestGreen"))
!     (((class color) (background dark)) (:foreground "PaleGreen"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((type tty) (class color)) (:foreground "magenta"))
!     (((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (background light)) (:foreground "CadetBlue"))
!     (((class color) (background dark)) (:foreground "Aquamarine"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((type tty) (class color)) (:foreground "red"))
!     (((class color) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (background dark)) (:foreground "Pink" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
--- 1598,1681 ----
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-keyword-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Cyan"))
!     (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
!     (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight keywords."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-builtin-face
!   '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "Orchid"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue"))
!     (((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:weight bold)))
    "Font Lock mode face used to highlight builtins."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-function-name-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Blue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
!     (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
!     (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight function names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-variable-name-face
!   '((((class grayscale) (background light))
       (:foreground "Gray90" :weight bold :slant italic))
      (((class grayscale) (background dark))
       (:foreground "DimGray" :weight bold :slant italic))
!     (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
!     (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
!     (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
      (t (:weight bold :slant italic)))
    "Font Lock mode face used to highlight variable names."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-type-face
!   '((((class grayscale) (background light)) (:foreground "Gray90" :weight bold))
      (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
!     (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
!     (((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
!     (((class color) (min-colors 8)) (:foreground "green"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight type and classes."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-constant-face
!   '((((class grayscale) (background light))
       (:foreground "LightGray" :weight bold :underline t))
      (((class grayscale) (background dark))
       (:foreground "Gray50" :weight bold :underline t))
!     (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
!     (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
!     (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
!     (((class color) (min-colors 8)) (:foreground "magenta"))
      (t (:weight bold :underline t)))
    "Font Lock mode face used to highlight constants and labels."
    :group 'font-lock-highlighting-faces)
  
  (defface font-lock-warning-face
!   '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
!     (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
!     (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))    (((class color) (min-colors 8)) (:foreground "red"))
      (t (:inverse-video t :weight bold)))
    "Font Lock mode face used to highlight warnings."
    :group 'font-lock-highlighting-faces)
Index: lisp/isearch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.223
diff -c -3 -p -r1.223 isearch.el
*** lisp/isearch.el	1 Nov 2003 17:00:02 -0000	1.223
--- lisp/isearch.el	17 Feb 2004 20:10:17 -0000
*************** A value of nil means highlight all match
*** 2128,2153 ****
    :group 'isearch)
  
  (defface isearch
!   '((((type tty pc) (class color))
!      (:background "magenta4" :foreground "cyan1"))
!     (((class color) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((type tty pc) (class color))
!      (:background "turquoise3"))
!     (((class color) (background light))
       (:background "paleturquoise"))
!     (((class color) (background dark))
       (:background "paleturquoise4"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)
--- 2128,2157 ----
    :group 'isearch)
  
  (defface isearch
!   '((((class color) (min-colors 88) (background light))
       ;; The background must not be too dark, for that means
       ;; the character is hard to see when the cursor is there.
       (:background "magenta2" :foreground "lightskyblue1"))
!     (((class color) (min-colors 88) (background dark))
       (:background "palevioletred2" :foreground "brown4"))
+     (((class color) (min-colors 16))
+      (:background "magenta4" :foreground "cyan1"))
+     (((class color) (min-colors 8))
+      (:background "magenta4" :foreground "cyan1"))
      (t (:inverse-video t)))
    "Face for highlighting Isearch matches."
    :group 'isearch-faces)
  (defvar isearch 'isearch)
  
  (defface isearch-lazy-highlight-face
!   '((((class color) (min-colors 88) (background light))
       (:background "paleturquoise"))
!     (((class color) (min-colors 88) (background dark))
       (:background "paleturquoise4"))
+     (((class color) (min-colors 16))
+      (:background "turquoise3"))
+     (((class color) (min-colors 8))
+      (:background "turquoise3"))
      (t (:underline t)))
    "Face for lazy highlighting of Isearch matches other than the current one."
    :group 'isearch-faces)

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-02-12 22:13             ` Dan Nicolaescu
  2004-02-13  8:57               ` Eli Zaretskii
  2004-02-13  9:02               ` Eli Zaretskii
@ 2004-06-04 19:42               ` Juri Linkov
  2004-06-04 21:14                 ` Dan Nicolaescu
  2004-06-05 22:50                 ` Richard Stallman
  2 siblings, 2 replies; 23+ messages in thread
From: Juri Linkov @ 2004-06-04 19:42 UTC (permalink / raw)
  Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:
> A new attribute `min-colors' has been added to the `defface' face
> specification language.

I noticed that the support for `min-colors' hasn't been added to the
`custom-display' widget.  This should be added in cus-edit.el
somewhere between `class' and `background'.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-06-04 19:42               ` Juri Linkov
@ 2004-06-04 21:14                 ` Dan Nicolaescu
  2004-06-04 23:12                   ` Juri Linkov
  2004-06-05 22:50                 ` Richard Stallman
  1 sibling, 1 reply; 23+ messages in thread
From: Dan Nicolaescu @ 2004-06-04 21:14 UTC (permalink / raw)
  Cc: emacs-devel

Juri Linkov <juri@jurta.org> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > > A new attribute `min-colors' has been added to the `defface' face
  > > specification language.
  > 
  > I noticed that the support for `min-colors' hasn't been added to the
  > `custom-display' widget.  This should be added in cus-edit.el
  > somewhere between `class' and `background'.

Sorry, I don't know what `custom-display' and how it is supposed to
work, so I cannot do it. If somebody can help with that it would be
great. 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-06-04 21:14                 ` Dan Nicolaescu
@ 2004-06-04 23:12                   ` Juri Linkov
  0 siblings, 0 replies; 23+ messages in thread
From: Juri Linkov @ 2004-06-04 23:12 UTC (permalink / raw)
  Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:
> Sorry, I don't know what `custom-display' and how it is supposed to
> work, so I cannot do it. If somebody can help with that it would be
> great. 

`custom-display' is an editable list of face specifications.  Even
though I don't know too much about it either, it seems the patch below
correctly adds the support for `min-colors' to `custom-display'.  So,
unless someone familiar with cus-edit.el will raise the objections,
I will install it.

--- emacs/lisp/cus-edit.el.~1.193.~	2004-05-29 21:49:28 +0300
+++ emacs/lisp/cus-edit.el	2004-06-04 21:30:25 +0300
@@ -2729,6 +2729,10 @@
 Match frames with no color support.")
 					   mono)))
 		  (group :sibling-args (:help-echo "\
+The minimum number of colors the frame should support.")
+			 (const :format "" min-colors)
+			 (integer :tag "Minimum number of colors" ))
+		  (group :sibling-args (:help-echo "\
 Only match frames with the specified intensity.")
 			 (const :format "\
 Background brightness: "

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: supporting more faces on 256 colors xterms
  2004-06-04 19:42               ` Juri Linkov
  2004-06-04 21:14                 ` Dan Nicolaescu
@ 2004-06-05 22:50                 ` Richard Stallman
  1 sibling, 0 replies; 23+ messages in thread
From: Richard Stallman @ 2004-06-05 22:50 UTC (permalink / raw)
  Cc: dann, emacs-devel

    I noticed that the support for `min-colors' hasn't been added to the
    `custom-display' widget.  This should be added in cus-edit.el
    somewhere between `class' and `background'.

Thanks for noticing this was missing.  Later I saw you'd written
a patch.  Would you please install it?

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2004-06-05 22:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-08  4:13 supporting more faces on 256 colors xterms Dan Nicolaescu
2004-02-08  6:08 ` Eli Zaretskii
2004-02-08  8:15   ` Dan Nicolaescu
2004-02-08 13:45     ` Andreas Schwab
2004-02-08 18:24       ` Eli Zaretskii
2004-02-08 19:11         ` Andreas Schwab
2004-02-08 23:19           ` Miles Bader
2004-02-08 23:52         ` Dan Nicolaescu
2004-02-09  6:03           ` Eli Zaretskii
2004-02-12 22:13             ` Dan Nicolaescu
2004-02-13  8:57               ` Eli Zaretskii
2004-02-13 20:29                 ` Dan Nicolaescu
2004-02-14 12:15                   ` Eli Zaretskii
2004-02-17 20:30                     ` Dan Nicolaescu
2004-02-13  9:02               ` Eli Zaretskii
2004-06-04 19:42               ` Juri Linkov
2004-06-04 21:14                 ` Dan Nicolaescu
2004-06-04 23:12                   ` Juri Linkov
2004-06-05 22:50                 ` Richard Stallman
2004-02-08 18:35     ` Eli Zaretskii
2004-02-09  9:38 ` Richard Stallman
2004-02-12 18:40   ` small grep.el fix Dan Nicolaescu
2004-02-15 13:13     ` Thien-Thi Nguyen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).