I want to rename file in dired by replacing underscores with spaces. I hit R Down (dired-do-rename) and after typing M-% (query-replace) I got:

query-replace-read-to: Command attempted to use minibuffer while in minibuffer

Is it possible to makes replaces in minibufer?

Is Recursive Edit here?

UPDATE I recall % r dired-do-rename-regexp but I ask about replacing in minibufer. Please do not count this workaround.

1 Answer 1


Not sure exactly what you are trying to do. But if you want to use M-% in the active minibuffer then yes, you need to first set enable-recursive-minibuffers to non-nil. By default, the value of that variable is nil, which prevents you being prompted for another command when you are already being prompted for a different command.

But please explain what you are really trying to do. I'm guessing there is an easier and more straightforward way to do it, whatever it is.

  • enable-recursive-minibuffers is commented in my .emacs 4 years ago. Seems I found it complicated. Setting to t allow me to perform desired tasks. Thanks!
    – gavenkoa
    Commented Mar 31, 2016 at 21:49
  • 1
    You can also, instead of setting enable-recursive-minibuffers to t, let-bind it to t in your own command, which calls query-replace. That way, it affects only query-replacing.
    – Drew
    Commented Apr 5, 2016 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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