]> code.delx.au - gnu-emacs-elpa/commitdiff
If no 'key' or 'binding' directives fall back to filename as trigger key
authorJoao Tavora <joaotavora@gmail.com>
Tue, 20 Mar 2012 09:14:18 +0000 (09:14 +0000)
committerJoao Tavora <joaotavora@gmail.com>
Tue, 20 Mar 2012 09:14:18 +0000 (09:14 +0000)
yasnippet.el

index f237863d747c102983b2390ea4c9be5588586b9e..8de4a3941eb524d8e7ef01b1d4474879f90eaae9 100644 (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