unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: 25890@debbugs.gnu.org
Subject: bug#25890: Default value of digits-per-component?
Date: Wed, 29 Mar 2017 16:01:09 -0400	[thread overview]
Message-ID: <6acea5ef-1c46-fefd-8cf6-290a0308185b@gmail.com> (raw)
In-Reply-To: <87zih7n2yt.fsf@pank.eu>

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.





  parent reply	other threads:[~2017-03-29 20:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 14:05 bug#25890: 26.0.50; `color-values` gives wrong value Rasmus
2017-02-27 15:51 ` Eli Zaretskii
2017-02-27 17:09   ` bug#25890: " Rasmus
2017-02-27 23:36   ` bug#25890: 26.0.50; " Michael Heerdegen
2017-02-28  9:44     ` bug#25890: " Rasmus
2017-02-28 15:50       ` Eli Zaretskii
2017-02-28 23:42         ` Michael Heerdegen
2017-02-28 23:54           ` Drew Adams
2017-03-03 14:16             ` Eli Zaretskii
2017-03-01  3:43           ` Eli Zaretskii
2017-03-01  9:55         ` Rasmus
2017-03-03 14:08           ` Eli Zaretskii
2017-03-04 14:24             ` Simen Heggestøyl
2017-03-04 14:38               ` Eli Zaretskii
2017-03-04 15:44                 ` Lars Ingebrigtsen
2017-03-04 16:15                   ` Eli Zaretskii
2017-03-10  5:23 ` mail
2017-03-10  7:28   ` Eli Zaretskii
2017-03-10  8:13     ` mail
2017-03-10  8:33       ` mail
2017-03-10  9:28         ` Eli Zaretskii
2017-03-11 10:06           ` mail
2017-03-10  9:25       ` Eli Zaretskii
2017-03-10 11:07         ` Lars Ingebrigtsen
2017-03-10 13:32           ` Eli Zaretskii
2017-03-11 10:08             ` mail
2017-03-29 20:01 ` Clément Pit-Claudel [this message]
2017-03-30  2:36   ` bug#25890: Default value of digits-per-component? Eli Zaretskii
2017-03-30  3:10     ` Clément Pit-Claudel

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6acea5ef-1c46-fefd-8cf6-290a0308185b@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=25890@debbugs.gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).