From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#30377: 27.0.50; Missing and misspelled SHR/CSS colors Date: Wed, 07 Feb 2018 03:37:05 +0000 Message-ID: <87eflxii72.fsf@tcd.ie> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1517974591 3100 195.159.176.226 (7 Feb 2018 03:36:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Feb 2018 03:36:31 +0000 (UTC) Cc: Julien Danjou , Tom Tromey , Simen =?UTF-8?Q?Heggest=C3=B8yl?= To: 30377@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 07 04:36:27 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejGWs-0008AO-NR for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Feb 2018 04:36:14 +0100 Original-Received: from localhost ([::1]:42758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejGYs-0002So-7O for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Feb 2018 22:38:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejGYg-0002Qt-6b for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2018 22:38:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejGYe-0008AN-RV for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2018 22:38:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52887) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejGYe-0008AB-Le for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2018 22:38:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ejGYc-0005WF-GQ; Tue, 06 Feb 2018 22:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: tom@tromey.com, julien@danjou.info, simenheg@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Feb 2018 03:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30377 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Tom Tromey , Julien Danjou , Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Received: via spool by submit@debbugs.gnu.org id=B.151797464521159 (code B ref -1); Wed, 07 Feb 2018 03:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Feb 2018 03:37:25 +0000 Original-Received: from localhost ([127.0.0.1]:60781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejGY1-0005VB-85 for submit@debbugs.gnu.org; Tue, 06 Feb 2018 22:37:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejGXz-0005Ux-3t for submit@debbugs.gnu.org; Tue, 06 Feb 2018 22:37:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejGXs-0007vm-Jf for submit@debbugs.gnu.org; Tue, 06 Feb 2018 22:37:17 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ejGXs-0007vi-Fr for submit@debbugs.gnu.org; Tue, 06 Feb 2018 22:37:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejGXr-00022r-24 for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2018 22:37:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejGXp-0007uw-QC for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2018 22:37:15 -0500 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:34085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejGXp-0007ug-Fn for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2018 22:37:13 -0500 Original-Received: by mail-wm0-x22b.google.com with SMTP id j21-v6so20649114wmh.1 for ; Tue, 06 Feb 2018 19:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=YLS5/j7KGFhGW020G6DTN7Rf6WA+0Dp0UlNVQ1PBteI=; b=AKGiU8lIMBCACS4BPUyx8OZdCHz9vz/hLxCMtka0BiHPPAObfTLT/ZTTNu4tLzWzhE T7lOcL8Ty5GRJVCJI2PaK1GaQ+W+VSddbcThamo0R8o7KH5jnriMGu8TZxya9FNH1gns +Dp2Ur2J5woedkqaFuvzePs1RoYVI7ec9raHg6lQhXAAjMKIeHa2duwyMuvQvRv/vxAY X2h0uZRZD/Ro78ONd6m8I5vXjOYWeWjLh0XRpJE5hdxt1vBC8USUpf/q8m418fNM/tl4 H83IaUPv6P5PHI7nAlpO64aOrpo/3GngSMD8E7FmoOCuvWFLlqVfD3Bwu7o2ODudD9cD 2epw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=YLS5/j7KGFhGW020G6DTN7Rf6WA+0Dp0UlNVQ1PBteI=; b=uNRPtjyXi5WUETHdceCue0rWpBRd/k2a1C7iE6K7N7Whp6jD16TtQXG45YeOSDTMk6 Wk9wLPDNZTypVWMoBZ1XBZ5dFVWAmaYjaybvb7xpbvMjJEQyc+DtZ0dGDX6d0Im4K9ee PlrNJ9KRUfOsD5c0NpjSU0ne+xOgC0FRUGL4hAzlSbtONwg9DG5ViR/PuCT7oqVvBh85 5DfGG+QPKNxZdomKJK/yOuY7iy0Zc03N9wZ/rzgjvpud0kuiWFgMgyk2yC8xNH18EG1v LSBkxP0VfYctjNVvCuvOvWvj8T3OyJHaBtPgfv537w0SQWagkiNDQbaCcGCb24Fvl2y2 SD1Q== X-Gm-Message-State: APf1xPB1o/LJrTAo8dNSPAbVccdJaAJvAKu8xsZQ02QuX5FblDgCsmHQ ovqMjU9BlPOc3ewnwoLcGZ7sKpR+ X-Google-Smtp-Source: AH8x226l1+I/OZ/+uDkKI3XtzP6x6Cq/GU0EBd8racTXCWv40kCrbyF57HocrxymFp4XXxVpviZFpQ== X-Received: by 10.80.165.243 with SMTP id b48mr6637238edc.201.1517974631487; Tue, 06 Feb 2018 19:37:11 -0800 (PST) Original-Received: from localhost ([2a02:8084:4f41:8c80:9c34:da08:a010:edfc]) by smtp.gmail.com with ESMTPSA id e12sm411027edi.29.2018.02.06.19.37.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 19:37:10 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143000 Archived-At: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-shr-and-CSS-4-color-maps.patch >From abb1b62bb2cda93cc902d06dd438a37fdcb1a7cf Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 7 Feb 2018 02:49:08 +0000 Subject: [PATCH] Fix shr and CSS 4 color maps * lisp/net/shr-color.el (shr-color-html-colors-alist): Fix typos. Add RebeccaPurple. * lisp/textmodes/css-mode.el (css--color-map): Add fuchsia-magenta and aqua-cyan aliases. --- lisp/net/shr-color.el | 5 +++-- lisp/textmodes/css-mode.el | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/net/shr-color.el b/lisp/net/shr-color.el index 31f3d46ed6..6303141c89 100644 --- a/lisp/net/shr-color.el +++ b/lisp/net/shr-color.el @@ -137,7 +137,7 @@ shr-color-html-colors-alist ("MediumAquaMarine" . "#66CDAA") ("MediumBlue" . "#0000CD") ("MediumOrchid" . "#BA55D3") - ("MediumPurple" . "#9370D8") + ("MediumPurple" . "#9370DB") ("MediumSeaGreen" . "#3CB371") ("MediumSlateBlue" . "#7B68EE") ("MediumSpringGreen" . "#00FA9A") @@ -158,7 +158,7 @@ shr-color-html-colors-alist ("PaleGoldenRod" . "#EEE8AA") ("PaleGreen" . "#98FB98") ("PaleTurquoise" . "#AFEEEE") - ("PaleVioletRed" . "#D87093") + ("PaleVioletRed" . "#DB7093") ("PapayaWhip" . "#FFEFD5") ("PeachPuff" . "#FFDAB9") ("Peru" . "#CD853F") @@ -166,6 +166,7 @@ shr-color-html-colors-alist ("Plum" . "#DDA0DD") ("PowderBlue" . "#B0E0E6") ("Purple" . "#800080") + ("RebeccaPurple" . "#663399") ("Red" . "#FF0000") ("RosyBrown" . "#BC8F8F") ("RoyalBlue" . "#4169E1") diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 55c21f8acb..727bc18ebb 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -499,6 +499,7 @@ css--color-map ("red" . "#ff0000") ("purple" . "#800080") ("fuchsia" . "#ff00ff") + ("magenta" . "#ff00ff") ("green" . "#008000") ("lime" . "#00ff00") ("olive" . "#808000") @@ -507,6 +508,7 @@ css--color-map ("blue" . "#0000ff") ("teal" . "#008080") ("aqua" . "#00ffff") + ("cyan" . "#00ffff") ("orange" . "#ffa500") ("aliceblue" . "#f0f8ff") ("antiquewhite" . "#faebd7") -- 2.15.1 --=-=-= Content-Type: text/plain I attach a patch to fix the following minor issues. 1. The variable shr-color-html-colors-alist from lisp/net/shr-color.el is missing the CSS 4 colour RebeccaPurple and contains typos in the hex value of colours MediumPurple and PaleVioletRed. 2. The variable css--color-map from lisp/textmodes/css-mode.el is missing the magenta and cyan aliases of fuchsia and aqua, respectively. I have taken the liberty of CCing the authors of these features both for comment on this patch, but more importantly to address Eli's question from bug#25525 anew: > I wonder whether it would make sense to reuse some existing data and > code here? In that bug report, which introduced css--color-map, Eli was referring to the list of colours in lisp/term/tty-colors.el. I would instead like to draw attention to the overlap between css--color-map and shr-color-html-colors-alist. In particular, applying the patch proposed herein satisfies the following condition: (seq-set-equal-p css--color-map shr-color-html-colors-alist (lambda (a b) (and (eq t (compare-strings (car a) nil nil (car b) nil nil t)) (eq t (compare-strings (cdr a) nil nil (cdr b) nil nil t))))) In other words, css--color-map and shr-color-html-colors-alist become identical, bar letter case. I have additionally cross-checked the updated maps with the latest CSS spec[1] and did not find any other omissions. [1] https://www.w3.org/TR/css-color-4/. So, would it be reasonable for one mode to reuse the map of the other? A (very) cursory glance through bug#25525 and lisp/net/shr-color.el suggests there may be some further code duplication pertaining to colour distances; is this so? Thanks (and apologies if the noise is unjustified), -- Basil In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-02-03 built on thunk Repository revision: 84c9dba4cee052b68b194c3a2e5c297a94d8c8af Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Debian GNU/Linux buster/sid --=-=-=--