YASnippet will setup a menu just after the Buffers Menu in the menubar. The snippets for all real modes are listed there under the menu. You can select a snippet from the menu to expand it. Since you select manually from the menu, you can expand any snippet. For example, you can expand a snippet defined for python-mode in a c-mode buffer by selecting it from the menu:

images/menubar.png
  • Condition system is ignored since you select to expand it explicitly.
  • There will be no muliple candidates since they are listed in the menu as different items.

This can be convenient sometimes. However, if you don't like the menubar of Emacs and never use it. You can tell YASnippet don't boring to build a menu by setting yas/use-menu to nil.

Another thing to note is that only real modes are listed under the menu. As you know, common snippets can be shared by making up a virtual parent mode. It's too bad if the menu is floored by those virtual modes. So YASnippet only show menus for those real modes. But the snippets fo the virtual modes can still be accessed through the parent submenu of some real mode.

YASnippet use a simple way to check whether a mode is real or virtual: (fboundp mode). For example, the symbol c-mode is bound to a function while cc-mode is not. But this is not enough, some modes aren't part of Emacs, and maybe when initializing YASnippet, those modes haven't been initialized. So YASnippet also maintain a list of known modes (yas/known-modes). You can add item to that list if you need.