From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: 27238@debbugs.gnu.org
Subject: bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string
Date: Mon, 5 Jun 2017 10:56:13 -0700 (PDT) [thread overview]
Message-ID: <a67cb3cf-a77f-4161-babd-eb475e16da95@default> (raw)
In-Reply-To: <<83bmq29x63.fsf@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.
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'?
>
> 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?
>
> 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.)
next parent reply other threads:[~2017-06-05 17:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>
[not found] ` <<<<<<83wp8ra9g6.fsf@gnu.org>
[not found] ` <<<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>
[not found] ` <<<<<83tw3v9njh.fsf@gnu.org>
[not found] ` <<<<c2f33d90-673d-4f13-894f-a26a52cf1a0d@default>
[not found] ` <<<<83lgp6a257.fsf@gnu.org>
[not found] ` <<<139eede5-534a-47ad-805a-bad9995526eb@default>
[not found] ` <<<83d1ai9yy1.fsf@gnu.org>
[not found] ` <<2ceee035-593d-4831-be30-06443ba3bc92@default>
[not found] ` <<83bmq29x63.fsf@gnu.org>
2017-06-05 17:56 ` Drew Adams [this message]
2017-06-05 18:43 ` bug#27238: 24.5; Rename `face-spec-set-2' and give it a better doc string Eli Zaretskii
[not found] <<<<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>
[not found] ` <<<<<<<83wp8ra9g6.fsf@gnu.org>
[not found] ` <<<<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>
[not found] ` <<<<<<83tw3v9njh.fsf@gnu.org>
[not found] ` <<<<<c2f33d90-673d-4f13-894f-a26a52cf1a0d@default>
[not found] ` <<<<<83lgp6a257.fsf@gnu.org>
[not found] ` <<<<139eede5-534a-47ad-805a-bad9995526eb@default>
[not found] ` <<<<83d1ai9yy1.fsf@gnu.org>
[not found] ` <<<2ceee035-593d-4831-be30-06443ba3bc92@default>
[not found] ` <<<83bmq29x63.fsf@gnu.org>
[not found] ` <<a67cb3cf-a77f-4161-babd-eb475e16da95@default>
[not found] ` <<83a85m9sxe.fsf@gnu.org>
2017-06-05 19:36 ` Drew Adams
2017-06-10 8:41 ` Eli Zaretskii
[not found] <<<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>
[not found] ` <<<<<83wp8ra9g6.fsf@gnu.org>
[not found] ` <<<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>
[not found] ` <<<<83tw3v9njh.fsf@gnu.org>
[not found] ` <<<c2f33d90-673d-4f13-894f-a26a52cf1a0d@default>
[not found] ` <<<83lgp6a257.fsf@gnu.org>
[not found] ` <<139eede5-534a-47ad-805a-bad9995526eb@default>
[not found] ` <<83d1ai9yy1.fsf@gnu.org>
2017-06-05 16:40 ` Drew Adams
2017-06-05 17:11 ` Eli Zaretskii
[not found] <<<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>
[not found] ` <<<<83wp8ra9g6.fsf@gnu.org>
[not found] ` <<<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>
[not found] ` <<<83tw3v9njh.fsf@gnu.org>
[not found] ` <<c2f33d90-673d-4f13-894f-a26a52cf1a0d@default>
[not found] ` <<83lgp6a257.fsf@gnu.org>
2017-06-05 15:55 ` Drew Adams
2017-06-05 16:33 ` Eli Zaretskii
[not found] <<<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>
[not found] ` <<<83wp8ra9g6.fsf@gnu.org>
[not found] ` <<26a213b3-908e-43b1-a009-b8a18f0a1c23@default>
[not found] ` <<83tw3v9njh.fsf@gnu.org>
2017-06-05 5:44 ` Drew Adams
2017-06-05 15:24 ` Eli Zaretskii
[not found] <<06a7cc83-a2a8-45a0-97d4-bd3a478aab92@default>
[not found] ` <<83wp8ra9g6.fsf@gnu.org>
2017-06-04 19:38 ` Drew Adams
2017-06-05 2:27 ` Eli Zaretskii
2017-06-04 17:42 Drew Adams
2017-06-04 18:34 ` Eli Zaretskii
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=a67cb3cf-a77f-4161-babd-eb475e16da95@default \
--to=drew.adams@oracle.com \
--cc=27238@debbugs.gnu.org \
--cc=eliz@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).