[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 460d6e3 355/399: ivy.el (ivy-read): Refactor
From: |
Oleh Krehel |
Subject: |
[elpa] master 460d6e3 355/399: ivy.el (ivy-read): Refactor |
Date: |
Sat, 20 Jul 2019 14:57:58 -0400 (EDT) |
branch: master
commit 460d6e3e90c0e62f59d1a34ef8bcba8cf42219cc
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-read): Refactor
---
ivy.el | 91 ++++++++++++++++++++++++++++++++----------------------------------
1 file changed, 44 insertions(+), 47 deletions(-)
diff --git a/ivy.el b/ivy.el
index e86b766..aca93b7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1968,7 +1968,6 @@ candidates is updated after each input by calling
COLLECTION.
CALLER is a symbol to uniquely identify the caller to `ivy-read'.
It is used, along with COLLECTION, to determine which
customizations apply to the current completion session."
- (setq action (ivy--compute-extra-actions action caller))
(setq caller (or caller this-command))
(setq ivy--extra-candidates (ivy--compute-extra-candidates caller))
(setq ivy-marked-candidates nil)
@@ -1994,7 +1993,7 @@ customizations apply to the current completion session."
(ivy-state-current ivy-last)))
update-fn)
:sort sort
- :action action
+ :action (ivy--compute-extra-actions action caller)
:multi-action multi-action
:frame (selected-frame)
:window (selected-window)
@@ -2008,51 +2007,49 @@ customizations apply to the current completion session."
:caller caller
:def def))
(ivy--reset-state ivy-last)
- (prog1
- (unwind-protect
- (minibuffer-with-setup-hook
- #'ivy--minibuffer-setup
- (let* ((hist (or history 'ivy-history))
- (minibuffer-completion-table collection)
- (minibuffer-completion-predicate predicate)
- (ivy-height height)
- (resize-mini-windows (unless (display-graphic-p)
- 'grow-only)))
- (if (and ivy-auto-select-single-candidate
- ivy--all-candidates
- (null (cdr ivy--all-candidates)))
- (progn
- (setf (ivy-state-current ivy-last)
- (car ivy--all-candidates))
- (setq ivy-exit 'done))
- (read-from-minibuffer
- prompt
- (ivy-state-initial-input ivy-last)
- (make-composed-keymap keymap ivy-minibuffer-map)
- nil
- hist))
- (when (eq ivy-exit 'done)
- (let ((item (if ivy--directory
- (ivy-state-current ivy-last)
- ivy-text)))
- (unless (equal item "")
- (set hist (cons (propertize item 'ivy-index ivy--index)
- (delete item
- (cdr (symbol-value hist))))))))
- (ivy-state-current ivy-last)))
- ;; Fixes a bug in ESS, #1660
- (put 'post-command-hook 'permanent-local nil)
- (remove-hook 'post-command-hook #'ivy--queue-exhibit)
- (let ((cleanup (ivy--display-function-prop :cleanup)))
- (when (functionp cleanup)
- (funcall cleanup)))
- (when (setq unwind (ivy-state-unwind ivy-last))
- (funcall unwind))
- (ivy--pulse-cleanup)
- (unless (eq ivy-exit 'done)
- (ivy-recursive-restore)))
- (ivy-call)
- (ivy--remove-props (ivy-state-current ivy-last) 'idx))))
+ (unwind-protect
+ (minibuffer-with-setup-hook
+ #'ivy--minibuffer-setup
+ (let* ((hist (or history 'ivy-history))
+ (minibuffer-completion-table collection)
+ (minibuffer-completion-predicate predicate)
+ (ivy-height height)
+ (resize-mini-windows (unless (display-graphic-p)
+ 'grow-only)))
+ (if (and ivy-auto-select-single-candidate
+ ivy--all-candidates
+ (null (cdr ivy--all-candidates)))
+ (progn
+ (setf (ivy-state-current ivy-last)
+ (car ivy--all-candidates))
+ (setq ivy-exit 'done))
+ (read-from-minibuffer
+ prompt
+ (ivy-state-initial-input ivy-last)
+ (make-composed-keymap keymap ivy-minibuffer-map)
+ nil
+ hist))
+ (when (eq ivy-exit 'done)
+ (let ((item (if ivy--directory
+ (ivy-state-current ivy-last)
+ ivy-text)))
+ (unless (equal item "")
+ (set hist (cons (propertize item 'ivy-index ivy--index)
+ (delete item
+ (cdr (symbol-value hist))))))))))
+ ;; Fixes a bug in ESS, #1660
+ (put 'post-command-hook 'permanent-local nil)
+ (remove-hook 'post-command-hook #'ivy--queue-exhibit)
+ (let ((cleanup (ivy--display-function-prop :cleanup)))
+ (when (functionp cleanup)
+ (funcall cleanup)))
+ (when (setq unwind (ivy-state-unwind ivy-last))
+ (funcall unwind))
+ (ivy--pulse-cleanup)
+ (unless (eq ivy-exit 'done)
+ (ivy-recursive-restore)))
+ (ivy-call)
+ (ivy--remove-props (ivy-state-current ivy-last) 'idx)))
(defun ivy--display-function-prop (prop)
"Return PROP associated with current `ivy--display-function'."
- [elpa] master 3b1a25b 331/399: ivy-test.el (counsel-find-file-with-dotfiles): Fix, (continued)
- [elpa] master 3b1a25b 331/399: ivy-test.el (counsel-find-file-with-dotfiles): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 8fc254f 341/399: counsel.el (counsel--setq-doconst): Fix compiler warning, Oleh Krehel, 2019/07/20
- [elpa] master 1c436f6 347/399: ivy.el (ivy-reverse-i-search): Don't call another ivy-reverse-i-search, Oleh Krehel, 2019/07/20
- [elpa] master 975c2af 348/399: ivy.el (ivy-reverse-i-search): Error when called from top-level, Oleh Krehel, 2019/07/20
- [elpa] master 888b417 350/399: ivy.el (ivy--recompute-index-inhibit): Add, Oleh Krehel, 2019/07/20
- [elpa] master 4c9c14a 356/399: ivy.el (ivy--minibuffer-cleanup): Rename from ivy--cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 4324211 354/399: ivy.el (ivy-read): Factor out transformer-fn, Oleh Krehel, 2019/07/20
- [elpa] master d52c176 351/399: ivy.el (ivy-switch-buffer-kill): Move from "C-c C-k" to "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 7925637 353/399: ivy.el (ivy--compute-extra-candidates): Extract, Oleh Krehel, 2019/07/20
- [elpa] master f6876a7 359/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 460d6e3 355/399: ivy.el (ivy-read): Refactor,
Oleh Krehel <=
- [elpa] master ebac0e9 352/399: ivy.el (ivy--compute-extra-actions): Extract, Oleh Krehel, 2019/07/20
- [elpa] master bae8e46 361/399: ivy.el (ivy--magic-file-doubleslash-directory): Cd remote "/" on "//", Oleh Krehel, 2019/07/20
- [elpa] master a87bdd2 358/399: ivy.el (ivy-read): Refactor, Oleh Krehel, 2019/07/20
- [elpa] master 5e1c468 357/399: ivy.el (ivy--cleanup): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 520fd83 360/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 2d22e05 363/399: doc/ivy.org: Add more info on TRAMP, Oleh Krehel, 2019/07/20
- [elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp, Oleh Krehel, 2019/07/20
- [elpa] master 4e9e310 368/399: ivy.el (ivy-read): Fix swiper-query-replace not working, Oleh Krehel, 2019/07/20
- [elpa] master a0b71a1 362/399: ivy.el (ivy--magic-tilde-directory): Cd remote "~" on "~", Oleh Krehel, 2019/07/20
- [elpa] master 3af75cf 364/399: swiper.el (swiper--positive-regexps): Extract, Oleh Krehel, 2019/07/20