all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9722: list-colors-duplicates does not exclude enough colors on Windows
@ 2011-10-10 22:49 Juanma Barranquero
  2011-10-11  6:01 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Juanma Barranquero @ 2011-10-10 22:49 UTC (permalink / raw)
  To: 9722

Package: emacs
Severity: minor


On Windows, `list-colors-duplicates' matches the color name against
the output of `w32-default-color-map', to avoid conflating colors
which are RGB-equal, but semantically different, like SystemMenuText
and SystemWindowText.

Unfortunately, that makes colors not in that list different even if
they are not, in particular all the grayNN/greyNN pairs.

The following patch discards that check, and uses instead the
heuristic that the only special colors on Windows are the ones
starting with "System". That has always been the case anyway, and it's
unlikely for the user to define a non-special System* color (and if he
does, this patch will cause no harm anyway, it will just not be
considered a duplicate of other colors).

    Juanma



2011-10-10  Juanma Barranquero  <lekktu@gmail.com>

	* facemenu.el (list-colors-duplicates): On Windows, detect more
	duplicates by assuming that only colors matching "^System" are
	special "system colors".


=== modified file 'lisp/facemenu.el'
--- lisp/facemenu.el	2011-09-11 01:55:09 +0000
+++ lisp/facemenu.el	2011-10-10 22:39:20 +0000
@@ -639,8 +639,8 @@
 	 (l list))
     (while (cdr l)
       (if (and (facemenu-color-equal (car (car l)) (car (car (cdr l))))
-	       (not (if (fboundp 'w32-default-color-map)
-			(not (assoc (car (car l)) (w32-default-color-map))))))
+	       (not (and (eq system-type 'windows-nt)
+			 (string-match-p "^System" (car (car l))))))
 	  (progn
 	    (setcdr (car l) (cons (car (car (cdr l))) (cdr (car l))))
 	    (setcdr l (cdr (cdr l))))





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

end of thread, other threads:[~2011-10-24 19:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 22:49 bug#9722: list-colors-duplicates does not exclude enough colors on Windows Juanma Barranquero
2011-10-11  6:01 ` Eli Zaretskii
2011-10-11 11:24   ` Juanma Barranquero
2011-10-11 19:39     ` Eli Zaretskii
2011-10-11 20:54       ` Juanma Barranquero
2011-10-17 12:00         ` Juanma Barranquero
2011-10-17 16:41           ` Eli Zaretskii
2011-10-17 16:55             ` Juanma Barranquero
2011-10-17 17:15               ` Eli Zaretskii
2011-10-18 14:50                 ` Juanma Barranquero
     [not found]                   ` <83obxeuwa8.fsf@gnu.org>
     [not found]                     ` <CAAeL0SRRkqY2r6QwASsb1JVdeSfTd9UDz3RY5QTx-PHME2iZsQ@mail.gmail.com>
     [not found]                       ` <83k482ut21.fsf@gnu.org>
2011-10-18 19:25                         ` Juanma Barranquero
2011-10-18 21:01                           ` Eli Zaretskii
2011-10-24 19:29                             ` Juanma Barranquero
2011-10-19  8:20         ` Juri Linkov
2011-10-19  8:36           ` Eli Zaretskii
2011-10-19  8:57           ` Juanma Barranquero

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.