summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2026-05-02 11:52:59 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2026-05-02 11:52:59 +0200
commit6364dc83937b46341226f0f57f2911cdba1ac50c (patch)
tree3d64697c51e28102c1eb955a6f8d8814e39c2aa3
parent2432d483a3ff63d3e80c8e8e23422f45cf87e971 (diff)
Require Compat 31externals/tempel
-rw-r--r--tempel.el21
1 files changed, 9 insertions, 12 deletions
diff --git a/tempel.el b/tempel.el
index 837e911..52bac35 100644
--- a/tempel.el
+++ b/tempel.el
@@ -6,7 +6,7 @@
;; Maintainer: Daniel Mendler <mail@daniel-mendler.de>
;; Created: 2022
;; Version: 1.12
-;; Package-Requires: ((emacs "29.1") (compat "30"))
+;; Package-Requires: ((emacs "29.1") (compat "31"))
;; URL: https://github.com/minad/tempel
;; Keywords: abbrev, languages, tools, text
@@ -866,17 +866,14 @@ If called interactively, select a template with `completing-read'."
(intern-soft
(completing-read
"Template: "
- ;; TODO: Use `completion-table-with-metadata' via Compat 31
- (lambda (str pred action)
- (if (eq action 'metadata)
- `(metadata
- (category . tempel)
- ,@(when tempel-insert-annotation
- `((annotation-function
- . ,(apply-partially
- #'tempel--annotate templates tempel-insert-annotation
- #(" " 1 2 (display (space :align-to (+ left 20)))))))))
- (complete-with-action action templates str pred)))
+ (completion-table-with-metadata
+ templates
+ `((category . tempel)
+ ,@(when tempel-insert-annotation
+ `((annotation-function
+ . ,(apply-partially
+ #'tempel--annotate templates tempel-insert-annotation
+ #(" " 1 2 (display (space :align-to (+ left 20))))))))))
nil t nil 'tempel--history))))
(or (and template-or-name (alist-get template-or-name templates))
(user-error "Template %s not found" template-or-name))))