Inserting Text into an Active Minibuffer

人走茶凉 提交于 2019-12-13 01:06:43

问题


I'm trying to insert text into the mini buffer after running an external command. E.G

(call-interactively 'eval-expression)
(insert "blah")

The problem of course is that eval-expression doesn't return before the user has entered input. My end goal is to add some default editable text into the mini buffer prompt of an arbitrary command (i.e a 'default string' or template). How can I go about accomplishing this?


回答1:


Use minibuffer-setup-hook:

(defun foo () (insert "ABCDE"))

(add-hook 'minibuffer-setup-hook 'foo)


来源:https://stackoverflow.com/questions/36118899/inserting-text-into-an-active-minibuffer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!