emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] ob-python: Insert necessary blank line when sending code


From: qijian gong
Subject: Re: [O] [PATCH] ob-python: Insert necessary blank line when sending code to interpreter
Date: Tue, 03 Apr 2018 22:29:31 +0000

I've added comment and test (New path file in attachment),the test results look fine. 

#+BEGIN_SRC sh
$ make BTEST_RE="test-ob-python" test-dirty
...
selected tests: test-ob-python
Running 7 tests (2018-04-03 16:51:31+0800)
executing Python code block...
Code block evaluation complete.
   passed  1/7  test-ob-python/colnames-nil-header-argument
executing Python code block...
Code block evaluation complete.
   passed  2/7  test-ob-python/colnames-no-header-argument
executing Python code block...
Code block evaluation complete.
   passed  3/7  test-ob-python/colnames-no-header-argument-again
executing Python code block...
Code block evaluation complete.
   passed  4/7  test-ob-python/colnames-yes-header-argument
executing Python code block...
Code block evaluation complete.
   passed  5/7  test-ob-python/colnames-yes-header-argument-again
executing Python code block...
Code block evaluation complete.
   passed  6/7  test-ob-python/insert-necessary-blank-line-when-sending-code-to-interpreter
executing Python code block...
Code block evaluation complete.
   passed  7/7  test-ob-python/session-multiline

Ran 7 tests, 7 results as expected (2018-04-03 16:51:33+0800)
#+END_SRC

Nicolas Goaziou <address@hidden>于2018年4月3日 周二上午2:56写道:
Hello,

qijian gong <address@hidden> writes:

> I've written this patch to fix the syntax error alarm caused by evaluating
> the following code block:
>
> #+BEGIN_SRC python :session
> if True:
>     1
> 2
> #+END_SRC

Thank you.

Could you add a test in "test-ob-python.el"? Could you also add
a comment explaining what you are doing?

> +        (let ((curr-indent (string-match "[^\s]" line)))

  (string-match "\\S-" line)

Regards,

--
Nicolas Goaziou

Attachment: 0001-ob-python-Insert-necessary-blank-line-when-sending-c.patch
Description: Source code patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]