unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 51577@debbugs.gnu.org
Subject: bug#51577: 27.2; Regression: reproducible hang with face functions
Date: Fri, 05 Nov 2021 09:19:05 +0200	[thread overview]
Message-ID: <83ilx7dq8m.fsf@gnu.org> (raw)
In-Reply-To: <87a6ijpm27.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu,  04 Nov 2021 23:56:16 +0100)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: drew.adams@oracle.com,  51577@debbugs.gnu.org
> Date: Thu, 04 Nov 2021 23:56:16 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Detecting loops in those cases would require recording face
> > specs/names we already saw in some list, and each time we get an
> > :inherit attribute, check if its value is already in the list.  Is
> > that worth our while, if the result will be a silent error message in
> > *Messages*?
> 
> Well, the result is that Emacs doesn't hang.  :-)  I'm not so worried
> about issuing any messages here.

I actually worried about the CPU cycles spent checking that end in
silence than about the silence itself.

> But I wonder -- could we do this (expensive) checking in defface (or
> rather custom-declare-face)?  That could be helpful -- evalling a
> circular face definition should signal an error.

Checking this at defface time could only solve some small subset of
the cases.  It wouldn't solve this one, for example, because the
original defface:

  (defface alt-region '((t :background "gray70" :inherit region))
    "..." :group 'faces)

is completely innocent.  It's only later, when the code does this:

    (apply #'set-face-attribute 'region frame plist)))

that it actually makes the 'region' face inherit from itself.

Similarly, inheritance loops can (and usually do) appear at run time,
because faces are added or their attributes modified or merged with
other faces.

So, bottom line, I don't think that detection at defface time will
help here.





  parent reply	other threads:[~2021-11-05  7:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  2:44 bug#51577: 27.2; Regression: reproducible hang with face functions Drew Adams
2021-11-03 17:10 ` Eli Zaretskii
2021-11-03 18:58   ` bug#51577: [External] : " Drew Adams
2021-11-03 19:43     ` Eli Zaretskii
2021-11-04 18:15       ` Lars Ingebrigtsen
2021-11-04 18:48         ` martin rudalics
2021-11-04 18:50           ` Lars Ingebrigtsen
2021-11-04 19:32           ` Eli Zaretskii
2021-11-04 19:01         ` Eli Zaretskii
2021-11-04 19:21           ` bug#51577: [External] : " Drew Adams
2021-11-04 22:56           ` Lars Ingebrigtsen
2021-11-05  2:41             ` bug#51577: [External] : " Drew Adams
2021-11-05  7:32               ` Eli Zaretskii
2021-11-05  7:19             ` Eli Zaretskii [this message]
2021-11-05 13:24               ` Lars Ingebrigtsen
2021-11-05 14:22                 ` Eli Zaretskii
2021-11-06  0:39                   ` Lars Ingebrigtsen

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=83ilx7dq8m.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=51577@debbugs.gnu.org \
    --cc=larsi@gnus.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).