emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 2440d82 3/4: * packages/yasnippet/yasnippet-tests.el: Sile


From: Stefan Monnier
Subject: [elpa] master 2440d82 3/4: * packages/yasnippet/yasnippet-tests.el: Silence byte-compiler.
Date: Sat, 28 Mar 2015 20:30:14 +0000

branch: master
commit 2440d82ec9b70410742176349656251bfdcecf67
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * packages/yasnippet/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.
---
 packages/yasnippet/yasnippet-tests.el |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/packages/yasnippet/yasnippet-tests.el 
b/packages/yasnippet/yasnippet-tests.el
index e64c44b..2d7a0bc 100644
--- a/packages/yasnippet/yasnippet-tests.el
+++ b/packages/yasnippet/yasnippet-tests.el
@@ -1,6 +1,6 @@
 ;;; yasnippet-tests.el --- some yasnippet tests  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012, 2013, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2013, 2014, 2015  Free Software Foundation, Inc.
 
 ;; Author: Jo�o T�vora <address@hidden>
 ;; Keywords: emulations, convenience
@@ -237,6 +237,15 @@
              (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)
@@ -327,6 +336,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.
 ;; 
@@ -480,8 +492,9 @@ TODO: correct this bug!"
          (should (= (length expected)
                     (length observed))))))))
 
+(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")))
@@ -498,9 +511,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"
@@ -788,10 +802,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)))
@@ -803,12 +813,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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]