If no 'key' or 'binding' directives fall back to filename as trigger key

This commit is contained in:
Joao Tavora 2012-03-20 09:14:18 +00:00
parent 66e804dad0
commit 43232a10db

View File

@ -1396,6 +1396,8 @@ Here's a list of currently recognized directives:
(setq binding (match-string-no-properties 2)))))
(setq template
(buffer-substring-no-properties (point-min) (point-max))))
(unless (or key binding)
(setq key (and file (file-name-nondirectory file))))
(when (eq type 'command)
(setq template (yas/read-lisp (concat "(progn" template ")"))))
(when group