[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30377: 27.0.50; Missing and misspelled SHR/CSS colors
From: |
Basil L. Contovounesios |
Subject: |
bug#30377: 27.0.50; Missing and misspelled SHR/CSS colors |
Date: |
Wed, 07 Feb 2018 03:37:05 +0000 |
0001-Fix-shr-and-CSS-4-color-maps.patch
Description: Text Data
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
- bug#30377: 27.0.50; Missing and misspelled SHR/CSS colors,
Basil L. Contovounesios <=