[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel 5dbdc76eb2 74/82: Specify the completion categor
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel 5dbdc76eb2 74/82: Specify the completion category tempel |
Date: |
Sun, 9 Jan 2022 20:58:46 -0500 (EST) |
branch: externals/tempel
commit 5dbdc76eb22a7d34bfcd7e0e4ada9abb8dee2280
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Specify the completion category tempel
---
tempel.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tempel.el b/tempel.el
index d35de96042..f3b5cd7e65 100644
--- a/tempel.el
+++ b/tempel.el
@@ -415,6 +415,14 @@ PROMPT is the optional prompt/default value."
(tempel--save)
(or (completion-at-point) (user-error "%s: No completions" capf))))
+(defun tempel--completion-table (templates)
+ "Return a completion table for a list of TEMPLATES.
+The completion table specifies the category `tempel'."
+ (lambda (str pred action)
+ (if (eq action 'metadata)
+ '(metadata (category . tempel))
+ (complete-with-action action templates str pred))))
+
;;;###autoload
(defun tempel-expand (&optional interactive)
"Expand exactly matching template name at point.
@@ -429,7 +437,8 @@ If INTERACTIVE is nil the function acts like a capf."
(sym (intern-soft name))
(template (assq sym templates)))
(setq templates (list template))
- (list (car bounds) (cdr bounds) templates
+ (list (car bounds) (cdr bounds)
+ (tempel--completion-table templates)
:exclusive 'no
:exit-function (apply-partially #'tempel--exit templates nil)))))
@@ -444,7 +453,8 @@ If INTERACTIVE is nil the function acts like a capf."
(let* ((region (tempel--region))
(bounds (or (and (not region) (bounds-of-thing-at-point 'symbol))
(cons (point) (point)))))
- (list (car bounds) (cdr bounds) templates
+ (list (car bounds) (cdr bounds)
+ (tempel--completion-table templates)
:exclusive 'no
:company-kind (lambda (_) 'snippet)
:exit-function (apply-partially #'tempel--exit templates region)
- [elpa] externals/tempel aec4f10253 82/82: Addition to GNU ELPA, (continued)
- [elpa] externals/tempel aec4f10253 82/82: Addition to GNU ELPA, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel d4bd649645 59/82: Minor renaming, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 2cff879181 30/82: Do not call modification hooks from forms, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 1222c59b30 39/82: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 07d16fded7 67/82: Update fields when new field is inserted, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel f0df571f66 17/82: Respect derived modes, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel bf95b3f1c2 31/82: Add support for (q (FORM ...) var), ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 64f896d782 44/82: Fix jump to first field, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 9948c6889d 43/82: Add tempel-form-prefix and tempel-field-prefix, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel ad71c25632 32/82: Add syntax extension (p (FORM...) <NAME>), ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 5dbdc76eb2 74/82: Specify the completion category tempel,
ELPA Syncer <=
- [elpa] externals/tempel 65a3eb0458 76/82: Improve abbreviation expansion, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 57bbc5e681 78/82: README update, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel ac3df540a4 69/82: Remove underlines from faces, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 7cf25bd795 71/82: Simplify templates data structure at load time, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 69f7cb3212 06/82: Reimplement without Tempo for more flexibility, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel fbef94d77d 48/82: Minor cleanup, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 01e7430343 27/82: Add docstrings, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel a03c36c8dd 02/82: Improve behavior when templates are nested, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel db6847a7f9 56/82: Make temple-key a macro, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 0e618cd169 23/82: Do not sort overlays, ELPA Syncer, 2022/01/09