branch: elpa/markdown-mode commit 807737366539f4fa9b9e5368b76b84c6bbd06a36 Author: Adam Porter <a...@alphapapa.net> Commit: Adam Porter <a...@alphapapa.net>
Tidy: (markdown-test-string-mode) This corrects a few issues: - Use of UNWIND-PROTECT with IGNORE in the UNWIND-FORMS is essentially the same as using IGNORE-ERRORS; but such errors probably shouldn't be ignored in these tests, anyway. - Using WITH-TEMP-BUFFER makes calling KILL-BUFFER unnecessary. - Using PROG1 with a spliced list of BODY forms is bogus, because only the first form's value would be returned, which would be hidden from callers of this macro; and it was likely used because of calling KILL-BUFFER, which isn't necessary, anyway. With these changes, the tests all still pass. --- tests/markdown-test.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/markdown-test.el b/tests/markdown-test.el index 22b7c9ea9e..0abcbc9423 100644 --- a/tests/markdown-test.el +++ b/tests/markdown-test.el @@ -51,17 +51,15 @@ "Run BODY in a temporary buffer containing STRING in MODE." (declare (indent 2)) `(let ((win (selected-window))) - (unwind-protect - (with-temp-buffer - (set-window-buffer win (current-buffer) t) - (erase-buffer) - (insert ,string) - (funcall ,mode) - (setq-default indent-tabs-mode nil) - (goto-char (point-min)) - (font-lock-ensure) - (prog1 ,@body (kill-buffer))) - (ignore)))) + (with-temp-buffer + (set-window-buffer win (current-buffer) t) + (erase-buffer) + (insert ,string) + (funcall ,mode) + (setq-default indent-tabs-mode nil) + (goto-char (point-min)) + (font-lock-ensure) + ,@body))) (defmacro markdown-test-file-mode (mode file &rest body) "Open FILE from `markdown-test-dir' in MODE and execute BODY."