在为 YASnippet 编写代码片段时,是否可以指定代码片段应如何在提示菜单中显示(“选择代码片段:..”)?
为了用户友好,我希望提示菜单看起来像 Emacs YASnippet 菜单。
-Øyvind
编辑:我找到了解决问题的方法。只需用这种方式在 Emacs 配置文件中重新定义yas--prompt-for-template :
(defun yas--prompt-for-template (templates &optional prompt)
(when templates
(cl-some (lambda (fn)
(funcall fn (or prompt "Choose a snippet: ")
templates
#'yas--template-name))
yas-prompt-functions)))