[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vcomplete 739fee1af0 21/91: Cleanup automatic update code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vcomplete 739fee1af0 21/91: Cleanup automatic update code |
Date: |
Tue, 24 May 2022 15:59:06 -0400 (EDT) |
branch: elpa/vcomplete
commit 739fee1af08df2f944d32184b479c68e62eace95
Author: Daniel Semyonov <cmstr@dsemy.com>
Commit: Daniel Semyonov <cmstr@dsemy.com>
Cleanup automatic update code
* vcomplete.el (vcomplete--last-string-in-minibuffer-1): Removed.
(vcomplete--set-last-string-in-minibuffer): Rename from
'vcomplete--last-string-in-region' and get the string using
'minibuffer-contents'.
(vcomplete--string-in-region): Rename from
'vcomplete--last-string-in-region' and get a substring with
properties (as opposed to without).
(vcomplete--set-last-string-in-region): Rename from
'vcomplete--last-string-in-region'.
(vcomplete--update-in-region, vcomplete--reset-vars,
vcomplete--update-current):
Update changed function names.
---
vcomplete.el | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/vcomplete.el b/vcomplete.el
index 829bdb22a0..ac18991e55 100644
--- a/vcomplete.el
+++ b/vcomplete.el
@@ -182,33 +182,26 @@ With prefix argument N, move N items (negative N means
move forward)."
(defvar vcomplete--last-string nil
"Last pending completion string.")
-(defun vcomplete--last-string-in-minibuffer-1 ()
- "Return the minibuffer substring after the prompt."
- (buffer-substring-no-properties (minibuffer-prompt-end)
- (point-max)))
-
-(defun vcomplete--last-string-in-minibuffer ()
+(defun vcomplete--set-last-string-in-minibuffer ()
"Set ‘vcomplete--last-string’ in a minibuffer."
- (setq vcomplete--last-string (vcomplete--last-string-in-minibuffer-1)))
+ (setq vcomplete--last-string (minibuffer-contents)))
-(defun vcomplete--last-string-in-region-1 ()
+(defun vcomplete--string-in-region ()
"Return a substring according to the markers in
‘completion-in-region--data’."
(when completion-in-region--data
- (buffer-substring-no-properties
- (car completion-in-region--data)
- (cadr completion-in-region--data))))
+ (buffer-substring (car completion-in-region--data)
+ (cadr completion-in-region--data))))
-(defun vcomplete--last-string-in-region ()
+(defun vcomplete--set-last-string-in-region ()
"Set ‘vcomplete--last-string’ in-region."
(setq vcomplete--last-string
- (vcomplete--last-string-in-region-1)))
+ (vcomplete--string-in-region)))
(defun vcomplete--update-in-minibuffer ()
"Update the completion list when completing in a minibuffer."
(while-no-input
(redisplay)
- (unless (string= (vcomplete--last-string-in-minibuffer-1)
- vcomplete--last-string)
+ (unless (string= (minibuffer-contents) vcomplete--last-string)
(minibuffer-completion-help))))
(defun vcomplete--update-in-region ()
@@ -216,7 +209,7 @@ With prefix argument N, move N items (negative N means move
forward)."
(while-no-input
(redisplay)
(if (get-buffer-window "*Completions*")
- (unless (string= (vcomplete--last-string-in-region-1)
+ (unless (string= (vcomplete--string-in-region)
vcomplete--last-string)
(completion-help-at-point))
(completion-in-region-mode -1))))
@@ -225,8 +218,8 @@ With prefix argument N, move N items (negative N means move
forward)."
"Reset variables used by Vcomplete to their default values."
(setq vcomplete--last-completion-overlay nil
vcomplete--last-string nil)
- (remove-hook 'pre-command-hook #'vcomplete--last-string-in-minibuffer t)
- (remove-hook 'pre-command-hook #'vcomplete--last-string-in-region t)
+ (remove-hook 'pre-command-hook #'vcomplete--set-last-string-in-minibuffer t)
+ (remove-hook 'pre-command-hook #'vcomplete--set-last-string-in-region t)
(remove-hook 'post-command-hook #'vcomplete--update-in-region t)
(remove-hook 'post-command-hook #'vcomplete--update-in-minibuffer t)
(remove-hook 'post-command-hook #'vcomplete--highlight-completion-at-point
t))
@@ -243,7 +236,7 @@ With prefix argument N, move N items (negative N means move
forward)."
(progn
(when (and vcomplete-auto-update minibuffer-completion-table)
(add-hook 'pre-command-hook
- #'vcomplete--last-string-in-minibuffer nil t)
+ #'vcomplete--set-last-string-in-minibuffer nil t)
(add-hook 'post-command-hook
#'vcomplete--update-in-minibuffer nil t))
(use-local-map (make-composed-keymap vcomplete-command-map
@@ -252,7 +245,7 @@ With prefix argument N, move N items (negative N means move
forward)."
minor-mode-overriding-map-alist)))
(when vcomplete-auto-update
(add-hook 'pre-command-hook
- #'vcomplete--last-string-in-region nil t)
+ #'vcomplete--set-last-string-in-region nil t)
(add-hook 'post-command-hook
#'vcomplete--update-in-region nil t))
(setcdr map vcomplete-command-map))))
- [nongnu] elpa/vcomplete db010f4f61 34/91: Mark variables as risky local variables, (continued)
- [nongnu] elpa/vcomplete db010f4f61 34/91: Mark variables as risky local variables, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 5fefec3e91 40/91: Fix broken highlighting in completion list buffers when completing in-region, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 6136a3ba16 42/91: ; Update NEWS file, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 8ade381c7c 44/91: Move Embark integration to a separate file, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete b8402112ba 60/91: ; Remove unnecessary declaration, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete b30cedbf26 65/91: ; Fix small style issue in info file, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 8450b1befd 91/91: ; Bump to version 1.2.1, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 4019e76a3d 78/91: New internal function for getting the '*Completions*' window, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 3ac64b6241 87/91: ; Fix info node hyperlink in the commentary of vcomplete.el, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 6dbdbf1a4b 82/91: ; Add build manifest, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 739fee1af0 21/91: Cleanup automatic update code,
ELPA Syncer <=
- [nongnu] elpa/vcomplete 56a95cc1df 24/91: ; Fix indentation, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 0170c083a3 26/91: Eliminate delay after Embark action from minibuffer when auto updates are on, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete b658642c23 12/91: * vcomplete.el (vcomplete-auto-help): Reset vars when setting, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete b53c3d8caa 35/91: ; Fix case in license part of vcomplete.el, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete b831752c4c 50/91: Refactor auto updating of the completion list buffer, ELPA Syncer, 2022/05/24
- [nongnu] elpa/vcomplete 336cfaad33 68/91: Remove unnecessary (while-no-input (redisplay) ...) block, ELPA Syncer, 2022/05/24
- [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