summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-11 05:53:55 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-08-11 05:53:55 +0200
commit9af2fa96039c9bccf7fc74858fd33789316fcdd0 (patch)
tree1571e46168ec21f314b551dbfc5ca8895f3a0aef
parentac97b21b4096c8abcbeb9ac9017281375a4f6510 (diff)
emacs: Assert if ts-mode exists before adding hook
-rw-r--r--.config/emacs/config.org4
1 files changed, 3 insertions, 1 deletions
diff --git a/.config/emacs/config.org b/.config/emacs/config.org
index 979d0a5..4972c0a 100644
--- a/.config/emacs/config.org
+++ b/.config/emacs/config.org
@@ -812,7 +812,9 @@ with a custom function that reads a list of mode-specific indentation settings.
evil-shift-width width)
(mm-for-each extra (setq x width)))))
(add-hook (mm-mode-to-hook mode) callback 95)
- (add-hook (mm-mode-to-hook (mm-mode-to-ts-mode mode)) callback 95))))
+ (let ((ts-mode (mm-mode-to-ts-mode mode)))
+ (when (boundp ts-mode)
+ (add-hook (mm-mode-to-hook ts-mode) callback 95))))))
(mm-set-indentation-settings)