branch: externals/tempel
commit 1697f7c1b51e7be6084db1f73fdb91b6aaf89654
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Document cape-capf-trigger
---
CHANGELOG.org | 4 ++--
README.org | 19 ++++++++++++++-----
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index c19b92d904..9b2e628089 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -4,8 +4,8 @@
* Development
-- =tempel-trigger-prefix=: Remove feature. The goal is to replace this with a
- generic mechanism in the Cape package.
+- =tempel-trigger-prefix=: Remove feature. Use =cape-capf-trigger= from the
Cape
+ package instead.
* Version 1.7 (2025-10-13)
diff --git a/README.org b/README.org
index 5e650c44dd..e119d4b98f 100644
--- a/README.org
+++ b/README.org
@@ -71,12 +71,21 @@ contributions.
;; Setup completion at point
(defun tempel-setup-capf ()
;; 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. NOTE: We add `tempel-expand' *before* the
- ;; main programming mode Capf, such that it will be tried first.
+ ;; only triggers on exact matches. We add `tempel-expand' *before* the main
+ ;; programming mode Capf, such that it will be tried first.
(setq-local completion-at-point-functions
- (cons #'tempel-expand
- completion-at-point-functions)))
+ (cons #'tempel-expand completion-at-point-functions))
+
+ ;; Alternatively use `tempel-complete' if you want to see all matches.
+ ;; (setq-local completion-at-point-functions
+ ;; (cons #'tempel-complete completion-at-point-functions))
+
+ ;; Configure a trigger prefix character in order to prevent Tempel from
+ ;; triggering unexpectly.
+ ;; (setq-local completion-at-point-functions
+ ;; (cons (cape-capf-trigger #'tempel-complete ?/)
+ ;; completion-at-point-functions))
+ )
(add-hook 'conf-mode-hook 'tempel-setup-capf)
(add-hook 'prog-mode-hook 'tempel-setup-capf)