unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@elta.co.il>
Cc: emacs-devel@gnu.org
Subject: Re: list-colors-display: filter same adjecent colors
Date: 24 Feb 2004 08:43:54 +0200	[thread overview]
Message-ID: <u3c91j7th.fsf@elta.co.il> (raw)
In-Reply-To: <20040224034358.17107.qmail@web60301.mail.yahoo.com> (message from Michael Mauger on Mon, 23 Feb 2004 19:43:58 -0800 (PST))

> Date: Mon, 23 Feb 2004 19:43:58 -0800 (PST)
> From: Michael Mauger <mmaug@yahoo.com>
> 
> This was another conversation from November.  
> 
> See http://mail.gnu.org/archive/html/emacs-devel/2003-11/msg00189.html

Thanks for following up.

>  (defun facemenu-color-equal (a b)
>    "Return t if colors A and B are the same color.
> -A and B should be strings naming colors.
> -This function queries the display system to find out what the color
> -names mean.  It returns nil if the colors differ or if it can't
> -determine the correct answer."
> -  (cond ((equal a b) t)
> -       ((equal (color-values a) (color-values b)))))
> +A and B should be strings naming colors.  These names are
> +downcased, stripped of spaces and the string `grey' is turned
> +into `gray'.  This accomidates alternative spellings of colors
> +found commonly in the list.  It returns nil if the colors differ."
> +  (progn
> +    (setq a (replace-regexp-in-string "grey" "gray"
> +            (replace-regexp-in-string " " ""
> +             (downcase a)))
> +         b (replace-regexp-in-string "grey" "gray"
> +            (replace-regexp-in-string " " ""
> +             (downcase b))))
> +
> +    (equal a b)))

Hmm, how about making this a new function, and leaving the original
facemenu-color-equal alone?  None of the Lisp files bundled with
Emacs use facemenu-color-equal, but perhaps some add-on packages do,
as it sounds like useful functionality and is there since 1994.

Also, I think we should mention the MS-Windows case and the special
color names used there explicitly, at least in a comment to the
function's code, if not in the doc string.  A year from now, no one
will remember why we modified the way colors are compared.

  reply	other threads:[~2004-02-24  6:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-24  3:43 list-colors-display: filter same adjecent colors Michael Mauger
2004-02-24  6:43 ` Eli Zaretskii [this message]
2004-03-05 23:49   ` Michael Mauger
2004-03-06  8:51     ` Eli Zaretskii
2004-04-06  3:08       ` Michael Mauger
2004-04-15 13:18         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2004-05-18 21:13 Michael Mauger
2004-05-20 17:55 ` Eli Zaretskii

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=u3c91j7th.fsf@elta.co.il \
    --to=eliz@elta.co.il \
    --cc=emacs-devel@gnu.org \
    /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).