From: Oleh Krehel Date: Fri, 27 Nov 2015 13:03:41 +0000 (+0100) Subject: Enable recursive swiper calls X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/c546ae47503b3dfa76bebaa461ce6febe700f753 Enable recursive swiper calls * ivy.el (ivy-read): Don't need to be in the minibuffer to do a recursive store/restore. (ivy--reset-state): Avoid nil string while testing. Fixes #309 --- diff --git a/ivy.el b/ivy.el index ff7b2b213..e89fbd330 100644 --- a/ivy.el +++ b/ivy.el @@ -1056,7 +1056,7 @@ customizations apply to the current completion session." ("o" ,action "default") ,@extra-actions) (delete-dups (append action extra-actions)))))) - (let ((recursive-ivy-last (and (window-minibuffer-p) ivy-last))) + (let ((recursive-ivy-last ivy-last)) (setq ivy-last (make-ivy-state :prompt prompt @@ -1114,7 +1114,7 @@ customizations apply to the current completion session." (defun ivy--reset-state (state) "Reset the ivy to STATE. This is useful for recursive `ivy-read'." - (let ((prompt (ivy-state-prompt state)) + (let ((prompt (or (ivy-state-prompt state) "")) (collection (ivy-state-collection state)) (predicate (ivy-state-predicate state)) (history (ivy-state-history state))