From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: 30377@debbugs.gnu.org
Cc: "Julien Danjou" <julien@danjou.info>,
"Tom Tromey" <tom@tromey.com>,
"Simen Heggestøyl" <simenheg@gmail.com>
Subject: bug#30377: 27.0.50; Missing and misspelled SHR/CSS colors
Date: Wed, 07 Feb 2018 03:37:05 +0000 [thread overview]
Message-ID: <87eflxii72.fsf@tcd.ie> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Fix-shr-and-CSS-4-color-maps.patch --]
[-- Type: text/x-diff, Size: 2196 bytes --]
From abb1b62bb2cda93cc902d06dd438a37fdcb1a7cf Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
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
[-- Attachment #2: Type: text/plain, Size: 2050 bytes --]
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
next reply other threads:[~2018-02-07 3:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-07 3:37 Basil L. Contovounesios [this message]
2018-02-07 9:45 ` bug#30377: 27.0.50; Missing and misspelled SHR/CSS colors Simen Heggestøyl
2018-02-07 18:22 ` Eli Zaretskii
2018-02-07 21:19 ` Simen Heggestøyl
2018-02-07 15:03 ` Tom Tromey
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=87eflxii72.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=30377@debbugs.gnu.org \
--cc=julien@danjou.info \
--cc=simenheg@gmail.com \
--cc=tom@tromey.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.