Skip to content

Commit

Permalink
fix(tempel): do not overwrite Capf
Browse files Browse the repository at this point in the history
This fixes the issue I was facing with `org-msg`, similar to this one:
jeremy-compostella/org-msg#166
  • Loading branch information
abougouffa committed Jun 6, 2023
1 parent 444f2c5 commit d7ba8b7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions modules/me-editor.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@
:config
;; Setup completion at point
(defun +tempel-setup-capf-h ()
;; Add the Tempel Capf to `completion-at-point-functions'.
;; `tempel-expand' only triggers on exact matches. Alternatively use
;; `tempel-complete' if you want to see all matches, but then you
;; should also configure `tempel-trigger-prefix', such that Tempel
;; does not trigger too often when you don't expect it. NOTE: We add
;; `tempel-expand' *before* the main programming mode Capf, such
;; that it will be tried first.
(setq-local
completion-at-point-functions
(if (derived-mode-p 'org-mode 'markdown-mode)
'(tempel-complete)
(cons #'tempel-complete completion-at-point-functions))))
;; Add the Tempel Capf to `completion-at-point-functions'. `tempel-expand'
;; only triggers on exact matches. Alternatively use `tempel-complete' if
;; you want to see all matches, but then you should also configure
;; `tempel-trigger-prefix', such that Tempel does not trigger too often when
;; you don't expect it.
(add-hook 'completion-at-point-functions #'tempel-complete nil t))
(global-tempel-abbrev-mode 1))

(use-package tempel-collection
Expand Down

0 comments on commit d7ba8b7

Please sign in to comment.