emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: babel python indentations fail in sessions [8.3.1]
@ 2015-09-16 14:43 Benda Xu
  2015-09-16 15:28 ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Benda Xu @ 2015-09-16 14:43 UTC (permalink / raw)
  To: emacs-orgmode

Dear All,

The following code block fails:

   #+BEGIN_SRC python :results output :session
     for i in (1, 2):
         pass
     print "hey"
   #+END_SRC

   #+RESULTS:
   : 
   : ... ...   File "<stdin>", line 3
   :     print "hey"
   :         ^
   : SyntaxError: invalid syntax

but this works:

   #+BEGIN_SRC python :results output
     for i in (1, 2):
         pass
     print "hey"
   #+END_SRC

   #+RESULTS:
   : hey

It seems that the indentations get massed up with :session.

Any ideas?

Yours,
Benda

$ python -V
Python 2.7.9

Emacs  : GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2015-03-08 on trouble, modified by Debian
Package: Org-mode version 8.3.1 (8.3.1-dist @ /usr/share/emacs24/site-lisp/org-mode/)

current state:
==============
(setq
 org-export-babel-evaluate nil
 org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result-toggle-maybe
		      org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-format-latex-options '(:foreground default :background default :scale 1.7 :html-foreground "Black"
			    :html-background "Transparent" :html-scale 1.0 :matchers
			    ("begin" "$1" "$" "$$" "\\(" "\\["))
 org-confirm-shell-link-function 'yes-or-no-p
 org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
		 ("\\.pdf\\'" . default) ("\\.pdf::\\([0-9]+\\)\\'" . "okular \"%s\" -p %1"))
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
		 #[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes org-mode-reftex-setup)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-archive-location "~/art/gtd/archive.org::From %s"
 org-footnote-define-inline t
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo org-irc org-mew org-mhe
	       org-rmail org-special-blocks org-vm org-wl org-w3m)
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el") ("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-footnote-auto-label nil
 org-babel-load-languages '((emacs-lisp . t) (R . t) (python . t) (sh . t))
 org-agenda-files '("~/art/react/thesis/neutrino.org" "~/art/refBook.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-confirm-babel-evaluate nil
 )

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug: babel python indentations fail in sessions [8.3.1]
  2015-09-16 14:43 Bug: babel python indentations fail in sessions [8.3.1] Benda Xu
@ 2015-09-16 15:28 ` Kyle Meyer
  2015-09-17  3:09   ` Babel python regression org-mode-8 (Was: Bug: babel python indentations fail in sessions [8.3.1]) Benda Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2015-09-16 15:28 UTC (permalink / raw)
  To: Benda Xu; +Cc: emacs-orgmode

Hello,

Benda Xu <heroxbd@gentoo.org> writes:

> Dear All,
>
> The following code block fails:
>
>    #+BEGIN_SRC python :results output :session
>      for i in (1, 2):
>          pass
>      print "hey"
>    #+END_SRC
>
>
>    #+RESULTS:
>    :
>    : ... ...   File "<stdin>", line 3
>    :     print "hey"
>    :         ^
>    : SyntaxError: invalid syntax

[...]

> Any ideas?

I summarized my understanding of the issues with python sessions here
(the issue you report is #3):

    http://thread.gmane.org/gmane.emacs.orgmode/95980/focus=96076

It's on my TODO list to revisit.

--
Kyle

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Babel python regression org-mode-8 (Was: Bug: babel python indentations fail in sessions [8.3.1])
  2015-09-16 15:28 ` Kyle Meyer
@ 2015-09-17  3:09   ` Benda Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Benda Xu @ 2015-09-17  3:09 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Dan Davison, Eric Schulte

Hi Kyle,

Kyle Meyer <kyle@kyleam.com> writes:

> Benda Xu <heroxbd@gentoo.org> writes:
>>
>> The following code block fails:
>>
>>    #+BEGIN_SRC python :results output :session
>>      for i in (1, 2):
>>          pass
>>      print "hey"
>>    #+END_SRC
>>
>>
>>    #+RESULTS:
>>    :
>>    : ... ...   File "<stdin>", line 3
>>    :     print "hey"
>>    :         ^
>>    : SyntaxError: invalid syntax
>
> [...]
>
>> Any ideas?
>
> I summarized my understanding of the issues with python sessions here
> (the issue you report is #3):
>
>     http://thread.gmane.org/gmane.emacs.orgmode/95980/focus=96076
>
> It's on my TODO list to revisit.

Thanks for the pointer!  Interesting.

@Eric, @Dan, what's your insight for

  http://thread.gmane.org/gmane.emacs.orgmode/95980/focus=96076

Cheers,
Benda

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-17  3:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16 14:43 Bug: babel python indentations fail in sessions [8.3.1] Benda Xu
2015-09-16 15:28 ` Kyle Meyer
2015-09-17  3:09   ` Babel python regression org-mode-8 (Was: Bug: babel python indentations fail in sessions [8.3.1]) Benda Xu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).