From 26c311ee8ab55e6f6b68269b97c7963d9b95d6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 22 Apr 2012 16:34:57 +0100 Subject: [PATCH] yas/load-directory: bugfix: `yas/define-parents` must be called earlier on. --- yasnippet.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index a9e545e..e50370d 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -181,6 +181,7 @@ as the default for storing the user's new snippets." (equal old new)) (yas/reload-all))))) (defun yas/snippet-dirs () + "Returns `yas/snippet-dirs' (which see) as a list." (if (listp yas/snippet-dirs) yas/snippet-dirs (list yas/snippet-dirs))) (defvaralias 'yas/root-directory 'yas/snippet-dirs) @@ -1621,6 +1622,7 @@ Below TOP-LEVEL-DIR each directory is a mode name." (concat dir "/dummy"))) (mode-sym (car major-mode-and-parents)) (parents (cdr major-mode-and-parents))) + (yas/define-parents mode-sym parents) (let ((form `(yas/load-directory-1 ,dir ',mode-sym ',parents))) @@ -1640,7 +1642,6 @@ Below TOP-LEVEL-DIR each directory is a mode name." (yas/load-directory-2 directory mode-sym parents)))) (defun yas/load-directory-2 (directory mode-sym parents) - (yas/define-parents mode-sym parents) ;; Load .yas-setup.el files wherever we find them ;; (yas/load-yas-setup-file (expand-file-name ".yas-setup" directory)) @@ -1736,10 +1737,6 @@ This works by stubbing a few functions, then calling (when (file-exists-p elfile) (insert ";;; .yas-setup.el support file if any:\n;;;\n") (insert-file-contents elfile)))) - (yas/define-parents - (mode parents) - (insert ";;; Parent definitions:\n;;;\n") - (insert (pp-to-string `(yas/define-parents ',mode ',parents)))) (yas/define-snippets (mode snippets) (insert ";;; Snippet definitions:\n;;;\n")