Kyle Meyer <k...@kyleam.com> writes:

> Thanks for your comments.  I've attached updated patches.

Thanks.

> Subject: [PATCH 1/2] ob-python.el: Allow indented code in sessions
>
> * lisp/ob-python.el (org-babel-python-evaluate-session): Recognize
> indented code in session and treat it differently to avoid syntax
> errors.

You also need to list new functions and variables in commit message,
e.g.,

  (org-babel-python-indented-lines-session-method): New variable.

> * lisp/ob-python.el (org-babel-python-evaluate-session): Strip extra leading
>   "..." and ">>>" from session output.

Ditto.

  (org-babel-python--strip-session-chars): New function.

> +(defun org-babel-python--strip-session-chars (string)
> +  "Remove leading '>>>' and '...' from STRING.
> +`org-babel-comint-with-output' splits the Python session output
> +by `comint-prompt-regexp' (which includes '>>>' and '...'), but,
> +in some situations, these still make it through at the start of
> +the output string."

Wouldn't it be better to find the situations above at the source? If may
be due to some indentation problem at the beginning of the string, in
which case an `org-trim' within `org-babel-comint-with-output' could
solve it.

WDYT?


Regards,

Reply via email to