]> code.delx.au - gnu-emacs-elpa/commitdiff
Regexp-quote strings of avy-goto-char* functions.
authorTassilo Horn <tsdh@gnu.org>
Thu, 7 May 2015 08:22:42 +0000 (10:22 +0200)
committerTassilo Horn <tsdh@gnu.org>
Thu, 7 May 2015 08:22:42 +0000 (10:22 +0200)
Before this commit, avy-goto-char with char ^ would inf-loop because the
resulting string "^" is treated as a regular expressions.  However, with
the avy-goto-char* function, the char should be treated literally.  For
example, in Clojure ^:foo is treated as metadata annotation and thus ^
is a likely jump target.

avy-jump.el

index 89a443ae11b6caac52bfd2cfea248506cbc13546..f5963638e11ff95315635eb9ae5d30dcfbb79be9 100644 (file)
@@ -236,7 +236,7 @@ The window scope is determined by `avy-all-windows'.
 When ARG is non-nil, flip the window scope."
   (interactive "P")
   (avy--generic-jump
-   (string (read-char "char: ")) arg))
+   (regexp-quote (string (read-char "char: "))) arg))
 
 ;;;###autoload
 (defun avy-goto-char-2 (&optional arg)
@@ -244,9 +244,9 @@ When ARG is non-nil, flip the window scope."
 When ARG is non-nil, flip the window scope."
   (interactive "P")
   (avy--generic-jump
-   (string
-    (read-char "char 1: ")
-    (read-char "char 2: "))
+   (regexp-quote (string
+                 (read-char "char 1: ")
+                 (read-char "char 2: ")))
    arg))
 
 ;;;###autoload