]> code.delx.au - gnu-emacs-elpa/commitdiff
Assume NO-TEMPLATE is non-nil if `yas-new-snippet-default' is nil
authorthisirs <thisirs@gmail.com>
Mon, 19 Aug 2013 20:52:19 +0000 (22:52 +0200)
committerthisirs <thisirs@gmail.com>
Tue, 20 Aug 2013 15:19:35 +0000 (17:19 +0200)
yasnippet.el

index 738a63f661e00cf39a9e306a1806c14fbf20c645..b279f1206b29febf7207a027828f847dc22e4a73 100644 (file)
@@ -196,7 +196,8 @@ as the default for storing the user's new snippets."
 # type: command}
 # --
 $0"
-  "Default snippet to use when creating a new snippet."
+  "Default snippet to use when creating a new snippet. If nil,
+don't use any snippet."
   :type 'string
   :group 'yasnippet)
 
@@ -2531,7 +2532,8 @@ NO-TEMPLATE is non-nil."
     (set (make-local-variable 'yas--guessed-modes) (mapcar #'(lambda (d)
                                                               (yas--table-mode (car d)))
                                                           guessed-directories))
-    (unless no-template (yas-expand-snippet yas-new-snippet-default))))
+    (if (and (not no-template) yas-new-snippet-default)
+        (yas-expand-snippet yas-new-snippet-default))))
 
 (defun yas--compute-major-mode-and-parents (file)
   "Given FILE, find the nearest snippet directory for a given mode.