]> code.delx.au - gnu-emacs-elpa/commitdiff
Apply changes from GNU ELPA
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 28 Jan 2016 19:30:15 +0000 (14:30 -0500)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Thu, 28 Jan 2016 19:36:19 +0000 (14:36 -0500)
* doc/yas-doc-helper.el:
* yasnippet-debug.el:
* yasnippet-tests.el: Fix up copyright headers.

* yasnippet-tests.el: Fix lexical-binding cookie.
* yasnippet-debug.el: Require cl.

* yasnippet-tests.el: Silence byte-compiler.
(yas-saving-variables, yas-with-snippet-dirs): Move macros before their use.
(yas--barbaz, yas--foobarbaz): Declare.
(yas--phony-c-mode, yas--test-mode, yas--another-test-mode): Move out of
deftest, so the byte-compiler understands they're defined.

doc/yas-doc-helper.el
yasnippet-debug.el
yasnippet-tests.el

index ab172b6d7210990dcdc3683664f7c94974ca6698..f4cd49bfdf98ea5381d65e8d181edd5c0770efe5 100755 (executable)
@@ -1,6 +1,6 @@
 ;;; yas-doc-helper.el --- Help generate documentation for YASnippet
 
-;; Copyright (C) 2012  João Távora
+;; Copyright (C) 2012, 2013  Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords: convenience
index c5dd06aeda79f0239216b73dafa7fcbdaad59ca6..b12bcd4ba2610db8add1a9f25cb5073a76f03874 100644 (file)
@@ -1,6 +1,6 @@
 ;;; yasnippet-debug.el --- debug functions for yasnippet
 
-;; Copyright (C) 2010  João Távora
+;; Copyright (C) 2010, 2013, 2014  Free Software Foundation, Inc.
 
 ;; Author: João Távora
 ;; Keywords: emulations, convenience
@@ -25,6 +25,7 @@
 ;;; Code:
 
 (require 'yasnippet)
+(require 'cl)
 
 (defun yas-debug-snippet-vars ()
   "Debug snippets, fields, mirrors and the `buffer-undo-list'."
index cf8ace986fe3a4b0a1b36dd1cb9f60e85aa43598..844cd943ba85b63fe40e8b86b31ee32d870f9868 100644 (file)
@@ -1,6 +1,6 @@
-;;; yasnippet-tests.el --- some yasnippet tests
+;;; yasnippet-tests.el --- some yasnippet tests  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012  João Távora
+;; Copyright (C) 2012, 2013, 2014, 2015  Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaot@siscog.pt>
 ;; Keywords: emulations, convenience
@@ -27,6 +27,7 @@
 (require 'yasnippet)
 (require 'ert)
 (require 'ert-x)
+(require 'cl)
 
 \f
 ;;; Snippet mechanics
              (and (buffer-name ,temp-buffer)
                   (kill-buffer ,temp-buffer))))))))
 
+(defmacro yas-saving-variables (&rest body)
+  `(yas-call-with-saving-variables #'(lambda () ,@body)))
+
+(defmacro yas-with-snippet-dirs (dirs &rest body)
+  (declare (indent defun))
+  `(yas-call-with-snippet-dirs ,dirs
+                               #'(lambda ()
+                                   ,@body)))
+
 (ert-deftest example-for-issue-474 ()
   (yas--with-font-locked-temp-buffer
     (c-mode)
@@ -365,6 +375,9 @@ 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.
 ;;
@@ -569,8 +582,9 @@ TODO: correct this bug!"
          (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")))
@@ -587,9 +601,10 @@ TODO: correct this bug!"
                              (should (= (length expected)
                                         (length observed)))))))
 
+(define-derived-mode yas--test-mode c-mode "Just a test mode")
+(define-derived-mode yas--another-test-mode c-mode "Another test mode")
+
 (ert-deftest issue-504-tricky-jit ()
-  (define-derived-mode yas--test-mode c-mode "Just a test mode")
-  (define-derived-mode yas--another-test-mode c-mode "Another test mode")
   (yas-with-snippet-dirs
    '((".emacs.d/snippets"
       ("yas--another-test-mode"
@@ -880,10 +895,6 @@ add the snippets associated with the given mode."
             for saved in saved-values
             do (set var saved)))))
 
-(defmacro yas-saving-variables (&rest body)
-  `(yas-call-with-saving-variables #'(lambda () ,@body)))
-
-
 (defun yas-call-with-snippet-dirs (dirs fn)
   (let* ((default-directory (make-temp-file "yasnippet-fixture" t))
          (yas-snippet-dirs (mapcar #'car dirs)))
@@ -895,12 +906,6 @@ add the snippets associated with the given mode."
         (when (>= emacs-major-version 24)
           (delete-directory default-directory 'recursive))))))
 
-(defmacro yas-with-snippet-dirs (dirs &rest body)
-  (declare (indent defun))
-  `(yas-call-with-snippet-dirs ,dirs
-                               #'(lambda ()
-                                   ,@body)))
-
 ;;; Older emacsen
 ;;;
 (unless (fboundp 'special-mode)
@@ -939,7 +944,6 @@ attention to case differences."
 (provide 'yasnippet-tests)
 ;; Local Variables:
 ;; indent-tabs-mode: nil
-;; lexical-binding: t
 ;; byte-compile-warnings: (not cl-functions)
 ;; End:
 ;;; yasnippet-tests.el ends here