unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Mauger <mmaug@yahoo.com>
Subject: Patch to display "System" colors
Date: Fri, 14 Nov 2003 16:26:57 -0800 (PST)	[thread overview]
Message-ID: <20031115002657.44691.qmail@web60309.mail.yahoo.com> (raw)

Several months ago, support for the colors defined in the W32 control
panel was added.  These colors are logical colors rather than physical
colors (i.e., "SystemActiveTitleText" vs "LightGreen").  The logical
colors can be identified by the "System" prefix.

I noticed that `list-colors-display' was not showing all the logical
colors.  This is because it skips colors that have the same color value
as the previous color value in the list.  (Thus "LightGreen" is skipped
when the previous color was "light green" because they both have the
color value (43052688).)  However, the System colors should not be
skipped just because they have the same color value as the previous
system color.

This small patch will show all of the logical system colors in
`list-colors-display' while still filtering similiar physical colors.

-- Michael

Index: emacs/lisp/facemenu.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/facemenu.el,v
retrieving revision 1.71
diff -u -b -r1.71 facemenu.el
--- emacs/lisp/facemenu.el      1 Sep 2003 15:45:11 -0000       1.71
+++ emacs/lisp/facemenu.el      15 Nov 2003 00:22:27 -0000
@@ -482,9 +482,18 @@
     ;; Delete duplicate colors.
     (let ((l list))
       (while (cdr l)
-       (if (facemenu-color-equal (car l) (car (cdr l)))
-           (setcdr l (cdr (cdr l)))
-         (setq l (cdr l)))))
+       (let ((this (car l))
+             (next (car (cdr l))))
+         (if (and
+              ;; Avoid filtering out "System" logical colors.
+              (or (<= (length this) 6)
+                  (not (equal (substring this 0 6) "System")))
+              (or (<= (length next) 6)
+                  (not (equal (substring next 0 6) "System")))
+              ;; If neither is a System color, compare them.
+              (facemenu-color-equal this next))
+             (setcdr l (cdr (cdr l)))))
+           (setq l (cdr l))))
     (when (memq (display-visual-class) '(gray-scale pseudo-color
direct-color))
       ;; Don't show more than what the display can handle.
       (let ((lc (nthcdr (1- (display-color-cells)) list)))


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

             reply	other threads:[~2003-11-15  0:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-15  0:26 Michael Mauger [this message]
2003-11-15 14:17 ` Patch to display "System" colors Eli Zaretskii
2003-11-15 14:28   ` Jason Rumney
2003-11-15 14:47     ` Eli Zaretskii
2003-11-15 15:41       ` Jason Rumney
2003-11-18  1:10         ` Michael Mauger
2003-11-18 10:01           ` Kim F. Storm
2003-11-18 18:17             ` Michael Mauger
2003-11-18 23:03           ` Richard Stallman

Reply instructions:

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

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

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

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

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

  git send-email \
    --in-reply-to=20031115002657.44691.qmail@web60309.mail.yahoo.com \
    --to=mmaug@yahoo.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).