[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vcomplete 24c4552d2f 54/91: Use a user option to control w
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vcomplete 24c4552d2f 54/91: Use a user option to control which commands cause auto updates |
Date: |
Tue, 24 May 2022 15:59:09 -0400 (EDT) |
branch: elpa/vcomplete
commit 24c4552d2f4df8a407a53aceffd6684b760de184
Author: Daniel Semyonov <daniel@dsemy.com>
Commit: Daniel Semyonov <daniel@dsemy.com>
Use a user option to control which commands cause auto updates
* vcomplete.el (vcomplete-no-update-commands): New user option.
(vcomplete--move-n-completions, vcomplete-choose-completion): Don't
set 'this-command' to 'vcomplete-noop'.
(vcomplete--update-in-minibuffer, vcomplete--update-in-region):
Compare 'this-command' to each element of 'vcomplete-no-update-commands'.
---
vcomplete.el | 20 +++++++++++++++-----
vcomplete.texi | 9 ++++++---
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/vcomplete.el b/vcomplete.el
index 4277f08b65..59ea5df700 100644
--- a/vcomplete.el
+++ b/vcomplete.el
@@ -87,6 +87,19 @@ Otherwise, operate according to `completion-auto-help'."
:risky t
:package-version '(vcomplete . 0.1))
+(defcustom vcomplete-no-update-commands
+ '(vcomplete-next-completion
+ vcomplete-prev-completion
+ vcomplete-choose-completion
+ minibuffer-complete-and-exit
+ minibuffer-force-complete-and-exit
+ completion-at-point)
+ "List of commands which shouldn't cause the `*Completions*' buffer to
update."
+ :link '(info-link "(Vcomplete)Completion commands")
+ :type '(hook :tag "Commands")
+ :risky t
+ :package-version '(vcomplete . 1.1))
+
;;;; Completion commands:
(defmacro vcomplete-with-completions-buffer (&rest body)
@@ -144,7 +157,6 @@ If no completion is found, return nil."
(defun vcomplete--move-n-completions (n)
"Move N completions in the `*Completions*' buffer."
- (setq this-command 'vcomplete-noop)
(vcomplete-with-completions-buffer
(next-completion n)
(set-window-point window (point))
@@ -165,7 +177,6 @@ With prefix argument N, move N items (negative N means move
forward)."
(defun vcomplete-choose-completion ()
"Choose the completion at point in the `*Completions*' buffer."
(interactive)
- (setq this-command 'vcomplete-noop)
(when-let ((buf (get-buffer "*Completions*")))
(switch-to-completions)
(choose-completion)))
@@ -184,15 +195,14 @@ With prefix argument N, move N items (negative N means
move forward)."
"Update the completion list when completing in a minibuffer."
(while-no-input
(redisplay)
- (unless (eq this-command 'vcomplete-noop)
+ (unless (memq this-command vcomplete-no-update-commands)
(minibuffer-completion-help))))
(defun vcomplete--update-in-region (&rest _args)
"Update the completion list when completing in-region."
(while-no-input
(redisplay)
- (unless (or (eq this-command 'vcomplete-noop)
- (eq this-command 'completion-at-point))
+ (unless (memq this-command vcomplete-no-update-commands)
(completion-help-at-point))))
;; This function is required (in the local `post-command-hook') since
diff --git a/vcomplete.texi b/vcomplete.texi
index b21124040b..7b7c8bc1a0 100644
--- a/vcomplete.texi
+++ b/vcomplete.texi
@@ -206,9 +206,12 @@ package. Consider disabling them or this option on slow
computers.
Completion commands are used to perform actions while completing. They
are normal commands (interactive functions) which are bound to a key
-sequence in @code{vcomplete-command-map}. Completion commands which
-shouldn't cause the @code{*Completions*} buffer to update should set
-@code{this-command} to @code{vcomplete-noop}.
+sequence in @code{vcomplete-command-map}.
+
+@defopt vcomplete-no-update-commands
+List of commands which shouldn't cause the @code{*Completions*} buffer
+to update.
+@end defopt
@defvar vcomplete-command-map
Key map which holds key bindings to completion commands. This key map
- [nongnu] elpa/vcomplete 31b7cfbb45 70/91: ; Small change to 'vcomplete-mode's docstring, (continued)
- [nongnu] elpa/vcomplete 31b7cfbb45 70/91: ; Small change to 'vcomplete-mode's docstring, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 5a7d90596b 72/91: ; Move local mode declaration to the top of NEWS, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 9df472e302 85/91: ; Indicate the mailing list is the "maintainer" of the package, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 8ca95b2c81 80/91: Rename `vcomplete--update-in-minibuffer', ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete cd8411949c 77/91: ; Update package URL to https://dsemy.com/projects/vcomplete, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete ed98c1b50d 90/91: ; Change to NEWS, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 84c888747e 81/91: Reset the '*Completions*' buffer when 'vcomplete-mode' is disabled, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete a5763edf35 83/91: ; Bump to version 1.2, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 2a5c215033 86/91: ; Prepare for NonGNU ELPA inclusion, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 07f3483c0c 09/91: Improve usability of 'vcomplete-kill-buffer', ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 24c4552d2f 54/91: Use a user option to control which commands cause auto updates,
ELPA Syncer <=
- [nongnu] elpa/vcomplete cfb7099ab3 64/91: Unify search range user variables, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete db35265ff2 74/91: ; Load 'subr-x' when byte-compiling, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 695b22e213 79/91: ; Indentation fix and docstring change, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete e139895b51 66/91: Fix reference to void variable, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 40ac892aa6 67/91: ; Consistently mark lisp variables and functions in NEWS, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 3fe8f92f16 75/91: ; Remove unnecessary '; ' from lexical binding declaration, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete c66599c7a4 84/91: ; Update copyright years, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 1106acfc5b 02/91: ; Fix various erroneous references to swsw, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete e59690bd71 58/91: * vcomplete.el (vcomplete-no-update-commands): Add 'choose-completion', ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete b4f5326ad8 57/91: ; Fix required Emacs version vcomplete-pkg.el, ELPA Syncer, 2022/05/24