好.当我输入密钥系列的一些第一个密钥时,emacs会在一段时间后将这些密钥写入迷你缓冲区.像那样:打字C-x 4会C-x 4-在迷你缓冲区中显现出来.
问题是:这可以修改吗?我正在考虑制作类似于将键帮助(通过C-h键入某些键时生成)的一部分与此字符串组合在一起的内容.等待此消息的间隔也可以缩短吗?它是子程序吗?
编辑,新问题
当我退出带有C-x C-c修改缓冲区的emacs时会有一条消息,询问我是否要保存它们.我怎么知道这条消息在这里?我试着看(minibuffer-prompt) (minibuffer-contents) (buffer-substring (point-min) (point-max)),选择(select-window (minibuffer-window)).什么都没有给我结果.
是的,用户选项echo-keystrokes控制在迷你缓冲区中显示前缀键之前经过的时间.来自(emacs)Echo Area Customization:
User Option: echo-keystrokes
This variable determines how much time should elapse before command
characters echo. Its value must be an integer or floating point
number, which specifies the number of seconds to wait before
echoing. If the user types a prefix key (such as `C-x') and then
delays this many seconds before continuing, the prefix key is
echoed in the echo area. (Once echoing begins in a key sequence,
all subsequent characters in the same key sequence are echoed
immediately.)
If the value is zero, then command input is not echoed.
suggest-key-bindings您可以通过设置更大/更小的数字来控制此帮助消息的时间。
(setq suggest-key-bindings 5) ; wait 5 seconds
Run Code Online (Sandbox Code Playgroud)
没有简单的方法来自定义行为,您必须编辑 C 代码execute-extended-command,或者使用也提供帮助的替代品。替换的一种可能性是anything-complete具有替换的库execute-extended-command(注意:我还没有尝试过)。它构建在 package 之上anything,这是与标准 Emacs 不同的体验。