I would like to write a function that starts a search (evil-search-forward
specifically), with some arbitrary text already in the minibuffer.
Following directions in this link I came up with the following:
(defun my/insert-headline-string ()
(insert "foobar"))
(minibuffer-with-setup-hook
(:append 'my/insert-headline-string)
(call-interactively #'evil-search-forward))
But it doesn't work for me: evil-search-forward
runs just fine, but there is no text in the mini-buffer. If I use a different function (eg find-file
) it prefills mini-buffer as expected, like so:
(minibuffer-with-setup-hook
(:append 'my/insert-headline-string)
(call-interactively #'find-file))
Is there a reason this won't work for the search minibuffer?