From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: pipcet@gmail.com, emacs-devel@gnu.org
Subject: Re: master 64e25cd: More robust NS hex colour string parsing
Date: Sat, 13 Jun 2020 17:39:29 +0200 [thread overview]
Message-ID: <E85270FD-9AD6-4EA3-AD7D-D9FB861D190E@acm.org> (raw)
In-Reply-To: <83a71741mr.fsf@gnu.org>
13 juni 2020 kl. 13.59 skrev Eli Zaretskii <eliz@gnu.org>:
>> except the low bits in some cases on Windows (try "#123")
>
> I don't think I understand what I should try; please elaborate.
Try (color-values "#123"). The correct result is (#x1111 #x2222 #x3333).
If you get something else on Windows, then that is a bug fixed by the patch.
If the patch doesn't help, then it may be a bug in the patch.
Note that the Windows backend will still discard the low 8 bits in any case; (color-values "#123456789abc") will probably return (#x1212 #x5656 #x9a9a). The patch doesn't change that.
>> Malformed arguments are now consistently rejected.
>
> How exactly are they rejected?
In the same way that detected errors were rejected before: as if given an undefined colour such as "fuchsia green".
> I see the return value of
> parse_color_spec, but what happens in its callers, and what happens on
> the Lisp levels when those callers are called?
None of that has changed.
>> Not sure what you mean here. Mind giving a concrete example?
>
> The first two branches of the 'cond' would always return a list before
> your changes, but after your changes they could return nil if
> color-values-from-numeric-string (not the best name, btw) returns nil
> and the input is of one of the two forms parsed by those two branches.
This is still a tad vague and speculative. Can you give a concrete example of an argument that, in your opinion, isn't handled correctly?
As far as I can tell, well-formed arguments yield correct values and others are rejected in the same way as before, although error-checking now is less spotty.
I don't particularly like that function name either. What about one of these:
parse-color
parse-color-spec
parse-color-string
color-values-from-spec
color-from-string-spec
color-spec-to-values
Xlib uses the term 'numerical colour specification', but color-values-from-numerical-color-specification is a mouthful even in Lisp.
next prev parent reply other threads:[~2020-06-13 15:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200608120746.30163.87810@vcs0.savannah.gnu.org>
[not found] ` <20200608120747.80E8E20A2E@vcs0.savannah.gnu.org>
2020-06-08 12:26 ` master 64e25cd: More robust NS hex colour string parsing Pip Cet
2020-06-08 16:15 ` Mattias Engdegård
2020-06-12 16:59 ` Mattias Engdegård
2020-06-12 17:33 ` Eli Zaretskii
2020-06-12 19:00 ` Mattias Engdegård
2020-06-12 19:11 ` Eli Zaretskii
2020-06-12 19:25 ` Eli Zaretskii
2020-06-13 10:17 ` Mattias Engdegård
2020-06-13 11:59 ` Eli Zaretskii
2020-06-13 15:39 ` Mattias Engdegård [this message]
2020-06-13 15:58 ` Eli Zaretskii
2020-06-13 16:44 ` Mattias Engdegård
2020-06-13 17:09 ` Eli Zaretskii
2020-06-13 17:29 ` Mattias Engdegård
2020-06-13 17:35 ` Eli Zaretskii
2020-06-13 17:56 ` Mattias Engdegård
2020-06-13 18:40 ` Eli Zaretskii
2020-06-15 8:31 ` Mattias Engdegård
2020-06-21 7:48 ` Mattias Engdegård
2020-06-21 14:59 ` Eli Zaretskii
2020-06-21 19:23 ` Mattias Engdegård
2020-06-13 19:15 ` Basil L. Contovounesios
2020-06-12 19:15 ` Pip Cet
2020-06-13 10:40 ` Mattias Engdegård
2020-06-12 18:33 ` Basil L. Contovounesios
2020-06-13 17:52 ` Mattias Engdegård
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E85270FD-9AD6-4EA3-AD7D-D9FB861D190E@acm.org \
--to=mattiase@acm.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=pipcet@gmail.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 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.