将文本插入活动的Minibuffer [英] Inserting Text into an Active Minibuffer

查看:109
本文介绍了将文本插入活动的Minibuffer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在运行外部命令后将文本插入迷你缓冲区。 EG

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

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

当然问题是在用户输入输入之前,eval-expression不会返回。我的最终目标是将一些默认的可编辑文本添加到任意命令的迷你缓冲区提示中(即默认字符串或模板)。如何完成这个?

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?

推荐答案

使用 minibuffer-setup-hook

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

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

这篇关于将文本插入活动的Minibuffer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆