Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`ivy-alt-done` wipes out buffer when called via M-x from nested minibuffer #924

dpathakj opened this issue Mar 20, 2017 · 2 comments


Copy link

@dpathakj dpathakj commented Mar 20, 2017

The suggestion in to enable recursive minibuffers (via (setq enable-recursive-minibuffers t) led me to think that commands like M-x should be usable from within the swiper minibuffer.

However, I saw something I didn't expect when I tried this.

  1. I engaged swiper (C-s), and navigated to a completion.
  2. From within that swiper minibuffer, I typed M-x (bound to counsel-M-x) to call ivy-alt-done (I'd forgotten the hotkey)
  3. The entire contents of the buffer that I was on before I started swiper (that is, the buffer I was searching in with swiper) were replaced with the text "ivy-alt-done".

Instead, what I wanted was for ivy-alt-done to be called in the swiper minibuffer I left.

This is reproducible with a minimal setup (emacs -Q, etc.).

This seems like exactly the sort of use case that recursive minibuffers would help with. I see that some commands play with enable-recursive-minibuffers but counsel-M-x isn't one of them. Is that an easy fix?

@abo-abo abo-abo closed this in 5f04a70 Mar 20, 2017
Copy link

@abo-abo abo-abo commented Mar 20, 2017

Thanks, please test.

Copy link

@dpathakj dpathakj commented Mar 21, 2017

Yep, works perfectly. Thanks for the quick fix!

abo-abo added a commit that referenced this issue Mar 27, 2017
Bring back the old behavior.

* ivy.el (ivy-recursive-restore): New defun.

(ivy-call): `undwind-protect' to fix #924. Call `ivy-recursive-restore'
for good measure.

Fixes #937
Re  #924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants