]> code.delx.au - gnu-emacs-elpa/commitdiff
with-snippet-dirs: correct use of `unwind-protect`
authorJoão Távora <joaotavora@gmail.com>
Sun, 22 Apr 2012 15:29:57 +0000 (16:29 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 22 Apr 2012 15:29:57 +0000 (16:29 +0100)
yasnippet-tests.el

index 64742945bd96d48f9b5e05458485ba6f076be892..969eb066c94ce9bab145c5ffb39e2a2518bd3fa7 100755 (executable)
@@ -204,13 +204,14 @@ TODO: correct this bug!"
      ,@body))\r
 \r
 (defmacro with-snippet-dirs (dirs &rest body)\r
-  `(unwind-protect\r
-       (let ((default-directory (make-temp-file "yasnippet-fixture" t)))\r
-         (setq yas/snippet-dirs ',(mapcar #'car (cadr dirs)))\r
-         (mapc #'yas/make-file-or-dirs ,dirs)\r
-         ,@body)\r
-     (when (>= emacs-major-version 23)\r
-       (delete-directory default-directory 'recursive))))\r
+  `(let ((default-directory (make-temp-file "yasnippet-fixture" t)))\r
+     (unwind-protect\r
+         (progn       \r
+           (setq yas/snippet-dirs ',(mapcar #'car (cadr dirs)))\r
+           (mapc #'yas/make-file-or-dirs ,dirs)\r
+           ,@body)\r
+       (when (>= emacs-major-version 23)\r
+         (delete-directory default-directory 'recursive)))))\r
 \r
 ;;; Older emacsen\r
 ;;;\r