Built-in templates not getting overridden by local templates when keys are identical, but names differ. #369

Open
edgimar opened this Issue Mar 11, 2013 · 1 comment

Projects

None yet

2 participants

@edgimar
edgimar commented Mar 11, 2013

I have my yas-snippet-dirs variable set at its default value of ("/.emacs.d/snippets" "/.emacs.d/scripts/yasnippet/snippets"), and have several snippets defined in ~/.emacs.d/snippets/latex-mode. In the ~/.emacs.d/scripts/yasnippet/snippets/latex-mode directory, there is a default-template for 'begin' available. I have another 'begin' template (same filename, same key-name, but different template-name than the ~/.emacs.d/scripts/yasnippet/snippets/latex-mode/begin file) in the ~/emacs.d/snippets/latex-mode directory.

When I open a latex file (using AUCTeX) and am in LaTeX-mode, if I type "begin", I get a menu-dropdown where I can choose from either of the two "begin" templates (the one distributed with yasnippet is listed first, then the locally-defined template).

I want to be able to override all "built-in" templates which have the same key as a locally-defined template, regardless of whether the names differ (I prefer to have the names identical to the keys, which is why they differ). In other words, I want to be able to type "begin" and have only the corresponding templates that are locally defined show up in the menu (or if only one is defined locally, that one will be automatically selected and expanded). The 'built-in' template(s) should be used only in the case that there are no locally-defined templates having the selected key.

Of course some users might prefer a different kind of behavior, so having a config option to affect this behavior would probably make the most sense.

@joaotavora
Owner

Yes, I think this makes sense.

I also sense there's another issue very closely related, #270, which deals with overriding between parent modes. These are two enhacements that would probably go hand in hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment