I’m looking for a way to simulate minibuffer input. So, some-func takes some input from the minibuffer and does something with it. The problem is that I have to call some-func from some other function calling-func and I need to do it interactively so I cant just pass an argument.
(defun some-func (arg)
(interactive "*sEnter something: ")
;; Do something with arg
)
(defun calling-func ()
(call-interactively 'some-func)
;; Type to minibuffer
)
Any ideas?
Thanks!
It might be interesting to explore why you need to call the other function interactively… but that’s not what you asked.
Here’s an example of “calling” a function interactively and sending text to the minibuffer. You just use Emacs keyboard macros:
The relevant documentation are Keyboard Macros and Functions for Vectors.