mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
automatic snippet compilation
This commit is contained in:
parent
1e3fdfd318
commit
e1891a4fb5
12
yasnippet.el
12
yasnippet.el
@ -401,6 +401,11 @@ the trigger key itself."
|
|||||||
:type '(repeat function)
|
:type '(repeat function)
|
||||||
:group 'yasnippet)
|
:group 'yasnippet)
|
||||||
|
|
||||||
|
(defcustom yas/compile-on-load-dir t
|
||||||
|
"Defines if the snippets should be compiled when loading (if they are not already compiled)."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'yasnippet)
|
||||||
|
|
||||||
;; Only two faces, and one of them shouldn't even be used...
|
;; Only two faces, and one of them shouldn't even be used...
|
||||||
;;
|
;;
|
||||||
(defface yas/field-highlight-face
|
(defface yas/field-highlight-face
|
||||||
@ -1671,6 +1676,13 @@ Optional USE-JIT use jit-loading of snippets."
|
|||||||
(defun yas/load-directory-1 (directory mode-sym parents &optional no-compiled-snippets)
|
(defun yas/load-directory-1 (directory mode-sym parents &optional no-compiled-snippets)
|
||||||
"Recursively load snippet templates from DIRECTORY."
|
"Recursively load snippet templates from DIRECTORY."
|
||||||
(unless (file-exists-p (concat directory "/" ".yas-skip"))
|
(unless (file-exists-p (concat directory "/" ".yas-skip"))
|
||||||
|
(when (and (not no-compiled-snippets) yas/compile-on-load-dir
|
||||||
|
(not (or
|
||||||
|
(file-exists-p (expand-file-name ".yas-compiled-snippets.el" directory))
|
||||||
|
(file-exists-p (expand-file-name ".yas-compiled-snippets.elc" directory)))))
|
||||||
|
(yas/message 3 "Compiling snippets for %s!" directory)
|
||||||
|
(yas/compile-directory directory))
|
||||||
|
|
||||||
(if (and (not no-compiled-snippets)
|
(if (and (not no-compiled-snippets)
|
||||||
(load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas/verbosity 2)))
|
(load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas/verbosity 2)))
|
||||||
(yas/message 2 "Loading much faster .yas-compiled-snippets from %s" directory)
|
(yas/message 2 "Loading much faster .yas-compiled-snippets from %s" directory)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user