From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string Date: Sun, 4 Jun 2017 22:44:40 -0700 (PDT) Message-ID: References: <<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>> <<<83wp8ra9g6.fsf@gnu.org>>> <<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>> <<83tw3v9njh.fsf@gnu.org>> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1496641512 31738 195.159.176.226 (5 Jun 2017 05:45:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2017 05:45:12 +0000 (UTC) Cc: 27238@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 05 07:45:06 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 1dHkp6-0007wJ-Vc for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 07:45:05 +0200 Original-Received: from localhost ([::1]:59693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHkpC-0004MG-4w for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 01:45:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHkp7-0004M6-4E for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 01:45:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHkp4-0003NO-13 for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 01:45:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53725) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHkp3-0003NK-To for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 01:45:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dHkp3-0008IT-Nh for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 01:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jun 2017 05:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27238 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27238-submit@debbugs.gnu.org id=B27238.149664149131864 (code B ref 27238); Mon, 05 Jun 2017 05:45:01 +0000 Original-Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 05:44:51 +0000 Original-Received: from localhost ([127.0.0.1]:56402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHkot-0008Hs-6M for submit@debbugs.gnu.org; Mon, 05 Jun 2017 01:44:51 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:40374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHkos-0008Hf-1s for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 01:44:50 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v555ifl8001583 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Jun 2017 05:44:41 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v555if1k014466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Jun 2017 05:44:41 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v555ieFV017900; Mon, 5 Jun 2017 05:44:40 GMT In-Reply-To: <<83tw3v9njh.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6767.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] 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:133283 Archived-At: > > > > This is a useful, general function, not just a helper. > > >=20 > > > FWIW, I don't think it's general enough, because it is > > > tightly couples with face-x-resources. > >=20 > > That's only the _implementation_. > >=20 > > (That reasoning would apply also to `face-spec-recalc', `face-spec-set'= , > > `face-set-after-frame-default', `custom-face-set', `custom-face-save', > > `custom-face-mark-to-save', `custom-face-reset-saved', > > `custom-face-mark-to-reset-standard', `custom-declare-face', > > `custom-theme-set-faces', `custom-reset-faces', `woman-default-faces', > > ...) >=20 > They all call face-spec-recalc. `face-spec-recalc' calls `face-spec-2', which calls `face-x-resources'. Your complaint is that `face-spec-2' should not be treated as first-class (i.e., given a reasonable name and accurate doc) because it depends on using `face-x-resources'. As I said, that is only its current _implementation_. As far as _using_ `face-spec-2' is concerned (which is what this is about), all of the above make use of it. Given its current implementation, they depend on that implementation just as much as it does. Change the implementation and there is no coupling with it. Leave the implementation as is and they all continue to depend on it. Your reasoning applies also to all of those functions. If your argument is that we should not encourage users to use this function (by improving its name and doc) because its implementation is fragile, then that same argument applies to all current uses of it. And there are plenty, including uses defining functions, such as `face-spec-set', that are very widely used, including by users. > > Unless you essentially repeat its body, it is the only way > > to do what it does. Here's one use case: > > > > (face-spec-set-2 TARGET-FACE > > FRAME > > (face-spec-choose > > (get SOURCE-FACE 'face-defface-spec) > > FRAME)) >=20 > Why can't you do this by calling a higher-level function? What higher-level function would you suggest? That function does that job - and so it is used in `faces.el' (ultimately by all of the functions listed above). How would _you_ set one face (`fringe' or whatever), in only a given frame, to the spec of another face (or to a spec that isn't yet used for any face)? I don't see `face-spec-set' offering that possibility, at least not directly. Am I missing something? I tried it with each of the allowed SPEC-TYPEs, to see what they'd do, but none of them did that. A nil SPEC-TYPE sort of does the job, but without the ability to limit the setting to a given frame. But perhaps you have some other higher-level function in mind to do this job? If so, I wonder why `face-set-recalc' doesn't use it, instead of `face-spec-set-2.