]> code.delx.au - gnu-emacs/blobdiff - lisp/facemenu.el
lisp/facemenu.el (list-colors-duplicates): Detect more duplicates on Windows.
[gnu-emacs] / lisp / facemenu.el
index a18b892efe8be29e4a40aec7d9a6e16895a0aa8e..54b17d58f338da0cae241dc0081db1a164a8dc4a 100644 (file)
@@ -639,8 +639,15 @@ a list of colors that the current display can handle."
         (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))))))
+               ;; On MS-Windows, there are logical colors that might have
+               ;; the same value but different names and meanings.  For
+               ;; example, `SystemMenuText' (the color w32 uses for the
+               ;; text in menu entries) and `SystemWindowText' (the default
+               ;; color w32 uses for the text in windows and dialogs) may
+               ;; be the same display color and be adjacent in the list.
+               ;; This makes them different to any other color.  Bug#9722
+              (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))))