branch: externals/hotfuzz
commit 77fe5fbc460e00fb3f200abdac4814eca7a0ce04
Author: Axel Forsman <[email protected]>
Commit: Axel Forsman <[email protected]>
Do not escape 1st char in complemented char set
Fixes the following warning produced by the linter relint:
hotfuzz.el:100:48: Value from ‘regexp-quote’ cannot be spliced into
‘[...]’
In a complemented character set, which begins with `[^`, the first
character following the caret is never special. Trying to escape it
would therefore only erroneously exclude the escape characters from
matching.
---
hotfuzz.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hotfuzz.el b/hotfuzz.el
index 2e03c6785d..f7bbd0df42 100644
--- a/hotfuzz.el
+++ b/hotfuzz.el
@@ -96,7 +96,8 @@ and ND/PD respectively may alias."
(if (or (> (length string) hotfuzz--max-needle-len) (string= string ""))
candidates
(let ((re (concat "^" (mapconcat (lambda (char)
- (format "[^%1$s]*%1$s"
+ (format "[^%c]*%s"
+ char
(regexp-quote (char-to-string
char))))
string "")))
(case-fold-search completion-ignore-case))