]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge branch 'jit-loading', implementing #160.
authorJoão Távora <joaotavora@gmail.com>
Sun, 29 Apr 2012 11:48:22 +0000 (12:48 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 29 Apr 2012 11:48:22 +0000 (12:48 +0100)
1  2 
yasnippet.el

diff --cc yasnippet.el
index d8fe8b1d91e92dd0aeed8b9ba378f7984d78e813,677353ad9e97f0ba25a6a734b8e4462c14bbd8ba..23348a8e782a9cd7961fa6204f022392614f7300
@@@ -1689,11 -1702,20 +1702,23 @@@ Below TOP-LEVEL-DIR each directory is 
      ;; Reload the direct keybindings
      ;;
      (yas/direct-keymaps-reload)
 +    ;; Reload the trigger-key (shoudn't be needed, but see issue #237)
 +    ;; 
 +    (yas/trigger-key-reload)
      (yas/message 3 "Reloaded everything...%s." (if errors " (some errors, check *Messages*)" ""))))
  
+ (defun yas/load-pending-jits ()
+   (when yas/minor-mode 
+     (dolist (mode (yas/modes-to-activate))
+       (let ((forms (gethash mode yas/scheduled-jit-loads)))
+         (dolist (form forms)
+           (yas/message  3 "Loading snippets for %s, just in time: %s!" mode form)
+           (eval form))
+         (remhash mode yas/scheduled-jit-loads)))))
+ ;; (when (<= emacs-major-version 22)
+ ;;   (add-hook 'after-change-major-mode-hook 'yas/load-pending-jits))
  (defun yas/quote-string (string)
    "Escape and quote STRING.
  foo\"bar\\! -> \"foo\\\"bar\\\\!\""