Emacs 如何指定代码段在YASnippet';什么是提示菜单?

Emacs 如何指定代码段在YASnippet';什么是提示菜单?,emacs,yasnippet,Emacs,Yasnippet,为YASnippet编写代码段时,是否可以指定代码段在提示菜单中的显示方式(“选择代码段:…”) 为了用户友好,我希望提示符菜单看起来像Emacs YASnippet菜单 -Øyvind 编辑:我找到了解决问题的方法。只需在Emacs配置文件中重新定义yas--prompt for template,方法如下: (defun yas--prompt-for-template (templates &optional prompt) (when templates (cl-so

为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)))