From 4ae3bc0affdeffceeac6f54512bf58ee7c26a02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 22 Apr 2012 16:29:57 +0100 Subject: [PATCH] with-snippet-dirs: correct use of `unwind-protect` --- yasnippet-tests.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/yasnippet-tests.el b/yasnippet-tests.el index 6474294..969eb06 100755 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -204,13 +204,14 @@ TODO: correct this bug!" ,@body)) (defmacro with-snippet-dirs (dirs &rest body) - `(unwind-protect - (let ((default-directory (make-temp-file "yasnippet-fixture" t))) - (setq yas/snippet-dirs ',(mapcar #'car (cadr dirs))) - (mapc #'yas/make-file-or-dirs ,dirs) - ,@body) - (when (>= emacs-major-version 23) - (delete-directory default-directory 'recursive)))) + `(let ((default-directory (make-temp-file "yasnippet-fixture" t))) + (unwind-protect + (progn + (setq yas/snippet-dirs ',(mapcar #'car (cadr dirs))) + (mapc #'yas/make-file-or-dirs ,dirs) + ,@body) + (when (>= emacs-major-version 23) + (delete-directory default-directory 'recursive))))) ;;; Older emacsen ;;;