unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 51577@debbugs.gnu.org
Subject: bug#51577: 27.2; Regression: reproducible hang with face functions
Date: Wed, 03 Nov 2021 19:10:28 +0200	[thread overview]
Message-ID: <83tugtgo6z.fsf@gnu.org> (raw)
In-Reply-To: <SJ0PR10MB5488D110BA9745A302EE8832F38C9@SJ0PR10MB5488.namprd10.prod.outlook.com> (message from Drew Adams on Wed, 3 Nov 2021 02:44:22 +0000)

> From: Drew Adams <drew.adams@oracle.com>
> Date: Wed, 3 Nov 2021 02:44:22 +0000
> 
> (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?  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.

IOW, it's a cockpit error.





  reply	other threads:[~2021-11-03 17:10 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 [this message]
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
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=83tugtgo6z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=51577@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).