From unknown Fri Jun 20 07:18:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#27238 <27238@debbugs.gnu.org> To: bug#27238 <27238@debbugs.gnu.org> Subject: Status: 24.5; Rename `face-spec-set-2' and give it a better doc string Reply-To: bug#27238 <27238@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:18:13 +0000 retitle 27238 24.5; Rename `face-spec-set-2' and give it a better doc string reassign 27238 emacs submitter 27238 Drew Adams severity 27238 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 04 13:42:56 2017 Received: (at submit) by debbugs.gnu.org; 4 Jun 2017 17:42:56 +0000 Received: from localhost ([127.0.0.1]:56071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHZYF-0002mf-VQ for submit@debbugs.gnu.org; Sun, 04 Jun 2017 13:42:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHZYD-0002mR-UB for submit@debbugs.gnu.org; Sun, 04 Jun 2017 13:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHZY7-0007zi-T9 for submit@debbugs.gnu.org; Sun, 04 Jun 2017 13:42:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dHZY7-0007zR-QZ for submit@debbugs.gnu.org; Sun, 04 Jun 2017 13:42:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHZY6-0006MJ-QG for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 13:42:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHZY3-0007xV-KF for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 13:42:46 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dHZY3-0007w3-Ai for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 13:42:43 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v54HgdR2020210 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 4 Jun 2017 17:42:40 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v54HgdGQ017247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 4 Jun 2017 17:42:39 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v54HgbYf003800 for ; Sun, 4 Jun 2017 17:42:38 GMT MIME-Version: 1.0 Message-ID: <06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default> Date: Sun, 4 Jun 2017 10:42:37 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 24.5; Rename `face-spec-set-2' and give it a better doc string X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6767.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This is a useful, general function, not just a helper. Please consider giving it a better name and doc string. Wrt the doc, the SPEC arg is apparently NOT a face spec, i.e., a spec such as is returned by (get FACE 'face-defface-spec). Instead, it seems to be an attributes list such as what is returned by `face-spec-choose' or `face-attr-construct'. In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/usr --host=3Di686-pc-mingw32' From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 04 14:34:42 2017 Received: (at 27238) by debbugs.gnu.org; 4 Jun 2017 18:34:42 +0000 Received: from localhost ([127.0.0.1]:56103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHaMM-0003z9-3Q for submit@debbugs.gnu.org; Sun, 04 Jun 2017 14:34:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHaMK-0003yy-PT for 27238@debbugs.gnu.org; Sun, 04 Jun 2017 14:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHaMC-00063K-E2 for 27238@debbugs.gnu.org; Sun, 04 Jun 2017 14:34:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHaMC-00063B-AL; Sun, 04 Jun 2017 14:34:32 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4630 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHaMB-0006UP-7q; Sun, 04 Jun 2017 14:34:32 -0400 Date: Sun, 04 Jun 2017 21:34:17 +0300 Message-Id: <83wp8ra9g6.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default> (message from Drew Adams on Sun, 4 Jun 2017 10:42:37 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 4 Jun 2017 10:42:37 -0700 (PDT) > From: Drew Adams > > This is a useful, general function, not just a helper. FWIW, I don't think it's general enough, because it is tightly couples with face-x-resources. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 04 15:38:21 2017 Received: (at 27238) by debbugs.gnu.org; 4 Jun 2017 19:38:21 +0000 Received: from localhost ([127.0.0.1]:56141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHbLx-0007Ej-F3 for submit@debbugs.gnu.org; Sun, 04 Jun 2017 15:38:21 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:45614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHbLv-0007EV-5W for 27238@debbugs.gnu.org; Sun, 04 Jun 2017 15:38:19 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v54JcBxP015024 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Jun 2017 19:38:12 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v54JcBnm012813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Jun 2017 19:38:11 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v54JcA1l010389; Sun, 4 Jun 2017 19:38:10 GMT MIME-Version: 1.0 Message-ID: <26a213b3-908e-43b1-a009-b8a18f0a1c23@default> Date: Sun, 4 Jun 2017 12:38:10 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>> <<83wp8ra9g6.fsf@gnu.org>> In-Reply-To: <<83wp8ra9g6.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > > 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. That's only the _implementation_. (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', ...) 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)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 04 22:27:51 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 02:27:51 +0000 Received: from localhost ([127.0.0.1]:56305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHhkF-0001oO-LB for submit@debbugs.gnu.org; Sun, 04 Jun 2017 22:27:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHhkD-0001oC-L7 for 27238@debbugs.gnu.org; Sun, 04 Jun 2017 22:27:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHhk5-0008SL-3H for 27238@debbugs.gnu.org; Sun, 04 Jun 2017 22:27:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHhk5-0008S4-0B; Sun, 04 Jun 2017 22:27:41 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4845 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHhk4-0000RK-8X; Sun, 04 Jun 2017 22:27:40 -0400 Date: Mon, 05 Jun 2017 05:27:30 +0300 Message-Id: <83tw3v9njh.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <26a213b3-908e-43b1-a009-b8a18f0a1c23@default> (message from Drew Adams on Sun, 4 Jun 2017 12:38:10 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>> <<83wp8ra9g6.fsf@gnu.org>> <26a213b3-908e-43b1-a009-b8a18f0a1c23@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 4 Jun 2017 12:38:10 -0700 (PDT) > From: Drew Adams > Cc: 27238@debbugs.gnu.org > > (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', > ...) They all call face-spec-recalc. > 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)) Why can't you do this by calling a higher-level function? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 01:44:51 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 05:44:51 +0000 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 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 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 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 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 MIME-Version: 1.0 Message-ID: Date: Sun, 4 Jun 2017 22:44:40 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>> <<<83wp8ra9g6.fsf@gnu.org>>> <<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>> <<83tw3v9njh.fsf@gnu.org>> 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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > > > > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 11:24:42 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 15:24:42 +0000 Received: from localhost ([127.0.0.1]:57733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHts1-0001lO-OF for submit@debbugs.gnu.org; Mon, 05 Jun 2017 11:24:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHts0-0001lB-4W for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 11:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHtrq-0001yn-T7 for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 11:24:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHtrq-0001yi-Pt; Mon, 05 Jun 2017 11:24:30 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1264 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHtrq-0002oi-4W; Mon, 05 Jun 2017 11:24:30 -0400 Date: Mon, 05 Jun 2017 18:24:20 +0300 Message-Id: <83lgp6a257.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: (message from Drew Adams on Sun, 4 Jun 2017 22:44:40 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>> <<<83wp8ra9g6.fsf@gnu.org>>> <<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>> <<83tw3v9njh.fsf@gnu.org>> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 4 Jun 2017 22:44:40 -0700 (PDT) > From: Drew Adams > Cc: 27238@debbugs.gnu.org > > > > (face-spec-set-2 TARGET-FACE > > > FRAME > > > (face-spec-choose > > > (get SOURCE-FACE 'face-defface-spec) > > > FRAME)) > > > > Why can't you do this by calling a higher-level function? > > What higher-level function would you suggest? face-spec-recalc and face-spec-set come to mind, for example. > 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 asked whether the higher-level functions can do the job. If they cannot, please explain why, and please provide specific details about the difficulties. Answering my question by another question doesn't help, since I'm sure I don't know enough about the job you wanted to do. > 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. There are many documented functions that set face attributes in various forms and for various sets of frames. My question is precisely whether any of them can do this job. If not, perhaps we could extend one of them to support whatever you need to do. That'd be an alternative to renaming face-spec-set-2 and making it public. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 11:55:21 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 15:55:21 +0000 Received: from localhost ([127.0.0.1]:57921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHuLh-0002f3-7b for submit@debbugs.gnu.org; Mon, 05 Jun 2017 11:55:21 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:47067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHuLf-0002eq-FU for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 11:55:20 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v55FtAWp016582 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Jun 2017 15:55:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v55FtAII022148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Jun 2017 15:55:10 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v55Ft8eF016078; Mon, 5 Jun 2017 15:55:09 GMT MIME-Version: 1.0 Message-ID: <139eede5-534a-47ad-805a-bad9995526eb@default> Date: Mon, 5 Jun 2017 08:55:06 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>> <<<<83wp8ra9g6.fsf@gnu.org>>>> <<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>> <<<83tw3v9njh.fsf@gnu.org>>> <> <<83lgp6a257.fsf@gnu.org>> In-Reply-To: <<83lgp6a257.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > > > > (face-spec-set-2 TARGET-FACE > > > > FRAME > > > > (face-spec-choose > > > > (get SOURCE-FACE 'face-defface-spec) > > > > FRAME)) > > > > > > Why can't you do this by calling a higher-level function? > > > > What higher-level function would you suggest? >=20 > face-spec-recalc and face-spec-set come to mind, for example. I don't see how either of those can be used to do the same thing. If you think otherwise, please show how. > > 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)? >=20 > I asked whether the higher-level functions can do the job. If they > cannot, please explain why, and please provide specific details about > the difficulties. Answering my question by another question doesn't > help, since I'm sure I don't know enough about the job you wanted to > do. I don't know of any that could do the job, as I've said. I described the situation with `face-spec-set', and said that I tried to use it. You can, I think, see that it is not frame-specific. The job to do is shown in the code I gave above. And it is described in the description I gave: "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 a "higher-level function" that does that. I don't see any function that does, apart from `face-spec-2'. > > 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. >=20 > There are many documented functions that set face attributes in > various forms and for various sets of frames. My question is > precisely whether any of them can do this job. If I thought that any of them could then I would not have used `face-spec-set-2'. If you know of one that can do the job (see above), please enlighten me. > If not, perhaps we could extend one of them to support > whatever you need to do. That'd be an alternative to renaming > face-spec-set-2 and making it public. Perhaps. Please consider letting, for example, `face-spec-set' take an optional FRAME argument. That would work for what I wanted to do. But that would not directly help someone who wants to pass, not a full face SPEC but the kind of non-spec "SPEC" arg that `face-spec-set-2' accepts, which is the kind of thing that `face-spec-choose' returns. IOW, in a use case where what you have to start with is not a face spec but a face-attribute plist. Not a big deal, but worth mentioning; `face-spec-set-2' accepts such a plist directly. In any case: (1) the name of `face-spec-2' is not very meaningful, and more importantly, the doc is wrong and the argument name "SPEC" is wrong. The "SPEC" arg is the kind of thing that `face-spec-choose' returns: a plist of face attributes - it is not a face spec. It's easy to see the difference when you check the definition of something like `face-spec-match-p' (or other uses of `face-spec-choose'). Its whole job is to just use `face-spec-choose' to convert a full face SPEC to a list of attributes for the given frame, so that it can then call `face-attr-match-p'. The doc for a function such as `face-spec-set-2' should, just like that for `face-attr-match-p', refer to the "SPEC" argument as ATTRS, not "SPEC", and it should say explicitly that it is a plist of face attributes and their values. Similar cleanup is called for in the code and comments of `face-spec-set-recalc', where `face-spec-set-2' is used: The variable "SPEC" there should be given another name, and the comments should talk about it appropriately - it is not a face spec. A face-attribute plist is not a face spec. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 12:33:47 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 16:33:47 +0000 Received: from localhost ([127.0.0.1]:57963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHuwt-0003Yx-2b for submit@debbugs.gnu.org; Mon, 05 Jun 2017 12:33:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHuwr-0003Yk-5z for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 12:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHuwi-000487-7q for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 12:33:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHuwi-000481-4n; Mon, 05 Jun 2017 12:33:36 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1335 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHuwh-0008Lt-3F; Mon, 05 Jun 2017 12:33:35 -0400 Date: Mon, 05 Jun 2017 19:33:26 +0300 Message-Id: <83d1ai9yy1.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <139eede5-534a-47ad-805a-bad9995526eb@default> (message from Drew Adams on Mon, 5 Jun 2017 08:55:06 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>> <<<<83wp8ra9g6.fsf@gnu.org>>>> <<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>> <<<83tw3v9njh.fsf@gnu.org>>> <> <<83lgp6a257.fsf@gnu.org>> <139eede5-534a-47ad-805a-bad9995526eb@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Mon, 5 Jun 2017 08:55:06 -0700 (PDT) > From: Drew Adams > Cc: 27238@debbugs.gnu.org > > The job to do is shown in the code I gave above. And it is > described in the description I gave: > > "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 a "higher-level function" that does that. I don't > see any function that does, apart from `face-spec-2'. Doesn't this boil down to setting the attributes of the target face to the values of the same attributes of the source face? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 12:40:29 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 16:40:29 +0000 Received: from localhost ([127.0.0.1]:57970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHv3N-0003iB-7B for submit@debbugs.gnu.org; Mon, 05 Jun 2017 12:40:29 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:36667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHv3L-0003hz-V3 for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 12:40:28 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v55GeLt0022146 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Jun 2017 16:40:21 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v55GeL9f019984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Jun 2017 16:40:21 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v55GeK2P031088; Mon, 5 Jun 2017 16:40:20 GMT MIME-Version: 1.0 Message-ID: <2ceee035-593d-4831-be30-06443ba3bc92@default> Date: Mon, 5 Jun 2017 09:40:18 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>>> <<<<<83wp8ra9g6.fsf@gnu.org>>>>> <<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>>> <<<<83tw3v9njh.fsf@gnu.org>>>> <<>> <<<83lgp6a257.fsf@gnu.org>>> <<139eede5-534a-47ad-805a-bad9995526eb@default>> <<83d1ai9yy1.fsf@gnu.org>> In-Reply-To: <<83d1ai9yy1.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > > The job to do is shown in the code I gave above. And it is > > described in the description I gave: > > > > "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 a "higher-level function" that does that. I don't > > see any function that does, apart from `face-spec-2'. >=20 > Doesn't this boil down to setting the attributes of the target face to > the values of the same attributes of the source face? Yes, of course, which is why `face-spec-set-2' does that: (defun face-spec-set-2 (face frame spec) "Set the face attributes of FACE on FRAME according to SPEC." (let (attrs) (while spec (when (assq (car spec) face-x-resources) =09(push (car spec) attrs) =09(push (cadr spec) attrs)) (setq spec (cddr spec))) (apply 'set-face-attribute face frame (nreverse attrs)))) Which is also why I said, in my first reply to you: Unless you essentially repeat its body, it is the only way ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to do what it does. Are suggesting that everyone who needs to "set the attributes of the target face to the values of the same attributes of the source face" should just write such an explicit loop (repeat the body of `face-spec-set-2') instead of just calling `face-spec-set-2'? Or are you hinting that there is some other "higher-level function" that already does exactly that? And if there is, why wouldn't `face-spec-set-recalc' use that instead of `face-spec-set-2'? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 13:12:09 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 17:12:09 +0000 Received: from localhost ([127.0.0.1]:57995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHvY1-0004PL-F8 for submit@debbugs.gnu.org; Mon, 05 Jun 2017 13:12:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHvXz-0004P7-7H for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 13:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHvXp-0000sl-Sx for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 13:12:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvXp-0000sZ-Oq; Mon, 05 Jun 2017 13:11:57 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1640 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHvXo-0006hw-V5; Mon, 05 Jun 2017 13:11:57 -0400 Date: Mon, 05 Jun 2017 20:11:48 +0300 Message-Id: <83bmq29x63.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <2ceee035-593d-4831-be30-06443ba3bc92@default> (message from Drew Adams on Mon, 5 Jun 2017 09:40:18 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>>> <<<<<83wp8ra9g6.fsf@gnu.org>>>>> <<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>>> <<<<83tw3v9njh.fsf@gnu.org>>>> <<>> <<<83lgp6a257.fsf@gnu.org>>> <<139eede5-534a-47ad-805a-bad9995526eb@default>> <<83d1ai9yy1.fsf@gnu.org>> <2ceee035-593d-4831-be30-06443ba3bc92@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Mon, 5 Jun 2017 09:40:18 -0700 (PDT) > From: Drew Adams > Cc: 27238@debbugs.gnu.org > > > > "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 a "higher-level function" that does that. I don't > > > see any function that does, apart from `face-spec-2'. > > > > Doesn't this boil down to setting the attributes of the target face to > > the values of the same attributes of the source face? > > Yes, of course, which is why `face-spec-set-2' does that: No, it also consults face-x-resources, which is not necessarily what the caller wants. > Are suggesting that everyone who needs to "set the attributes > of the target face to the values of the same attributes of the > source face" should just write such an explicit loop (repeat > the body of `face-spec-set-2') instead of just calling > `face-spec-set-2'? Are you suggesting that for every loop someone might possibly need at some point we should have a documented and public function in Emacs? > Or are you hinting that there is some other "higher-level > function" that already does exactly that? Well, there's defface with :inherit, and there's copy-face, to name just two. You didn't describe enough context of what you want to do, so I cannot be sure they are not relevant. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 13:56:25 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 17:56:25 +0000 Received: from localhost ([127.0.0.1]:58021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwEr-0005O1-Iy for submit@debbugs.gnu.org; Mon, 05 Jun 2017 13:56:25 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:40529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwEp-0005No-0o for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 13:56:23 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v55HuFx7012896 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Jun 2017 17:56:16 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v55HuFvM022409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Jun 2017 17:56:15 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v55HuEsv022995; Mon, 5 Jun 2017 17:56:15 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 5 Jun 2017 10:56:13 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>>>> <<<<<<83wp8ra9g6.fsf@gnu.org>>>>>> <<<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>>>> <<<<<83tw3v9njh.fsf@gnu.org>>>>> <<<>>> <<<<83lgp6a257.fsf@gnu.org>>>> <<<139eede5-534a-47ad-805a-bad9995526eb@default>>> <<<83d1ai9yy1.fsf@gnu.org>>> <<2ceee035-593d-4831-be30-06443ba3bc92@default>> <<83bmq29x63.fsf@gnu.org>> In-Reply-To: <<83bmq29x63.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > > > > "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 a "higher-level function" that does that. I don't > > > > see any function that does, apart from `face-spec-2'. > > > > > > Doesn't this boil down to setting the attributes of the target face t= o > > > the values of the same attributes of the source face? > > > > Yes, of course, which is why `face-spec-set-2' does that: >=20 > No, it also consults face-x-resources, which is not necessarily what > the caller wants. That's not the point. The point is code to "set the attributes of the target face to the values of the same attributes of the source face". Do you see another function that does that? > > Are suggesting that everyone who needs to "set the attributes > > of the target face to the values of the same attributes of the > > source face" should just write such an explicit loop (repeat > > the body of `face-spec-set-2') instead of just calling > > `face-spec-set-2'? >=20 > Are you suggesting that for every loop someone might possibly need at > some point we should have a documented and public function in Emacs? Do you think I am? Why? > > Or are you hinting that there is some other "higher-level > > function" that already does exactly that? >=20 > Well, there's defface with :inherit, and there's copy-face, to name > just two. You didn't describe enough context of what you want to do, > so I cannot be sure they are not relevant. Should I explicitly have mentioned that I don't want to inherit another face? But I did forget that `copy-face', where the NEW-FACE arg is an existing face, does what I was looking for. Thanks for the reminder about it. That works for my use case. (Why doesn't `face-spec-recalc' use `copy-face' instead of `face-spec-set-2'? I guess it's to check the return value of `face-spec-choose', which it goes to the trouble of calling for each face that it iterates over.) BTW, while looking to see if Emacs 22 would support my code, since it will not use `face-spec-set-2', I (re)discovered that prior to Emacs 24.3 `frame-set-spec' DID let you specify the FRAME. The signature of `frame-spec-set' was changed incompatibly after Emacs 24.3. (I still suggest fixing the doc string of `face-spec-set-2', as it is misleading about its "SPEC" arg.) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 14:43:46 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 18:43:46 +0000 Received: from localhost ([127.0.0.1]:58042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwyf-0006TW-TO for submit@debbugs.gnu.org; Mon, 05 Jun 2017 14:43:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwye-0006TH-6v for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 14:43:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHwyU-0006O1-Nj for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 14:43:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHwyU-0006Nw-KR; Mon, 05 Jun 2017 14:43:34 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1728 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dHwyT-0004rY-Tr; Mon, 05 Jun 2017 14:43:34 -0400 Date: Mon, 05 Jun 2017 21:43:25 +0300 Message-Id: <83a85m9sxe.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: (message from Drew Adams on Mon, 5 Jun 2017 10:56:13 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>>>> <<<<<<83wp8ra9g6.fsf@gnu.org>>>>>> <<<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>>>> <<<<<83tw3v9njh.fsf@gnu.org>>>>> <<<>>> <<<<83lgp6a257.fsf@gnu.org>>>> <<<139eede5-534a-47ad-805a-bad9995526eb@default>>> <<<83d1ai9yy1.fsf@gnu.org>>> <<2ceee035-593d-4831-be30-06443ba3bc92@default>> <<83bmq29x63.fsf@gnu.org>> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Mon, 5 Jun 2017 10:56:13 -0700 (PDT) > From: Drew Adams > Cc: 27238@debbugs.gnu.org > > (I still suggest fixing the doc string of `face-spec-set-2', as it is > misleading about its "SPEC" arg.) I'm not sure I understand why it's misleading. You said: > Wrt the doc, the SPEC arg is apparently NOT a face spec, i.e., a spec > such as is returned by (get FACE 'face-defface-spec). Instead, it seems > to be an attributes list such as what is returned by `face-spec-choose' > or `face-attr-construct'. However, "face spec" is described in '(elisp)Defining Faces' as and alist whose elements each have the form (DISPLAY . PLIST) and I believe the SPEC argument accepted by face-spec-choose has this form. The argument received by face-spec-set-2 is just the PLIST which matches the frame's display, i.e. a simple list. So what would you want the doc string to say about this? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 15:37:07 2017 Received: (at 27238) by debbugs.gnu.org; 5 Jun 2017 19:37:07 +0000 Received: from localhost ([127.0.0.1]:58070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHxoH-0007s0-6O for submit@debbugs.gnu.org; Mon, 05 Jun 2017 15:37:06 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:17141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHxoF-0007rT-IP for 27238@debbugs.gnu.org; Mon, 05 Jun 2017 15:37:04 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v55JauUX002763 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Jun 2017 19:36:56 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v55Jaue7011750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Jun 2017 19:36:56 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v55Jatd7015384; Mon, 5 Jun 2017 19:36:56 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 5 Jun 2017 12:36:54 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>>>>> <<<<<<<83wp8ra9g6.fsf@gnu.org>>>>>>> <<<<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>>>>> <<<<<<83tw3v9njh.fsf@gnu.org>>>>>> <<<<>>>> <<<<<83lgp6a257.fsf@gnu.org>>>>> <<<<139eede5-534a-47ad-805a-bad9995526eb@default>>>> <<<<83d1ai9yy1.fsf@gnu.org>>>> <<<2ceee035-593d-4831-be30-06443ba3bc92@default>>> <<<83bmq29x63.fsf@gnu.org>>> <> <<83a85m9sxe.fsf@gnu.org>> In-Reply-To: <<83a85m9sxe.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27238 Cc: 27238@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > > (I still suggest fixing the doc string of `face-spec-set-2', as it is > > misleading about its "SPEC" arg.) >=20 > I'm not sure I understand why it's misleading. You said: >=20 > > Wrt the doc, the SPEC arg is apparently NOT a face spec, i.e., a spec > > such as is returned by (get FACE 'face-defface-spec). Instead, it seem= s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > to be an attributes list such as what is returned by `face-spec-choose' ^^^^^^^^^^^ > > or `face-attr-construct'. >=20 > However, "face spec" is described in '(elisp)Defining Faces' as and > alist whose elements each have the form >=20 > (DISPLAY . PLIST) >=20 > and I believe the SPEC argument accepted by face-spec-choose has this ^^^^^^^^^^^ > form. Yes. > The argument received by face-spec-set-2 is just the PLIST > which matches the frame's display, i.e. a simple list. Yes. It is not a face spec. It is a face-attributes plist. > So what would you want the doc string to say about this? The SPEC arg accepted by `face-spec-choose', and by (all of?) the other face functions whose signatures mention a SPEC arg, is of the same form. But the "SPEC" accepted by `face-spec-set-2' is not of that form. Instead, it is of the form that is _returned_ by `face-spec-choose' - it is a plist of face attributes. Such a plist is also what is accepted as the ATTRS argument of `face-attr-match-p'. It is more properly referred to as ATTRS or ATTRIBUTES or some such. It is not a face spec. This is a face SPEC: ((((background dark)) (:background "DarkMagenta")) (t (:background "LightGreen" :foreground "Red"))) This is a face-attributes list: (:background "LightGreen" :foreground "Red") I've said the same thing several times now. HTH. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 10 04:42:11 2017 Received: (at 27238-done) by debbugs.gnu.org; 10 Jun 2017 08:42:11 +0000 Received: from localhost ([127.0.0.1]:37776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJbyF-00025X-6a for submit@debbugs.gnu.org; Sat, 10 Jun 2017 04:42:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJbyD-00025J-Ni for 27238-done@debbugs.gnu.org; Sat, 10 Jun 2017 04:42:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJby5-00020n-9v for 27238-done@debbugs.gnu.org; Sat, 10 Jun 2017 04:42:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJby5-00020j-6U; Sat, 10 Jun 2017 04:42:01 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4222 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dJby4-0001ys-6W; Sat, 10 Jun 2017 04:42:00 -0400 Date: Sat, 10 Jun 2017 11:41:44 +0300 Message-Id: <83a85g6xpz.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: (message from Drew Adams on Mon, 5 Jun 2017 12:36:54 -0700 (PDT)) Subject: Re: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string References: <<<<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>>>>>>> <<<<<<<83wp8ra9g6.fsf@gnu.org>>>>>>> <<<<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>>>>>> <<<<<<83tw3v9njh.fsf@gnu.org>>>>>> <<<<>>>> <<<<<83lgp6a257.fsf@gnu.org>>>>> <<<<139eede5-534a-47ad-805a-bad9995526eb@default>>>> <<<<83d1ai9yy1.fsf@gnu.org>>>> <<<2ceee035-593d-4831-be30-06443ba3bc92@default>>> <<<83bmq29x63.fsf@gnu.org>>> <> <<83a85m9sxe.fsf@gnu.org>> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27238-done Cc: 27238-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Mon, 5 Jun 2017 12:36:54 -0700 (PDT) > From: Drew Adams > Cc: 27238@debbugs.gnu.org > > > The argument received by face-spec-set-2 is just the PLIST > > which matches the frame's display, i.e. a simple list. > > Yes. It is not a face spec. It is a face-attributes plist. OK, I renamed SPEC to FACE-ATTRS where appropriate, and improved the related doc strings. Thanks. From unknown Fri Jun 20 07:18:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 08 Jul 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator