Assume NO-TEMPLATE is non-nil if `yas-new-snippet-default' is nil

This commit is contained in:
thisirs 2013-08-19 22:52:19 +02:00
parent 80bb95326b
commit 501857e767

View File

@ -196,7 +196,8 @@ as the default for storing the user's new snippets."
# type: command} # type: command}
# -- # --
$0" $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 :type 'string
:group 'yasnippet) :group 'yasnippet)
@ -2531,7 +2532,8 @@ NO-TEMPLATE is non-nil."
(set (make-local-variable 'yas--guessed-modes) (mapcar #'(lambda (d) (set (make-local-variable 'yas--guessed-modes) (mapcar #'(lambda (d)
(yas--table-mode (car d))) (yas--table-mode (car d)))
guessed-directories)) 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) (defun yas--compute-major-mode-and-parents (file)
"Given FILE, find the nearest snippet directory for a given mode. "Given FILE, find the nearest snippet directory for a given mode.