abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.27k stars 337 forks source link

[question] enable ivy-hydra after swiper start / run code after ivy renders #3016

Closed JJPandari closed 1 year ago

JJPandari commented 1 year ago

I have a simple function that: if region-active() then swiper(region-content) else swiper(). Now I want to enable ivy-hydra automatically if region is active.

If my thinking is correct, the key is how to run some code (hydra-ivy/body) after swiper/ivy renders.


research: Looking at the code of ivy-read, maybe this doesn't really have anything to do with ivy, I need to find a way to run code after read-from-minibuffer succeeds.

basil-conto commented 1 year ago

I need to find a way to run code after read-from-minibuffer succeeds.

After it succeeds (returns), or after it activates the minibuffer? For the latter, have you tried minibuffer-with-setup-hook?

JJPandari commented 1 year ago

minibuffer-with-setup-hook does the job! Thanks! (Actually I have used this in my config, just got lost when trying things for this question)