GNU bug report logs -
#51577
27.2; Regression: reproducible hang with face functions
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Wed, 3 Nov 2021 02:45:02 UTC
Severity: normal
Tags: moreinfo, notabug, wontfix
Found in version 27.2
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 51577 <at> debbugs.gnu.org (full text, mbox):
> From: Drew Adams <drew.adams <at> 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.
This bug report was last modified 3 years and 256 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.