From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Patch to display "System" colors Date: Fri, 14 Nov 2003 16:26:57 -0800 (PST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20031115002657.44691.qmail@web60309.mail.yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068856239 11688 80.91.224.253 (15 Nov 2003 00:30:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2003 00:30:39 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Nov 15 01:30:36 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKoKi-0001ID-00 for ; Sat, 15 Nov 2003 01:30:36 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKoKi-0000Lw-00 for ; Sat, 15 Nov 2003 01:30:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKpGc-0002mL-Ui for emacs-devel@quimby.gnus.org; Fri, 14 Nov 2003 20:30:26 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AKpFR-0001d7-H8 for emacs-devel@gnu.org; Fri, 14 Nov 2003 20:29:13 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AKpEc-0000Hu-TO for emacs-devel@gnu.org; Fri, 14 Nov 2003 20:28:53 -0500 Original-Received: from [216.109.118.120] (helo=web60309.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.24) id 1AKpEc-0000He-KP for emacs-devel@gnu.org; Fri, 14 Nov 2003 20:28:22 -0500 Original-Received: from [12.91.11.96] by web60309.mail.yahoo.com via HTTP; Fri, 14 Nov 2003 16:26:57 PST Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17831 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17831 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