From 6ee4be8ff88a796485eac5e448af18d3c0f2a796 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 29 Apr 2024 23:17:46 +0200 Subject: emacs: defensively check for existing non-ts- mode hooks --- user/emacs/init.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/user/emacs/init.el b/user/emacs/init.el index 21a8b9d6..08add74f 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -1014,10 +1014,21 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve :config (progn (setq treemacs-no-png-images t))) -(setq typescript-ts-mode-hook typescript-ts-mode - dockerfile-ts-mode-hook dockerfile-ts-mode - yaml-ts-mode-hook yaml-mode-hook - go-ts-mode-hook go-mode-hook) +(if (boundp 'typescript-mode-hook) + (setq typescript-ts-mode-hook typescript-mode-hook)) + +(if (boundp 'dockerfile-mode-hook) + (setq dockerfile-ts-mode-hook dockerfile-mode-hook)) + +(if (boundp 'yaml-mode-hook) + (setq yaml-ts-mode-hook yaml-mode-hook)) + +(if (boundp 'go-mode-hook) + (setq go-ts-mode-hook go-mode-hook)) + +(if (boundp 'nix-mode-hook) + (setq nix-ts-mode-hook nix-mode-hook)) + (use-package eglot :defer 3 :general (:states 'normal :keymaps 'eglot-mode-map -- cgit 1.4.1