all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: 25525@debbugs.gnu.org, simenheg@gmail.com
Subject: bug#25525: 25.1.90; add color highlighting to css mode
Date: Sun, 05 Mar 2017 17:34:41 +0200	[thread overview]
Message-ID: <83efybka9a.fsf@gnu.org> (raw)
In-Reply-To: <87mvd0igv9.fsf@tromey.com> (message from Tom Tromey on Sat, 04 Mar 2017 19:42:34 -0700)

> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>,  25525@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
> Date: Sat, 04 Mar 2017 19:42:34 -0700
> 
> >>>>> "Simen" == Simen Heggestøyl <simenheg@gmail.com> writes:
> 
> Simen> There is also a test failure when you rebase the patch on the latest
> Simen> master due to the changes in 7b00e956b4. It can be fixed by passing 2
> Simen> as the last argument to `color-rgb-to-hex' in `css--hsl-color'.
> 
> This happens due to the change in 7b00e956b485d8ade03c870cbdd0ae086348737b,
> which changed color-name-to-rgb in a backward-incompatible way.
> Eli, you made this change -- it seems to me that it would be safer if it
> defaulted to 2 digits, which was how it worked previously.  This would
> be backward-compatible and allow the new functionality as well.

If we leave the default at 2, people will never discover they need to
use 4 there, and the original problem which prompted those changes
will be still with us years from now.  The reasons for using 4-digit
(i.e. 16 bits per component) hex specifications are subtle and buried
deep in the Emacs internals related to color calculations.  I don't
expect Lisp programmers to understand those reasons.  I actually
forgot about this subtlety myself, until that bug surfaced.

When I worked on the change, it seemed harmless: the function has only
one caller outside of color.el, and I changed that single caller to
use the optional argument.  css-mode is the second such caller, and if
the code was there when I made the changes, I'd have fixed that as
well.  Both shr-color and css-mode manipulate Web-related color specs,
where 2 hex digits per component are the rule.  That's a niche
application, as far as color management in Emacs is concerned, so,
unfortunate as it is, it's up to the people who develop such
applications to know that they need 2 digits rather than the default
4.

If the change I made is nevertheless deemed too drastic, then what are
our alternatives?  The only one I could think of is to define a new
function and deprecate color-name-to-rgb in favor of that new
function, which will then display warnings when code using it is
compiled, and eventually cause them to make changes in their code
anyway.  Is that better?  Or are there any better ideas?





  reply	other threads:[~2017-03-05 15:34 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  8:06 bug#25525: 25.1.90; add color highlighting to css mode Tom Tromey
2017-01-25 15:51 ` Eli Zaretskii
2017-01-25 17:25   ` Tom Tromey
2017-01-25 23:34     ` Tom Tromey
2017-01-26 16:05       ` Eli Zaretskii
2017-01-26 17:13         ` Tom Tromey
2017-01-26 19:32           ` Eli Zaretskii
2017-02-11  4:11             ` Tom Tromey
2017-01-26 17:17         ` Tom Tromey
2017-01-25 16:52 ` Glenn Morris
2017-01-25 20:23 ` Simen Heggestøyl
2017-01-25 20:41   ` Tom Tromey
2017-01-25 23:24   ` Tom Tromey
2017-01-26 18:25     ` Simen Heggestøyl
2017-02-11  4:16       ` Tom Tromey
2017-02-11 15:17       ` Tom Tromey
2017-02-17 19:29         ` Simen Heggestøyl
2017-03-04 17:55           ` Tom Tromey
2017-03-04 18:46             ` Simen Heggestøyl
2017-03-04 19:58               ` Tom Tromey
2017-03-05 18:28                 ` Simen Heggestøyl
     [not found]                   ` <871str3b48.fsf@tromey.com>
2017-03-20 21:28                     ` Tom Tromey
2017-03-22 22:07                     ` Tom Tromey
2017-03-29 18:27                       ` Simen Heggestøyl
2017-04-21  3:40                         ` Tom Tromey
2017-04-21  9:33                           ` Andreas Schwab
2017-04-22  0:44                             ` Tom Tromey
2017-04-22 15:07                           ` Simen Heggestøyl
2017-04-24 13:44                             ` Tom Tromey
2017-04-29  4:17                               ` Tom Tromey
2017-05-01 19:15                                 ` Simen Heggestøyl
2017-05-03 22:04                                   ` Tom Tromey
2017-05-01 21:25                                 ` Etienne Prud’homme
2017-05-03 22:03                                   ` Tom Tromey
2017-05-03 23:24                                     ` Etienne Prud’homme
2017-05-04  3:51                                       ` Tom Tromey
2017-03-05  2:42               ` Tom Tromey
2017-03-05 15:34                 ` Eli Zaretskii [this message]
2017-05-03 22:04 ` bug#25525: done 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=83efybka9a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25525@debbugs.gnu.org \
    --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.