diff options
Diffstat (limited to '.emacs.d/lisp/yasnippet.el')
| -rw-r--r-- | .emacs.d/lisp/yasnippet.el | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el index 806f2bc..cbeebd1 100644 --- a/.emacs.d/lisp/yasnippet.el +++ b/.emacs.d/lisp/yasnippet.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; João Távora <joaotavora@gmail.com>, | 5 | ;; João Távora <joaotavora@gmail.com>, |
| 6 | ;; Noam Postavsky <npostavs@gmail.com> | 6 | ;; Noam Postavsky <npostavs@gmail.com> |
| 7 | ;; Maintainer: Noam Postavsky <npostavs@gmail.com> | 7 | ;; Maintainer: Noam Postavsky <npostavs@gmail.com> |
| 8 | ;; Version: 0.14.2 | 8 | ;; Version: 0.14.3 |
| 9 | ;; X-URL: http://github.com/joaotavora/yasnippet | 9 | ;; X-URL: http://github.com/joaotavora/yasnippet |
| 10 | ;; Keywords: convenience, emulation | 10 | ;; Keywords: convenience, emulation |
| 11 | ;; URL: http://github.com/joaotavora/yasnippet | 11 | ;; URL: http://github.com/joaotavora/yasnippet |
| @@ -1933,16 +1933,18 @@ With prefix argument USE-JIT do jit-loading of snippets." | |||
| 1933 | (let ((output-file (expand-file-name ".yas-compiled-snippets.el" | 1933 | (let ((output-file (expand-file-name ".yas-compiled-snippets.el" |
| 1934 | directory))) | 1934 | directory))) |
| 1935 | (with-temp-file output-file | 1935 | (with-temp-file output-file |
| 1936 | (insert (format ";;; Compiled snippets and support files for `%s'\n" | 1936 | (insert (format ";;; \"Compiled\" snippets and support files for `%S' -*- lexical-binding:t -*-\n" |
| 1937 | mode-sym)) | 1937 | mode-sym)) |
| 1938 | (yas--load-directory-2 directory mode-sym) | 1938 | (yas--load-directory-2 directory mode-sym) |
| 1939 | (insert (format ";;; Do not edit! File generated at %s\n" | 1939 | (insert (format ";;; Do not edit! File generated at %s\n" |
| 1940 | (current-time-string))))) | 1940 | (current-time-string))))) |
| 1941 | ;; Normal case. | 1941 | ;; Normal case. |
| 1942 | (unless (file-exists-p (expand-file-name ".yas-skip" directory)) | 1942 | (unless (file-exists-p (expand-file-name ".yas-skip" directory)) |
| 1943 | (unless (and (load (expand-file-name ".yas-compiled-snippets" directory) | 1943 | (if (let ((warning-inhibit-types |
| 1944 | 'noerror (<= yas-verbosity 3)) | 1944 | '((files missing-lexbind-cookie)))) |
| 1945 | (progn (yas--message 4 "Loaded compiled snippets from %s" directory) t)) | 1945 | (load (expand-file-name ".yas-compiled-snippets" directory) |
| 1946 | 'noerror (<= yas-verbosity 3))) | ||
| 1947 | (yas--message 4 "Loaded compiled snippets from %s" directory) | ||
| 1946 | (yas--message 4 "Loading snippet files from %s" directory) | 1948 | (yas--message 4 "Loading snippet files from %s" directory) |
| 1947 | (yas--load-directory-2 directory mode-sym))))) | 1949 | (yas--load-directory-2 directory mode-sym))))) |
| 1948 | 1950 | ||
| @@ -3200,12 +3202,13 @@ ENV is a lisp expression that evaluates to list of elements with | |||
| 3200 | the form (VAR FORM), where VAR is a symbol and FORM is a lisp | 3202 | the form (VAR FORM), where VAR is a symbol and FORM is a lisp |
| 3201 | expression that evaluates to its value." | 3203 | expression that evaluates to its value." |
| 3202 | (declare (debug (form body)) (indent 1)) | 3204 | (declare (debug (form body)) (indent 1)) |
| 3203 | (let ((envvar (make-symbol "envvar"))) | 3205 | `(yas--letenv-f ,env (lambda () ,@body))) |
| 3204 | `(let ((,envvar ,env)) | 3206 | |
| 3205 | (cl-progv | 3207 | (defun yas--letenv-f (env body-fun) |
| 3206 | (mapcar #'car ,envvar) | 3208 | (cl-progv |
| 3207 | (mapcar (lambda (v-f) (eval (cadr v-f) t)) ,envvar) | 3209 | (mapcar #'car env) |
| 3208 | ,@body)))) | 3210 | (mapcar (lambda (v-f) (eval (cadr v-f) t)) env) |
| 3211 | (funcall body-fun))) | ||
| 3209 | 3212 | ||
| 3210 | (defun yas--snippet-map-markers (fun snippet) | 3213 | (defun yas--snippet-map-markers (fun snippet) |
| 3211 | "Apply FUN to all marker (sub)fields in SNIPPET. | 3214 | "Apply FUN to all marker (sub)fields in SNIPPET. |
