all repos — nixfiles @ 6ee4be8ff88a796485eac5e448af18d3c0f2a796

System and user configuration, managed by nix and home-manager

emacs: defensively check for existing non-ts- mode hooks

Alan Pearce
commit

6ee4be8ff88a796485eac5e448af18d3c0f2a796

parent

c0adc4b8e20b2594a6bc655db7795d85a18c34cf

1 file changed, 15 insertions(+), 4 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -1014,10 +1014,21 @@ :defer t
: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