mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
with-snippet-dirs: use UNWIND-PROTECT
This commit is contained in:
parent
59e18a999e
commit
9dedf91209
@ -204,10 +204,11 @@ TODO: correct this bug!"
|
|||||||
,@body))
|
,@body))
|
||||||
|
|
||||||
(defmacro with-snippet-dirs (dirs &rest body)
|
(defmacro with-snippet-dirs (dirs &rest body)
|
||||||
`(let ((default-directory (make-temp-file "yasnippet-fixture" t)))
|
`(unwind-protect
|
||||||
|
(let ((default-directory (make-temp-file "yasnippet-fixture" t)))
|
||||||
(setq yas/snippet-dirs ',(mapcar #'car (cadr dirs)))
|
(setq yas/snippet-dirs ',(mapcar #'car (cadr dirs)))
|
||||||
(mapc #'yas/make-file-or-dirs ,dirs)
|
(mapc #'yas/make-file-or-dirs ,dirs)
|
||||||
,@body
|
,@body)
|
||||||
(when (>= emacs-major-version 23)
|
(when (>= emacs-major-version 23)
|
||||||
(delete-directory default-directory 'recursive))))
|
(delete-directory default-directory 'recursive))))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user