[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vcomplete a064184c7f 23/91: Add basic Embark support
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vcomplete a064184c7f 23/91: Add basic Embark support |
Date: |
Tue, 24 May 2022 15:59:06 -0400 (EDT) |
branch: elpa/vcomplete
commit a064184c7f3519807450c892441d1a1ce04044e3
Author: Daniel Semyonov <cmstr@dsemy.com>
Commit: Daniel Semyonov <cmstr@dsemy.com>
Add basic Embark support
* vcomplete.el (vcomplete-embark-current-completion): New function
which acts as an Embark "target-finder".
(vcomplete-embark-collect-candidates): New function which acts as an
Embark "candidate collector".
---
NEWS | 3 +++
vcomplete.el | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/NEWS b/NEWS
index ed30480912..5d6d77e16b 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ Vcomplete NEWS -- history of user-visible changes.
See the end of the file for an explanation of the versioning scheme.
* 1.0 (in development)
+
+** Add basic Embark support.
+
** Highlight the completion at point in the completion list buffer.
even when using normal navigation commands.
This only works when completing in the minibuffer currently (although
diff --git a/vcomplete.el b/vcomplete.el
index ac18991e55..5f148614af 100644
--- a/vcomplete.el
+++ b/vcomplete.el
@@ -273,6 +273,31 @@ completion:
(remove-hook 'minibuffer-exit-hook #'vcomplete--reset-vars)
(remove-hook 'completion-in-region-mode-hook #'vcomplete--setup-current)))
+;;;; Embark integration:
+
+(declare-function embark-target-completion-at-point "ext:embark")
+(declare-function embark-completions-buffer-candidates "ext:embark")
+
+(defun vcomplete-embark-current-completion (&optional relative)
+ "Call ‘embark-target-completion-at-point’ in the ‘*Completions*’ buffer."
+ (when (and vcomplete-mode
+ (or (minibufferp) completion-in-region-mode))
+ (vcomplete-with-completions-buffer
+ (embark-target-completion-at-point relative))))
+
+(defun vcomplete-embark-collect-candidates ()
+ "Call ‘embark-completions-buffer-candidates’ in the ‘*Completions*’ buffer."
+ (when (and vcomplete-mode
+ (or (minibufferp) completion-in-region-mode))
+ (vcomplete-with-completions-buffer
+ (embark-completions-buffer-candidates))))
+
+(with-eval-after-load 'embark
+ (add-hook 'embark-target-finders
+ #'vcomplete-embark-current-completion)
+ (add-hook 'embark-candidate-collectors
+ #'vcomplete-embark-collect-candidates))
+
(provide 'vcomplete)
;;; vcomplete.el ends here
- [nongnu] branch elpa/vcomplete created (now 8450b1befd), ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 5391b6e4e2 07/91: Auto update the completion list when completing in-region, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete cb8fbc39ef 10/91: Fix 'vcomplete--update-in-region' added to 'post-command-hook' globally, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 452cf29801 04/91: Optionally update the '*Completions*' buffer automatically, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete a064184c7f 23/91: Add basic Embark support,
ELPA Syncer <=
- [nongnu] elpa/vcomplete e320d50fb4 28/91: Make auto updating the completion list buffer more responsive, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 10d9ca2fe1 29/91: ; Small Makefile modifications, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 07da8d9c1b 15/91: Fix 'vcomplete-auto-update' triggering an error when set initially, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 3c5e8eba9c 06/91: ; Remove 'vcomplete--setup' from the correct hook variable, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 68b3a86741 14/91: ; Fix incorrect short description of Info node, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 2995fb124d 33/91: ; Add disclaimer regarding Embark integration, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 0f5505cd54 36/91: ; Add a link to the relevant part of the manual for 'vcomplete-auto-update', ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 668f16f903 43/91: ; Bump to version 1.0, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 3c00d732a2 51/91: Remove 'vcomplete--reset-vars', ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 62428759ac 47/91: ; Change required Emacs version according to package-lint, ELPA Syncer, 2022/05/24