aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-19 06:09:12 -0400
committerCraig Jennings <c@cjennings.net>2026-06-19 06:09:12 -0400
commit7e1cce3a7791b97e8394b5c4b1236907af669199 (patch)
treed3f03e74bf07beaa027ac60b63d63fbe94427bf5 /scripts/theme-studio
parented8e4412c70edcb28efd31cdb845f1c0cdb87c9d (diff)
downloaddotemacs-7e1cce3a7791b97e8394b5c4b1236907af669199.tar.gz
dotemacs-7e1cce3a7791b97e8394b5c4b1236907af669199.zip
fix(theme-studio): catch any read error in the defface pass, not just EOF
The defface-only pass caught end-of-file to stop reading each file. Any other reader error propagated out, aborting the whole pass and dropping every face in every later file. It now catches any error and stops that one file instead.
Diffstat (limited to 'scripts/theme-studio')
-rw-r--r--scripts/theme-studio/capture-default-faces.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/theme-studio/capture-default-faces.py b/scripts/theme-studio/capture-default-faces.py
index acfd4984d..3de09941b 100644
--- a/scripts/theme-studio/capture-default-faces.py
+++ b/scripts/theme-studio/capture-default-faces.py
@@ -371,7 +371,11 @@ def main() -> None:
A defface form is self-contained, so registering a face this way avoids
loading the whole package (and its dependencies / side effects), which in
batch -Q is fragile: a missing dependency or mid-load error would silently
-drop every face in the file. Each form is evaluated independently."
+drop every face in the file. Each form is evaluated independently.
+
+Catch any error from `read', not just `end-of-file': a reader-level error
+(unrecognized syntax) otherwise propagates out and aborts the whole pass,
+dropping every face in every later file. Stop reading this file instead."
(when (file-readable-p file)
(with-temp-buffer
(insert-file-contents file)
@@ -381,7 +385,7 @@ drop every face in the file. Each form is evaluated independently."
(let ((form (read (current-buffer))))
(when (and (consp form) (eq (car form) 'defface))
(ignore-errors (eval form t)))))
- (end-of-file nil)))))
+ (error nil)))))
;; Pass 1: best-effort full load. Registers faces that are defined by a macro
;; or loop rather than a literal defface (e.g. rainbow-delimiters depth faces,
;; markdown header faces), which pass 2 cannot see. Failures are swallowed.