From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Newsgroups: gmane.emacs.bugs Subject: bug#25890: Default value of digits-per-component? Date: Wed, 29 Mar 2017 16:01:09 -0400 Message-ID: <6acea5ef-1c46-fefd-8cf6-290a0308185b@gmail.com> References: <87zih7n2yt.fsf@pank.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1490823215 24344 195.159.176.226 (29 Mar 2017 21:33:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Mar 2017 21:33:35 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 To: 25890@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 29 23:33:29 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctLDY-0005S7-KB for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Mar 2017 23:33:24 +0200 Original-Received: from localhost ([::1]:32805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctLDe-00057H-Ma for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Mar 2017 17:33:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctLCM-0004US-6B for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2017 17:32:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctLCH-000702-Es for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2017 17:32:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53492) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctLCH-0006zy-C5 for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2017 17:32:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ctLCE-0005wx-4u for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2017 17:32:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87zih7n2yt.fsf@pank.eu> Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Mar 2017 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25890 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25890-submit@debbugs.gnu.org id=B25890.149082309522833 (code B ref 25890); Wed, 29 Mar 2017 21:32:02 +0000 Original-Received: (at 25890) by debbugs.gnu.org; 29 Mar 2017 21:31:35 +0000 Original-Received: from localhost ([127.0.0.1]:51691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctLBn-0005wD-0C for submit@debbugs.gnu.org; Wed, 29 Mar 2017 17:31:35 -0400 Original-Received: from mail-qt0-f173.google.com ([209.85.216.173]:35950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctJmP-0003pc-H1 for 25890@debbugs.gnu.org; Wed, 29 Mar 2017 16:01:17 -0400 Original-Received: by mail-qt0-f173.google.com with SMTP id r45so22508827qte.3 for <25890@debbugs.gnu.org>; Wed, 29 Mar 2017 13:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=Dz+4bjnn6cT1CM+OUKOt7otjfCuWWtXenRgpdfwOFtU=; b=Pw2a/VuiiGmPFr8LsMSbSFh3W+60gd/osH+RObjSNp0Nof/vYI2SqLLxnmZHrhX2x3 5KjB/0/lh7qPdToPspYHJP73V12euC2TXdpE9YlLItj/xWCvjQajYWn8H5NyKjj+b3SM 34Wxd9ihqZFaPVCHKT8nir9Vdy5Xm7YxdsEsv9wZqa2M2Sum69a+tU1uKW4J9OIVZlTQ 46Fh75uY1obsy8YVGgQrz6ka/8BEhsxObsKdZsjGBsmqYuZI9Eojp4uIyyPuVhtjYMLz SamPEH6eaGRtK9bB15WZ2fmMuOA8/Pn31obq1/KRfyw4/tfzrinqkNLo4pG2DT5V1ITv ACdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=Dz+4bjnn6cT1CM+OUKOt7otjfCuWWtXenRgpdfwOFtU=; b=K+gwtxd5rPHxiS0/8tmuDTu4EAyxIQD1y6Nr3nh8qZUzIbRnSABwnWimRskeH6vN6P hn7efqxWSeDsclr8I1Kt+CscbejHkk1HwhUo6z9+x0nYpqJxRq+mBK8ZkYATEzrokNjf 8CmGPxvMO6MGOHEgFyfC9ruG1RD0zD6FYkWoxTYFT+n7JlJsAocKHxh+wi9ABjcJ2cri PK2+tp2mGGFVudvPZGGK5LumWIFgRG7L6tRap+WTQGdB1Gh7dC3QMqf3XefJ4Ec//Eum mCiVT9YHMzo90MKNhsnyYbjGijAw5l6EJE16zTzs/1iRiCRKgQ5vWvbYS9Z0L9HBmdaa WVIw== X-Gm-Message-State: AFeK/H0FbcZJ+1o5jDjDsZyukB/7qmILhUEiUSVzz+JKhAiNW3pukVyKMA3lTlhKDR0jYQ== X-Received: by 10.200.57.162 with SMTP id v31mr2704456qte.173.1490817671630; Wed, 29 Mar 2017 13:01:11 -0700 (PDT) Original-Received: from ?IPv6:2001:470:8b2d:1a:9bab:c177:73b2:20a9? ([2001:470:8b2d:1a:9bab:c177:73b2:20a9]) by smtp.gmail.com with ESMTPSA id 44sm5559691qtn.56.2017.03.29.13.01.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 13:01:11 -0700 (PDT) X-Mailman-Approved-At: Wed, 29 Mar 2017 17:31:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131075 Archived-At: 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.