aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorEli Zaretskii2025-10-27 15:54:10 +0200
committerEli Zaretskii2025-10-27 15:54:10 +0200
commit23d863357920d283b899fd3757ccfa387a95ffe6 (patch)
treee35ab4c448f9fc0488714c770551c3c512dea58d /test/src
parent42dab7e7855348abf2665acabddf737c3aec5de6 (diff)
downloademacs-23d863357920d283b899fd3757ccfa387a95ffe6.tar.gz
emacs-23d863357920d283b899fd3757ccfa387a95ffe6.zip
Avoid face inheritance cycles
* src/xfaces.c (face_inheritance_cycle): New function. (Finternal_set_lisp_face_attribute): Signal an error if the ':inherit' attribute of a face is modified in a way that will cause it to inherit from itself. (Bug#79672) * test/src/xfaces-tests.el (xfaces-test-circular-inheritance): New test. * etc/NEWS: Announce the incompatible change.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/xfaces-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/xfaces-tests.el b/test/src/xfaces-tests.el
index a4c4f148af7..6129018262c 100644
--- a/test/src/xfaces-tests.el
+++ b/test/src/xfaces-tests.el
@@ -52,6 +52,19 @@
52 (should (equal (color-values-from-color-spec "rgbi:0/0x0/0") nil)) 52 (should (equal (color-values-from-color-spec "rgbi:0/0x0/0") nil))
53 (should (equal (color-values-from-color-spec "rgbi:0/+0x1/0") nil))) 53 (should (equal (color-values-from-color-spec "rgbi:0/+0x1/0") nil)))
54 54
55(ert-deftest xfaces-test-circular-inheritance ()
56 "Test that bug#79672 remains solved."
57 (let ((buf (get-buffer-create "xfaces-test")))
58 (with-current-buffer buf
59 (font-lock-mode -1)
60 (set-face-attribute 'button nil :inherit 'link)
61 (should (equal
62 (should-error (set-face-attribute 'link nil :inherit 'button))
63 (list 'error
64 "Face inheritance results in inheritance cycle"
65 'button))))
66 (kill-buffer buf)))
67
55(provide 'xfaces-tests) 68(provide 'xfaces-tests)
56 69
57;;; xfaces-tests.el ends here 70;;; xfaces-tests.el ends here