[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 70c5fe8 13/22: Bind "M-q" to `ivy-toggle-regexp-quote'
From: |
Oleh Krehel |
Subject: |
[elpa] master 70c5fe8 13/22: Bind "M-q" to `ivy-toggle-regexp-quote' |
Date: |
Wed, 22 Apr 2015 19:51:50 +0000 |
branch: master
commit 70c5fe84fda9bc6953e9014044cb3d315d825f39
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Bind "M-q" to `ivy-toggle-regexp-quote'
* ivy.el (ivy-minibuffer-map): Update.
(ivy--regexp-quote): New defvar.
(ivy-toggle-regexp-quote): New command, toggle `ivy--regex-function'
between the value selected in `ivy-read' and `ivy--regexp-quote'.
(ivy-read): Reset `ivy--regexp-quote' to 'regexp-quote.
Fixes #48
---
ivy.el | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ivy.el b/ivy.el
index be4dc8e..66b3f3a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -101,6 +101,7 @@ Only \"./\" and \"../\" apply here. They appear in reverse
order."
(define-key map (kbd "M-v") 'ivy-scroll-down-command)
(define-key map (kbd "C-M-n") 'ivy-next-line-and-call)
(define-key map (kbd "C-M-p") 'ivy-previous-line-and-call)
+ (define-key map (kbd "M-q") 'ivy-toggle-regexp-quote)
map)
"Keymap used in the minibuffer.")
@@ -350,6 +351,15 @@ On error (read-only), call `ivy-on-del-error-function'."
(when ivy-on-del-error-function
(funcall ivy-on-del-error-function))))))
+(defvar ivy--regexp-quote 'regexp-quote
+ "Store the regexp quoting state.")
+
+(defun ivy-toggle-regexp-quote ()
+ "Toggle the regexp quoting."
+ (interactive)
+ (setq ivy--old-re nil)
+ (cl-rotatef ivy--regex-function ivy--regexp-quote))
+
(defun ivy-sort-file-function-default (x y)
"Compare two files X and Y.
Prioritize directories."
@@ -434,6 +444,7 @@ When SORT is t, refer to `ivy-sort-functions-alist' for
sorting."
(cdr (assoc t ivy-re-builders-alist))
'ivy--regex))
(setq ivy--subexps 0)
+ (setq ivy--regexp-quote 'regexp-quote)
(let (coll sort-fn)
(cond ((eq collection 'Info-read-node-name-1)
(if (equal Info-current-file "dir")
- [elpa] master dea7858 01/22: counsel.el (counsel-git-grep-count): Ignore case, (continued)
- [elpa] master dea7858 01/22: counsel.el (counsel-git-grep-count): Ignore case, Oleh Krehel, 2015/04/22
- [elpa] master c6652b2 02/22: swiper.el (swiper--add-overlays): Make bounds optional, Oleh Krehel, 2015/04/22
- [elpa] master 769023b 03/22: ivy.el (ivy-read): Use initial-input when completing files, Oleh Krehel, 2015/04/22
- [elpa] master 12c25a0 04/22: ivy.el (ivy-read): Don't add the `default-directory', Oleh Krehel, 2015/04/22
- [elpa] master 37d371c 05/22: Add a way to exit ignoring the candidates, Oleh Krehel, 2015/04/22
- [elpa] master 4adc074 06/22: Fix the default-directory for `counsel-git-grep', Oleh Krehel, 2015/04/22
- [elpa] master dd559ad 07/22: ivy.el (ivy--filter): Try directory expansion with "/", Oleh Krehel, 2015/04/22
- [elpa] master 6da7819 09/22: ivy.el (ivy--filter): Update prefix optimization, Oleh Krehel, 2015/04/22
- [elpa] master 533b788 11/22: ivy.el (ivy-done): Be more strict for `require-match', Oleh Krehel, 2015/04/22
- [elpa] master fb805a0 08/22: README.md: Add a note on outdated ivy package, Oleh Krehel, 2015/04/22
- [elpa] master 70c5fe8 13/22: Bind "M-q" to `ivy-toggle-regexp-quote',
Oleh Krehel <=
- [elpa] master 7edfbc9 14/22: ivy.el (ivy--exhibit): Wrap in `while-no-input', Oleh Krehel, 2015/04/22
- [elpa] master 1fad831 10/22: Change `ivy-read' to a cl-defun, Oleh Krehel, 2015/04/22
- [elpa] master e78557a 15/22: swiper.el (swiper--ivy): Fix preselect being added, Oleh Krehel, 2015/04/22
- [elpa] master 28abaa9 12/22: Allow to customize the regex matching per-collection, Oleh Krehel, 2015/04/22
- [elpa] master dd4aced 16/22: ivy.el (ivy--add-face): Don't fail for weird str, Oleh Krehel, 2015/04/22
- [elpa] master 6d801a6 19/22: ivy-test.el (ivy-read): Update test., Oleh Krehel, 2015/04/22
- [elpa] master 5c03c2b 18/22: ivy.el (ivy-read): Fix preselect logic, Oleh Krehel, 2015/04/22
- [elpa] master f9947de 20/22: Fixup `swiper-query-replace', Oleh Krehel, 2015/04/22
- [elpa] master 632af83 17/22: ivy.el (ivy-done): Fixup, Oleh Krehel, 2015/04/22
- [elpa] master e2452a3 21/22: README.md: Update video link, Oleh Krehel, 2015/04/22