From 58bc417c55f7b5d2fa14a8e55b899fa1655ca9fc Mon Sep 17 00:00:00 2001 From: Mark Triggs Date: Sun, 15 May 2016 15:15:51 +1000 Subject: [PATCH] Escape regex metacharacters for standard isearch Doing an isearch for '[' and then invoking avy-isearch would trigger an error like: Invalid regexp: "Unmatched [ or [^" If we are not doing a regex-based search, escape the search string to avoid these kind of issues. --- avy.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/avy.el b/avy.el index 1e5ee1a..94e899c 100644 --- a/avy.el +++ b/avy.el @@ -982,7 +982,9 @@ The window scope is determined by `avy-all-windows' (ARG negates it)." (avy-with avy-isearch (let ((avy-background nil)) (avy--process - (avy--regex-candidates isearch-string) + (avy--regex-candidates (if isearch-regexp + isearch-string + (regexp-quote isearch-string))) (avy--style-fn avy-style)) (isearch-done))))