From c566c929c04c8e05ba7f37fb39ca7311159b9b26 Mon Sep 17 00:00:00 2001 From: Joao Tavora Date: Fri, 27 Jul 2012 14:54:06 +0100 Subject: [PATCH] bugfix: use `yas-global-mode-hook` instead of advising `yas-global-mode` --- yasnippet.el | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index d932f5b..05087a5 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -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