[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vcomplete 5391b6e4e2 07/91: Auto update the completion lis
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vcomplete 5391b6e4e2 07/91: Auto update the completion list when completing in-region |
Date: |
Tue, 24 May 2022 15:59:05 -0400 (EDT) |
branch: elpa/vcomplete
commit 5391b6e4e283153633ecf97c351933a550cdb2bf
Author: Daniel Semyonov <cmstr@dsemy.com>
Commit: Daniel Semyonov <cmstr@dsemy.com>
Auto update the completion list when completing in-region
* vcomplete.el (vcomplete--update-in-minibuffer): Rename from
'vcomplete--update'.
(vcomplete--update--in-region): New function which updates the
completion list (when completing in-region).
(vcomplete--setup): Setup in-region updating when appropriate.
---
vcomplete.el | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/vcomplete.el b/vcomplete.el
index 274e6cf50a..da3be65b65 100644
--- a/vcomplete.el
+++ b/vcomplete.el
@@ -174,29 +174,41 @@ With prefix argument N, move N items (negative N means
move forward)."
map)
"Key map for ‘vcomplete-mode’ commands.")
-(defun vcomplete--update()
- "Update the ‘*Completions*’ buffer when completing in the minibuffer."
+;;;; Visual completion mode:
+
+(defun vcomplete--update-in-minibuffer ()
+ "Update the completion list when completing in a minibuffer."
(while-no-input
(redisplay)
(unless (eq this-command 'vcomplete--no-update)
(minibuffer-completion-help))))
+(defun vcomplete--update-in-region ()
+ "Update the completion list when completing in-region."
+ (while-no-input
+ (redisplay)
+ (unless (or (eq this-command 'vcomplete--no-update)
+ (eq this-command 'completion-at-point)
+ (null completion-in-region-mode))
+ (completion-help-at-point))))
+
(defun vcomplete--setup ()
"Setup ‘vcomplete-mode’."
(if (minibufferp)
(progn
(when (and vcomplete-auto-update minibuffer-completion-table)
(add-hook 'post-command-hook
- #'vcomplete--update nil t))
+ #'vcomplete--update-in-minibuffer nil t))
(use-local-map (make-composed-keymap vcomplete-command-map
(current-local-map))))
(if completion-in-region-mode
(when-let ((map (assq #'completion-in-region-mode
minor-mode-overriding-map-alist)))
+ (when vcomplete-auto-update
+ (add-hook 'post-command-hook
+ #'vcomplete--update-in-region))
(setcdr map vcomplete-command-map))
- (remove-hook 'post-command-hook #'vcomplete--update t))))
-
-;;;; Visual completion mode:
+ (remove-hook 'post-command-hook #'vcomplete--update-in-region t))))
;;;###autoload
(define-minor-mode vcomplete-mode
- [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 <=
- [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, 2022/05/24
- [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