Suppose I have a function (foo) defined as (defun foo () (read-from-minibuffer "What? ")). I cannot change the definition, but I’d like to wrap it around a macro, or another function, so to avoid having to manually give any value.
Unfortunately the following solutions don’t work, as (exit-minibuffer) is only called after leaving the minibuffer, so I was wondering if you know of something.
(defmacro return-an-empty-string (&rest code) `(progn ,@code (exit-minibuffer))) (defun return-an-empty-string (function) (funcall function) (exit-minibuffer))
Thanks!
You can temporarily make
read-from-minibufferinto a do-nothing function: