1

I have this code:

(minibuffer-with-setup-hook
    #'ivy--minibuffer-setup
  (read-from-minibuffer
   ;; ...
   ))

It works fine unless the code is called when already in the minibuffer. In that case ivy--minibuffer-setup isn't called. Is there a way to achieve what I want: while in minibuffer, call read-from-minibuffer and call some code after the recursive minibuffer is entered?

  • Sounds like a bug. – Stefan May 11 '15 at 16:01
  • Are you sure minibuffer-with-setup-hook isn't used when you start a recursive minibuffer? I think it is used for every minibuffer activation. Perhaps something on the hook raised an error? – Drew May 11 '15 at 17:22
2

Perhaps it is this part of the minibuffer-with-setup-hook macro code? It apparently removes the hook for recursive calls.

(lambda ()
  ;; Clear out this hook so it does not interfere
  ;; with any recursive minibuffer usage.
  (remove-hook 'minibuffer-setup-hook ,hook)
  (funcall ,fun))

Try doing without minibuffer-with-setup-hook and just doing the add-hook and remove-hook (at the end) yourself.

  • And don't forget to use unwind-protect! – Jordon Biondo May 11 '15 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.