[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2bc08de 07/12: Merge ivy--persistent-action into ivy-state
From: |
Oleh Krehel |
Subject: |
[elpa] master 2bc08de 07/12: Merge ivy--persistent-action into ivy-state-action |
Date: |
Sun, 03 May 2015 11:04:54 +0000 |
branch: master
commit 2bc08deab096172fd7a1c06f46d71a5bf7530fee
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Merge ivy--persistent-action into ivy-state-action
* counsel.el (counsel-git-grep): Update.
* ivy.el (ivy--persistent-action): Remove defvar.
(ivy-next-line-and-call): Update.
(ivy-previous-line-and-call): Update.
---
counsel.el | 25 ++++++++++++-------------
ivy.el | 13 ++++---------
2 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/counsel.el b/counsel.el
index daa05b9..7ee63fc 100644
--- a/counsel.el
+++ b/counsel.el
@@ -215,19 +215,18 @@
default-directory ".git"))
(counsel--git-grep-count (counsel-git-grep-count ""))
(ivy--dynamic-function (when (> counsel--git-grep-count 20000)
- 'counsel-git-grep-function))
- (ivy--persistent-action (lambda (x)
- (let ((lst (split-string x ":")))
- (find-file (expand-file-name (car
lst) counsel--git-grep-dir))
- (goto-char (point-min))
- (forward-line (1- (string-to-number
(cadr lst))))
- (setq swiper--window
(selected-window))
- (swiper--cleanup)
- (swiper--add-overlays (ivy--regex
ivy-text)))))
- (val (ivy-read "pattern: " 'counsel-git-grep-function
- :initial-input initial-input)))
- (when val
- (funcall ivy--persistent-action val)))
+ 'counsel-git-grep-function)))
+ (ivy-read "pattern: " 'counsel-git-grep-function
+ :initial-input initial-input
+ :action
+ (lambda ()
+ (let ((lst (split-string ivy--current ":")))
+ (find-file (expand-file-name (car lst)
counsel--git-grep-dir))
+ (goto-char (point-min))
+ (forward-line (1- (string-to-number (cadr lst))))
+ (setq swiper--window (selected-window))
+ (swiper--cleanup)
+ (swiper--add-overlays (ivy--regex ivy-text))))))
(swiper--cleanup)))
(defun counsel-locate-function (str &rest _u)
diff --git a/ivy.el b/ivy.el
index 49568d5..05509f8 100644
--- a/ivy.el
+++ b/ivy.el
@@ -157,9 +157,6 @@ of `history-length', which see.")
"Store 'done if the completion was successfully selected.
Otherwise, store nil.")
-(defvar ivy--persistent-action nil
- "Store a function to call for current candidate without exiting.")
-
(defvar ivy--all-candidates nil
"Store the candidates passed to `ivy-read'.")
@@ -378,18 +375,16 @@ If the input is empty, select the previous history
element instead."
(interactive "p")
(ivy-next-line arg)
(ivy--exhibit)
- (when ivy--persistent-action
- (with-selected-window (ivy-state-window ivy-last)
- (funcall ivy--persistent-action ivy--current))))
+ (with-selected-window (ivy-state-window ivy-last)
+ (funcall (ivy-state-action ivy-last))))
(defun ivy-previous-line-and-call (&optional arg)
"Move cursor vertically down ARG candidates."
(interactive "p")
(ivy-previous-line arg)
(ivy--exhibit)
- (when ivy--persistent-action
- (with-selected-window (ivy-state-window ivy-last)
- (funcall ivy--persistent-action ivy--current))))
+ (with-selected-window (ivy-state-window ivy-last)
+ (funcall (ivy-state-action ivy-last))))
(defun ivy-previous-history-element (arg)
"Forward to `previous-history-element' with ARG."
- [elpa] master updated (69bf1bd -> 34753b4), Oleh Krehel, 2015/05/03
- [elpa] master 0353b9f 01/12: Add ivy-state struct, Oleh Krehel, 2015/05/03
- [elpa] master 0210bb6 03/12: Merge ivy-def into ivy-last, Oleh Krehel, 2015/05/03
- [elpa] master d0b6e94 02/12: Allow to quote spaces while matching, Oleh Krehel, 2015/05/03
- [elpa] master 7f63f09 04/12: Merge ivy-window into ivy-last, Oleh Krehel, 2015/05/03
- [elpa] master 00d1c95 06/12: ivy-resume now works for functions that supply action, Oleh Krehel, 2015/05/03
- [elpa] master cdafe1b 05/12: Merge ivy--action into ivy-last, Oleh Krehel, 2015/05/03
- [elpa] master 2bc08de 07/12: Merge ivy--persistent-action into ivy-state-action,
Oleh Krehel <=
- [elpa] master 2e046d1 09/12: Fix the candidate index for `ivy-resume', Oleh Krehel, 2015/05/03
- [elpa] master 109fb7d 08/12: Add unwind argument to ivy-read, Oleh Krehel, 2015/05/03
- [elpa] master b5332c5 10/12: ivy.el (ivy-resume): Quote the preselect, Oleh Krehel, 2015/05/03
- [elpa] master 829bdb6 11/12: swiper.el: Bump version, Oleh Krehel, 2015/05/03
- [elpa] master 34753b4 12/12: Merge commit '829bdb6dcb08e2b1a8d8c329e697156e5fa2dbcc' from swiper, Oleh Krehel, 2015/05/03