aboutsummaryrefslogtreecommitdiff
path: root/modules/mail-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-09 09:41:36 -0600
committerCraig Jennings <c@cjennings.net>2026-02-09 09:41:36 -0600
commitfb4763757ce854ab8b273b02731cb53bb5d7e113 (patch)
treeeee1793173565b9bf5145273352e981f23169f2b /modules/mail-config.el
parent569f9d77d6b887d7b134b946315e2afe167d765d (diff)
downloaddotemacs-fb4763757ce854ab8b273b02731cb53bb5d7e113.tar.gz
dotemacs-fb4763757ce854ab8b273b02731cb53bb5d7e113.zip
fix(font): prevent HarfBuzz SIGSEGV crash on emoji in mu4e headers
Emacs 30.2 + HarfBuzz 12.3.2 segfaults when arabic-shape-gstring is called on emoji characters during mu4e header rendering. Disable Arabic composition ranges, set inhibit-compacting-font-caches, and disable auto-composition in mu4e-headers-mode. Remove duplicate bidi settings from system-defaults.el (already in early-init.el).
Diffstat (limited to 'modules/mail-config.el')
-rw-r--r--modules/mail-config.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/mail-config.el b/modules/mail-config.el
index 28423f52..93989f97 100644
--- a/modules/mail-config.el
+++ b/modules/mail-config.el
@@ -16,10 +16,26 @@
;; - followed by , (comma) next to each file you want to save,
;; - then RET (vertico-exit), to save selected attachments.
;;
+;; Crash Fix:
+;; auto-composition-mode is disabled in mu4e-headers-mode to prevent a
+;; HarfBuzz SIGSEGV crash. Email subjects containing emoji trigger glyph
+;; shaping via arabic-shape-gstring → hb_shape_full, which segfaults.
+;; Disabling composition in headers is safe (no ligatures needed there).
+;;
;;; Code:
(require 'user-constants)
+;; -------------------- HarfBuzz Crash Fix: Disable Composition ---------------
+;; Disable auto-composition in mu4e headers to prevent SIGSEGV from HarfBuzz
+;; when shaping emoji characters in email subjects. See Commentary above.
+
+(defun cj/disable-auto-composition ()
+ "Disable `auto-composition-mode' in the current buffer."
+ (auto-composition-mode -1))
+
+(add-hook 'mu4e-headers-mode-hook #'cj/disable-auto-composition)
+
;; ------------------------------ Mark All Headers -----------------------------
;; convenience function to mark all headers for an action