all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "51577@debbugs.gnu.org" <51577@debbugs.gnu.org>
Subject: bug#51577: [External] : Re: bug#51577: 27.2; Regression: reproducible hang with face functions
Date: Wed, 3 Nov 2021 18:58:23 +0000	[thread overview]
Message-ID: <SJ0PR10MB54884EBB4ED94D9D90372836F38C9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <83tugtgo6z.fsf@gnu.org>

> > (defface alt-region '((t :background "gray70" :inherit region))
> >   "..." :group 'faces)
> >
> > ;; `selected-frame' here could be anything, so this is dicey.
> > ;; But that's not important for the bug.
> >  (defvar orig-region-atts (face-all-attributes 'region (selected-
> frame)))
> >
> > (defun foo (&optional arg)
> >   (interactive "P")
> >   (let* ((frame  (selected-frame))
> >          (alist  (if arg
> >                      (face-all-attributes 'alt-region frame)
> >                    orig-region-atts))
> >          (alist  (cons (cons :font 'unspecified) alist))
> >          (plist  ()))
> >     (message "BEFORE LOOP, ALIST: %S" alist)
> >     (while alist
> >       (push (caar alist) plist)
> >       (push (cdar alist) plist)
> >       (setq alist  (cdr alist)))
> >     (setq plist  (nreverse plist))
> >     (message "> LOOP. PLIST: %S" plist)
> >     (apply #'set-face-attribute 'region frame plist)))
> 
> You set the region face to inherit from itself, and you expect that to
> work without causing an infloop when Emacs tries to resolve some face
> attribute?

Yes.  I expected Emacs to act as it has in the past,
and ignore such an :inherit as a no-op.

> If FACE1 has some attribute 'unspecified', but inherits
> from FACE2, Emacs will try to go up the inheritance chain to see if
> some of the parent faces specifies that attribute.  If FACE1 inherits
> from itself, going up the inheritance chain will never end.

Only if the implementation doesn't recognize the
inheritance loop.

> IOW, it's a cockpit error.

You can look at it that way.  But I'd expect that
inheritance of a face from itself would be a no-op.
That makes :inherit more flexible/usable.

And that's exactly what the case was in Emacs 26.
The `region' face spec with `:inherit region' is
innocuous in Emacs 26.

Why should the code now chase its tail down an
infinite rabbit hole?  Is this really by design?
Was something gained by this code change?  Or is
this just accidental collateral damage?

Not rhetorical questions.  It seems like a design
change has been made, but with no announcement.
I see nothing in NEWS, when searching for "face"
or "inherit".





  reply	other threads:[~2021-11-03 18:58 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   ` Drew Adams [this message]
2021-11-03 19:43     ` bug#51577: [External] : " 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
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB54884EBB4ED94D9D90372836F38C9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=51577@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.