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: Mon, 8 Jun 2020 18:15:00 +0200 Message-ID: References: <20200608120746.30163.87810@vcs0.savannah.gnu.org> <20200608120747.80E8E20A2E@vcs0.savannah.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="11656"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 08 18:37:39 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 1jiKmJ-0002wH-CD for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Jun 2020 18:37:39 +0200 Original-Received: from localhost ([::1]:56044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiKmI-0008RJ-CR for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Jun 2020 12:37:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiKQW-00083P-O7 for emacs-devel@gnu.org; Mon, 08 Jun 2020 12:15:10 -0400 Original-Received: from mail239c50.megamailservers.eu ([91.136.10.249]:46640 helo=mail56c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiKQU-00029T-Ti for emacs-devel@gnu.org; Mon, 08 Jun 2020 12:15:08 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1591632903; bh=HbITecMvl7Gvm3UYEHeTj38H91C+dwFl4NVhgHNvWn0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=epMJdW7uqzPdHsrThWfOApv45SXFcynHvAc+p/mVy2qYzrP78X008ULL8dcih+/pL HdNpJT4q2+IG7Vkedc8JIC7fvjNRYGVbSCb5dcJpDVU64Ypo0D0aDtUxZgjqzZ1QSt rcOQIdbAX0HUp51hiOlZQAqAH94f6QQ/96g77oK4= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 058GF0A8010922; Mon, 8 Jun 2020 16:15:02 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F17.5EDE638F.008B:SCFSTAT68638221, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=UqsdyN4B c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=pGLkceISAAAA:8 a=ZEvRb3mWdAbgCnYlOFwA:9 a=CjuIK1q_8ugA:10 Received-SPF: softfail client-ip=91.136.10.249; envelope-from=mattiase@acm.org; helo=mail56c50.megamailservers.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/08 12:15:04 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_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:252046 Archived-At: 8 juni 2020 kl. 14.26 skrev Pip Cet : > I believe there's very similar code for the X case, where we also > translate #fff to rgb:f/f/f. That code has annoyed me lately by > producing nonsensical GCC warnings, maybe you'd like to replace it > with yours? Having two different versions of this seems superfluous Thought crossed my mind too. I'm not sure if it makes sense to share the = code that transforms #RRGGBB to rgb:RR/GG/BB; it's not a very natural = abstraction, and just why are we doing this string transformation step = in the first place. The X11 backend does it so that it can use Xlib for the rest, which is a = dubious saving since the string-munging code isn't much simpler than = what would be needed to parse the original string to RGB values right = away. The Windows code looks more robust, except that it appears to apply a = funny numeric conversion for 4, 12 and 16 bits/colour. It doesn't look = quite right at all. We should probably have a single, correct parser for the numeric colour = strings #RGB, rgb:R/G/B, and rgbi:R/G/B instead of three subtly broken = ones. X11 and NS additionally have their own formats that I suppose we = need to retain for compatibility.