From: João Távora Date: Thu, 21 Jan 2016 22:29:10 +0000 (+0000) Subject: Update packages/yasnippet by subtree-merging from its external upstream X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/5817fe1ff1059fd505dc5e6d5171f545866bee91 Update packages/yasnippet by subtree-merging from its external upstream Again, packages/yasnippet/snippets is left untouched in GNU ELPA. The upstream version uses a submodule pointing to a snippets repo which lives at https://github.com/AndreaCrotti/yasnippet-snippets.git Conflicts: packages/yasnippet/snippets --- 5817fe1ff1059fd505dc5e6d5171f545866bee91 diff --cc packages/yasnippet/yasnippet-tests.el index 2d7a0bc84,29a61dcca..648e4f39b --- a/packages/yasnippet/yasnippet-tests.el +++ b/packages/yasnippet/yasnippet-tests.el @@@ -336,12 -335,9 +345,12 @@@ TODO: correct this bug! "brother from another mother") ;; no newline should be here! ))) +(defvar yas--barbaz) +(defvar yas--foobarbaz) + ;; See issue #497. To understand this test, follow the example of the ;; `yas-key-syntaxes' docstring. - ;; + ;; (ert-deftest complicated-yas-key-syntaxes () (with-temp-buffer (yas-saving-variables @@@ -488,13 -506,41 +519,42 @@@ emacs-lisp-mode lisp-interaction-mode)) (observed (yas--modes-to-activate))) - (should (null (cl-set-exclusive-or expected observed))) - (should (= (length expected) - (length observed)))))))) + (should (equal major-mode (car observed))) + (should (equal (sort expected #'string<) (sort observed #'string<)))))))) + + (ert-deftest extra-modes-parenthood () + "Test activation of parents of `yas--extra-modes'." + (yas-saving-variables + (yas-with-snippet-dirs '((".emacs.d/snippets" + ("c-mode" + (".yas-parents" . "cc-mode")) + ("yet-another-c-mode" + (".yas-parents" . "c-mode and-also-this-one lisp-interaction-mode")))) + (yas-reload-all) + (with-temp-buffer + (yas-activate-extra-mode 'c-mode) + (yas-activate-extra-mode 'yet-another-c-mode) + (yas-activate-extra-mode 'and-that-one) + (let* ((expected-first `(and-that-one + yet-another-c-mode + c-mode + ,major-mode)) + (expected-rest `(cc-mode + ;; prog-mode doesn't exist in emacs 24.3 + ,@(if (fboundp 'prog-mode) + '(prog-mode)) + emacs-lisp-mode + and-also-this-one + lisp-interaction-mode)) + (observed (yas--modes-to-activate))) + (should (equal expected-first + (cl-subseq observed 0 (length expected-first)))) + (should (equal (sort expected-rest #'string<) + (sort (cl-subseq observed (length expected-first)) #'string<)))))))) +(defalias 'yas--phony-c-mode 'c-mode) + (ert-deftest issue-492-and-494 () - (defalias 'yas--phony-c-mode 'c-mode) (define-derived-mode yas--test-mode yas--phony-c-mode "Just a test mode") (yas-with-snippet-dirs '((".emacs.d/snippets" ("yas--test-mode")))