From 473e1b52323bcd14332b4ce16c88e41b91c55d51 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 19 Oct 2024 17:02:27 +0200 Subject: emacs: Fix tempel CAPF hook --- .config/emacs/modules/mm-abbrev.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to '.config/emacs') diff --git a/.config/emacs/modules/mm-abbrev.el b/.config/emacs/modules/mm-abbrev.el index 0a34032..73ca761 100644 --- a/.config/emacs/modules/mm-abbrev.el +++ b/.config/emacs/modules/mm-abbrev.el @@ -78,14 +78,18 @@ function." :ensure t :demand t :pin gnu - :bind (:map tempel-map - ("TAB" . tempel-next) - ("S-TAB" . tempel-previous)) + :bind ( :map tempel-map + ("TAB" . tempel-next) + ("S-TAB" . tempel-previous)) :custom - (tempel-trigger-prefix ",") + (tempel-trigger-prefix "<") :init (setopt tempel-path (expand-file-name "templates" mm-config-directory)) - (add-hook 'completion-at-point-functions #'tempel-complete -10) + (dolist (mode '(conf-mode prog-mode text-mode)) + (add-hook (mm-mode-to-hook mode) + (defun mm-setup-tempel-capf () + (add-hook 'completion-at-point-functions + #'tempel-complete -10 :local)))) (add-to-list 'auto-mode-alist (cons tempel-path #'lisp-data-mode))) (provide 'mm-abbrev) -- cgit v1.2.3