mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 05:03:04 +00:00
yasnippet.el (yas-define-snippets): Remove costly no-op
This commit is contained in:
parent
5af84cdb94
commit
47b38b2133
12
yasnippet.el
12
yasnippet.el
@ -1827,14 +1827,6 @@ the current buffers contents."
|
|||||||
(if yas--creating-compiled-snippets
|
(if yas--creating-compiled-snippets
|
||||||
(let ((print-length nil))
|
(let ((print-length nil))
|
||||||
(insert ";;; Snippet definitions:\n;;;\n")
|
(insert ";;; Snippet definitions:\n;;;\n")
|
||||||
(dolist (snippet snippets)
|
|
||||||
;; Fill in missing elements with nil.
|
|
||||||
(setq snippet (append snippet (make-list (- 10 (length snippet)) nil)))
|
|
||||||
;; Move LOAD-FILE to SAVE-FILE because we will load from the
|
|
||||||
;; compiled file, not LOAD-FILE.
|
|
||||||
(let ((load-file (nth 6 snippet)))
|
|
||||||
(setcar (nthcdr 6 snippet) nil)
|
|
||||||
(setcar (nthcdr 9 snippet) load-file)))
|
|
||||||
(insert (pp-to-string
|
(insert (pp-to-string
|
||||||
`(yas-define-snippets ',mode ',snippets)))
|
`(yas-define-snippets ',mode ',snippets)))
|
||||||
(insert "\n\n"))
|
(insert "\n\n"))
|
||||||
@ -1942,7 +1934,8 @@ With prefix argument USE-JIT do jit-loading of snippets."
|
|||||||
(current-time-string)))))
|
(current-time-string)))))
|
||||||
;; Normal case.
|
;; Normal case.
|
||||||
(unless (file-exists-p (expand-file-name ".yas-skip" directory))
|
(unless (file-exists-p (expand-file-name ".yas-skip" directory))
|
||||||
(unless (and (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3))
|
(unless (and (load (expand-file-name ".yas-compiled-snippets" directory)
|
||||||
|
'noerror (<= yas-verbosity 3))
|
||||||
(progn (yas--message 4 "Loaded compiled snippets from %s" directory) t))
|
(progn (yas--message 4 "Loaded compiled snippets from %s" directory) t))
|
||||||
(yas--message 4 "Loading snippet files from %s" directory)
|
(yas--message 4 "Loading snippet files from %s" directory)
|
||||||
(yas--load-directory-2 directory mode-sym)))))
|
(yas--load-directory-2 directory mode-sym)))))
|
||||||
@ -4971,6 +4964,7 @@ When multiple expressions are found, only the last one counts."
|
|||||||
;; When not in an undo, check if we must commit the snippet
|
;; When not in an undo, check if we must commit the snippet
|
||||||
;; (user exited it).
|
;; (user exited it).
|
||||||
(yas--check-commit-snippet))))
|
(yas--check-commit-snippet))))
|
||||||
|
;; FIXME: Why?
|
||||||
((debug error) (signal (car err) (cdr err)))))
|
((debug error) (signal (car err) (cdr err)))))
|
||||||
|
|
||||||
;;; Fancy docs:
|
;;; Fancy docs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user