How to specify order of how snippets are shown in YASnippet's prompt menu?

166 Views Asked by At

When writing snippets for YASnippet, is it possible to specify how snippets should be displayed in the prompt menu ("Choose a snippet: ..")?

For the sake of user friendliness, I would like the prompt menu to look like the Emacs YASnippet menu.

-Øyvind

EDIT: I've found a solution to my problem. Simply redefine yas--prompt-for-template in Emacs config file this way:

(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)))
0

There are 0 best solutions below