From 1fc1d3902e2bfb1e8fbe54a7ff8af76c0a2438b1 Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Mon, 22 Oct 2018 11:40:19 +0200 Subject: [PATCH] Make with-testing-buffer macro return evaluated result of the body --- test/test.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/test.el b/test/test.el index 3a74bc1..ed0ebb5 100755 --- a/test/test.el +++ b/test/test.el @@ -11,11 +11,10 @@ (defmacro with-testing-buffer (file-name &rest body) "Execute 'body using a buffer with the contents of file 'file-name, killing the buffer afterwards" - (list 'let (list (list 'buffer - (list 'find-file - (list 'format "%s/test/testdata/%s" cwd file-name)))) - (let ((to-execute (list 'with-current-buffer 'buffer))) - (append to-execute body (list '(kill-buffer buffer)))))) + (list 'with-current-buffer (list 'find-file (format "%s/test/testdata/%s" cwd file-name)) + (list 'let (list (list 'result (append '(progn) body))) + '(kill-buffer (current-buffer)) + 'result))) (load (format "%sstomp.el" default-directory) nil t)