branch: externals/capf-autosuggest
commit 56796e26ca634b9d68bf9e98f0f948fb139f4e81
Author: jakanakaevangeli <[email protected]>
Commit: jakanakaevangeli <[email protected]>
Minor loop optimization
---
history-capf.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/history-capf.el b/history-capf.el
index f86a299..9312ff0 100644
--- a/history-capf.el
+++ b/history-capf.el
@@ -83,13 +83,14 @@ Is only applicable if point is after the last prompt."
((eq action t)
(cl-loop
with only-one = capf-autosuggest-all-completions-only-one
+ with regexps = completion-regexp-list
for i below (ring-size ring)
for elem = (ring-ref ring i)
if (string-prefix-p input elem)
+ if (cl-loop for regex in regexps
+ always (string-match-p regex elem))
if (or (null predicate)
(funcall predicate elem))
- if (cl-loop for regex in completion-regexp-list
- always (string-match-p regex elem))
if only-one
return (list elem)
else collect elem))