From b765746c9c8c2c60e1018f48c92b612250776a9e Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 19 Apr 2014 13:35:28 -0400 Subject: Fix km/create-python-test-file 6cbfae7 broke this function when the test file doesn't exist. I'm not sure why I used `with-current-buffer' in the first place, considering the desired action is to switch to the file in another window. --- lisp/init-python.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/init-python.el b/lisp/init-python.el index d2f15b7..5ab562e 100644 --- a/lisp/init-python.el +++ b/lisp/init-python.el @@ -20,10 +20,9 @@ Unless a prefix argument ARG is given, py.test is also imported." (test-file (concat "test_" py-file))) (find-file-other-window test-file) (unless (file-exists-p test-file) - (with-current-buffer - (insert (format "import %s\n" (file-name-sans-extension py-file))) - (unless arg - (insert "import pytest\n")))))) + (insert (format "import %s\n" (file-name-sans-extension py-file))) + (unless arg + (insert "import pytest\n"))))) (defun km/pytest-compile (arg) "Run pytest. -- cgit v1.2.3