From 43232a10db98213a14a3254cab1470c5a127812c Mon Sep 17 00:00:00 2001 From: Joao Tavora Date: Tue, 20 Mar 2012 09:14:18 +0000 Subject: [PATCH] If no 'key' or 'binding' directives fall back to filename as trigger key --- yasnippet.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yasnippet.el b/yasnippet.el index f237863..8de4a39 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -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