aboutsummaryrefslogtreecommitdiff
path: root/scripts
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
commit10c0d574889f177b669a4f4e55a51076da991e7c (patch)
treeae8c7d9b3db983c593f2aab8557605e7d74411df /scripts
parent2238b3a40473e8cf1e49915a24d56366b72aede5 (diff)
downloaddotemacs-10c0d574889f177b669a4f4e55a51076da991e7c.tar.gz
dotemacs-10c0d574889f177b669a4f4e55a51076da991e7c.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')
-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.