From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: master 64e25cd: More robust NS hex colour string parsing Date: Sat, 13 Jun 2020 18:44:04 +0200 Message-ID: <82DE05DD-0F2A-4722-AB75-D9D95F58BAF4@acm.org> References: <20200608120746.30163.87810@vcs0.savannah.gnu.org> <20200608120747.80E8E20A2E@vcs0.savannah.gnu.org> <83r1uk429y.fsf@gnu.org> <3C92A091-F389-4179-B2F0-B3AA5ABD6CCE@acm.org> <83pna43xrl.fsf@gnu.org> <9259B4A6-F3CC-4243-9F08-2882993C9B2C@acm.org> <83a71741mr.fsf@gnu.org> <83y2or2c0o.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="94670"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pipcet@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 13 18:44:45 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jk9Gv-000OUw-EH for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Jun 2020 18:44:45 +0200 Original-Received: from localhost ([::1]:39800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jk9Gu-0000GR-HQ for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Jun 2020 12:44:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk9GQ-0008Br-Fa for emacs-devel@gnu.org; Sat, 13 Jun 2020 12:44:14 -0400 Original-Received: from mail1479c50.megamailservers.eu ([91.136.14.79]:58266 helo=mail118c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk9GN-0001m8-Bj; Sat, 13 Jun 2020 12:44:14 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1592066647; bh=AMOHJg35JDJ/AOBk2o4pgyZKuuBt00sTfejHAaVug8w=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=POJHDQDGrGjCI0SXkpVTE1yP3oYWvMHy3b0lk1vaG1q8uGB7V9AvmVVz0weJUmgwD QFVxaZDA+fPrdvtaPy2RqXaWi8V631zAN07jREszASj9uQh1ewaPrdfBn9VGQkAGIg h5N/6X8J2WgLXG29msW6gXgghiwrB0SfQKUsjsgQ= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 05DGi4oI026355; Sat, 13 Jun 2020 16:44:06 +0000 In-Reply-To: <83y2or2c0o.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F28.5EE501FA.0030, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KaGsTjQD c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=5NrcRONCJiTeGEEgi3QA:9 a=ctfIvnEhtO8cLpbv:21 a=QRugjQ-XPdJKmqFb:21 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 Received-SPF: softfail client-ip=91.136.14.79; envelope-from=mattiase@acm.org; helo=mail118c50.megamailservers.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 12:44:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252188 Archived-At: 13 juni 2020 kl. 17.58 skrev Eli Zaretskii : >> Try (color-values "#123"). The correct result is (#x1111 #x2222 = #x3333). >=20 > Why is that the correct value? I get (#x1010 #x2020 #x3030); why is > that wrong? It violates the HTML/CSS convention which was agreed upon in bug#36304 = and followed by the other backends. Single-digit hex numbers are scaled = by 65535/15, two-digit numbers by 65535/255, and three-digit numbers by = 65535/4095. > Just follow the code, it should be very clear: those two branches > always return a list of values. No example should be needed. An example could help resolve misunderstanding, and if we go = back-and-forth on what you think is a simple matter it's a clear sign = that one is definitely needed. > No, that's not true, as should be obvious from examining the code. > Previously, any "#..." string whose length was 4 or longer would > return a list of values, even if it wasn't well-formed; now some of > them will return nil. (tty-color-values "#xyz") returned nil (and still does), contradicting = your claim. I meant that the manner of rejection remains unchanged, not the set of = rejected arguments, which is a consequence of improved error-checking, = very much by design. Not only was it previously lacking, its coverage varied wildly between = backends. That means that hardly any code could have abused the lax = checking while still working on multiple platforms. Of course, the = unpredictable behaviour on malformed input made this a very dubious = endeavour in the first place. > color-values-from-rgb-spec? Thank you, but that would preclude addition of non-RGB formats in the = future, such as HSV or XIE XYZ. Nothing in the interface forces the = specification to be RGB. In fact, Xlib accepts several non-RGB formats.