Skip to content

Commit

Permalink
Regexp-quote strings of avy-goto-char* functions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tsdh committed May 7, 2015
1 parent 5677270 commit 1d184b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions avy-jump.el
Expand Up @@ -236,17 +236,17 @@ 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)
"Read two chars and jump to them in current window.
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
Expand Down

0 comments on commit 1d184b0

Please sign in to comment.