diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-27 16:37:16 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-27 16:37:16 -0500 |
| commit | f4136da838e21ff64434b5f63faea40a25c82cbc (patch) | |
| tree | 743ba076758e1e95795c83adc1d91ebdc87d506c | |
| parent | 2defeb3d928e7a3b0f22aecc81ad002b5db374a3 (diff) | |
| download | dotemacs-f4136da838e21ff64434b5f63faea40a25c82cbc.tar.gz dotemacs-f4136da838e21ff64434b5f63faea40a25c82cbc.zip | |
fix(mail): default cj/custom-keymap so the file byte-compiles standalone
cj/custom-keymap is defined in keybindings.el, which init.el loads
before mail-config.el. The use-package org-msg :preface block calls
keymap-set on it, and use-package wraps :preface in eval-and-compile.
So byte-compiling mail-config.el on its own tries to call keymap-set
when cj/custom-keymap is still void.
Wrapping a defvar with a make-sparse-keymap default in eval-and-compile
gives the symbol a value during compilation. At runtime keybindings.el
has already populated the real keymap, so defvar does nothing.
| -rw-r--r-- | modules/mail-config.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/mail-config.el b/modules/mail-config.el index 93989f97..0d9fe450 100644 --- a/modules/mail-config.el +++ b/modules/mail-config.el @@ -26,6 +26,14 @@ (require 'user-constants) +;; cj/custom-keymap's real binding is in keybindings.el, which init.el loads +;; first. The use-package org-msg :preface below wraps in eval-and-compile, so +;; standalone byte-compile evaluates `keymap-set` on it at compile time. This +;; shim defines cj/custom-keymap then; defvar is a no-op once the real keymap +;; is in place at load time. +(eval-and-compile + (defvar cj/custom-keymap (make-sparse-keymap))) + ;; -------------------- 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. |
