bugfix: use yas-global-mode-hook instead of advising yas-global-mode

This commit is contained in:
Joao Tavora 2012-07-27 14:54:06 +01:00
parent 6e8b698e6e
commit c566c929c0

View File

@ -847,15 +847,10 @@ Do this unless `yas--dont-activate' is truish "
:group 'yasnippet
:require 'yasnippet)
(defadvice yas-global-mode (before yas--reload-with-jit (arg) activate)
(cond ((and arg
(numberp arg)
(> arg 1))
;; explicitly enabling
(yas-reload-all))
((not yas-global-mode)
;; toggling
(yas-reload-all))))
(defun yas--global-mode-reload-with-jit-maybe ()
(when yas-global-mode (yas-reload-all)))
(add-hook 'yas-global-mode-hook 'yas--global-mode-reload-with-jit-maybe)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Major mode stuff