我有一个包含模板文件的目录~/emacs/templates/matlab
。当按下键盘快捷键时,我想在当前缓冲区的点处插入给定的模板。这可以使用ido-insert-file
(参见Buffer menu to select a set of filenames in Emacs):
(defun test-ido-insert-file ()
(interactive)
(save-excursion
(let ((default-directory "~/emacs/templates/matlab" ))
(ido-insert-file))))
但是,在显示ido
完成缓冲区之前,我必须按两次 TAB 键。
首先,运行我的test-ido-insert-file
我得到以下内容:
然后按两次 TAB 键,我终于得到:
如何立即调出完成缓冲区,避免按两次 TAB 键?