[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5a451a9 26/57: ivy.el (ivy-read): Add a re-builder argumen
From: |
Oleh Krehel |
Subject: |
[elpa] master 5a451a9 26/57: ivy.el (ivy-read): Add a re-builder argument |
Date: |
Tue, 19 May 2015 14:21:30 +0000 |
branch: master
commit 5a451a9b8120863baed47d5116096dec36534388
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-read): Add a re-builder argument
* ivy.el (ivy-state): Add a RE-BUILDER field.
(ivy-resume): Use RE-BUILDER field.
(ivy-read): Set `ivy--regex-function' to RE-BUILDER if it's given.
---
ivy.el | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index b9ef1a3..739ebc3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -136,7 +136,8 @@ Only \"./\" and \"../\" apply here. They appear in reverse
order."
;; The window in which `ivy-read' was called
window
action
- unwind)
+ unwind
+ re-builder)
(defvar ivy-last nil
"The last parameters passed to `ivy-read'.")
@@ -338,7 +339,8 @@ candidate."
:update-fn (ivy-state-update-fn ivy-last)
:sort (ivy-state-sort ivy-last)
:action (ivy-state-action ivy-last)
- :unwind (ivy-state-unwind ivy-last)))
+ :unwind (ivy-state-unwind ivy-last)
+ :re-builder (ivy-state-re-builder ivy-last)))
(defun ivy-beginning-of-buffer ()
"Select the first completion candidate."
@@ -554,7 +556,7 @@ Directories come first."
(cl-defun ivy-read (prompt collection
&key predicate require-match initial-input
history preselect keymap update-fn sort
- action unwind)
+ action unwind re-builder)
"Read a string in the minibuffer, with completion.
PROMPT is a string to prompt with; normally it ends in a colon
@@ -577,7 +579,9 @@ When SORT is t, refer to `ivy-sort-functions-alist' for
sorting.
ACTION is a lambda to call after a result was selected.
-UNWIND is a lambda to call before exiting."
+UNWIND is a lambda to call before exiting.
+
+RE-BUILDER is a lambda that transforms text into a regex."
(setq ivy-last
(make-ivy-state
:prompt prompt
@@ -592,10 +596,12 @@ UNWIND is a lambda to call before exiting."
:sort sort
:action action
:window (selected-window)
- :unwind unwind))
+ :unwind unwind
+ :re-builder re-builder))
(setq ivy--directory nil)
(setq ivy--regex-function
- (or (and (functionp collection)
+ (or re-builder
+ (and (functionp collection)
(cdr (assoc collection ivy-re-builders-alist)))
(cdr (assoc t ivy-re-builders-alist))
'ivy--regex))
- [elpa] master dc219b3 12/57: Add counsel-load-library, (continued)
- [elpa] master dc219b3 12/57: Add counsel-load-library, Oleh Krehel, 2015/05/19
- [elpa] master 8b08cc0 08/57: ivy.el (ivy-done): Simplify and improve, Oleh Krehel, 2015/05/19
- [elpa] master cd083cc 18/57: Add swiper -> avy finalizer, Oleh Krehel, 2015/05/19
- [elpa] master f2a0966 16/57: Add ivy-partial: partial complete without exiting, Oleh Krehel, 2015/05/19
- [elpa] master 386184b 14/57: Merge ivy--update-fn into ivy-last, Oleh Krehel, 2015/05/19
- [elpa] master c5fce64 05/57: Make "TAB" switch directories properly, Oleh Krehel, 2015/05/19
- [elpa] master 6784185 17/57: Allow to use "^" in swiper, Oleh Krehel, 2015/05/19
- [elpa] master fb3fce9 13/57: Add parents using 'display for `counsel-load-library', Oleh Krehel, 2015/05/19
- [elpa] master 5601653 06/57: Require dired when completing file names, Oleh Krehel, 2015/05/19
- [elpa] master 4a7ba2f 15/57: Try to prevent the resize of minibuffer window, Oleh Krehel, 2015/05/19
- [elpa] master 5a451a9 26/57: ivy.el (ivy-read): Add a re-builder argument,
Oleh Krehel <=
- [elpa] master f7fc3ad 11/57: Work around grep-read-files, Oleh Krehel, 2015/05/19
- [elpa] master 056614d 22/57: Rename avy-swiper to swiper-avy, Oleh Krehel, 2015/05/19
- [elpa] master cf292da 23/57: Declare swiper-map, Oleh Krehel, 2015/05/19
- [elpa] master a953af0 19/57: Simplify ivy-partial-or-done, Oleh Krehel, 2015/05/19
- [elpa] master fe34d2c 10/57: ivy.el (ivy-partial-or-done): Handle empty input, Oleh Krehel, 2015/05/19
- [elpa] master 77abf00 25/57: ivy.el (ivy-backward-kill-word): Add and bind to "M-DEL", Oleh Krehel, 2015/05/19
- [elpa] master 8c936bc 21/57: ivy.el (ivy-use-virtual-buffers): New defcustom, Oleh Krehel, 2015/05/19
- [elpa] master 9b9885d 33/57: ivy.el (ivy-partial-or-done): Fixup, Oleh Krehel, 2015/05/19
- [elpa] master d841418 24/57: Fix the transition from a bad regex to good one, Oleh Krehel, 2015/05/19
- [elpa] master 2ad5fb1 20/57: Add support for virtual buffers, Oleh Krehel, 2015/05/19