[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25890: Default value of digits-per-component?
From: |
Clément Pit-Claudel |
Subject: |
bug#25890: Default value of digits-per-component? |
Date: |
Wed, 29 Mar 2017 16:01:09 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Hi all,
> 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.
This is a public function, with many callers outside of Emacs, it seems
(https://github.com/search?l=Emacs+Lisp&q=color-rgb-to-hex&type=Code&utf8=%E2%9C%93);
it will certainly break some of these uses (it did break my uses of it :/) I
tend to follow the ChangeLogs and emacs-devel discussions, but I didn't see it
mentioned there; maybe it would be good to?
> 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?
It sounds much better to me: the current solution breaks all code silently,
while a new function doesn't break any code and me authors time to adjust.
Additionally, with a new function, it's easy to write code that's compatible
with all versions of Emacs (I just check whether the new function is fboundp).
With the current change, I have to inspect the function's signature to
determine how to call it (is there a simpler way?).
An alternative is to advertise the argument as required, default to '2', and
issue a warning when that argument isn't explicitly specified — a bit like what
was done with looking-back.
Thanks!
Clément.
- bug#25890: Default value of digits-per-component?,
Clément Pit-Claudel <=