From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: Re: babel python example not reproducible Date: Tue, 17 Jun 2014 13:54:37 +0200 Message-ID: <53A02C7D.4020202@easy-emacs.de> References: <87egyox566.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwryv-0004g7-PE for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 07:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwryn-0001h9-Eg for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 07:55:17 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:52564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwryn-0001ga-6C for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 07:55:09 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On 17.06.2014 08:21, Shiyuan wrote: > Hi all, > I found a solution to fix the echo problem of the emacs python shell: > http://stackoverflow.com/questions/8060609/python-interpreter-in-emacs-repeats-lines > > That is, in the Interior Python buffer, do > M-: (setq comint-process-echoes t) ;; or nil > > Now, if I enter command directly in the interior python buffer, the command > is not echoed and this is what I want. > > However, When I evaluate the python src code block in org-mode(by `C-c > C-c`), the problem persists. I notice every time I evaluate the block, I > see 'org_babel_python_eoe' in the interior python buffer. > > I stumbled on a very strange emacs behavior. When I fiddled around, at > some point, I produced the correct answer as the manual. I thought I got > the right setup, but when I saved everything and restarted emacs, problem > persists. Will it be a sign of anything wrong? > > What's even stranger is that: the evaluation for the first time gives > different results from the evaluation for the second time, on exactly the > same src_block: > > This is what I got when I evaluation the code block for the first time: > ------------------------------------- > #+BEGIN_SRC python :results output :session foo > x=100 > print "hello" > 2 > print "bye" > #+END_SRC > > #+RESULTS: > #+begin_example > > x=100 >>>> print "hello" >>>> hello > 2 > 2 > print "bye" > bye > > > #+end_example > ----------------------------------------------- > ------------------------------------------------------- > > The following is what I got when I evaluate the same block again: > #+BEGIN_SRC python :results output :session foo > x=100 > print "hello" > 2 > print "bye" > #+END_SRC > > #+RESULTS: > : x=100 > : print "hello" > : hello > : 2 > : 2 > : print "bye" > : bye > : > : > > Notice that the prompt symbol ">>>" is in the result for the first > evaluation but not in the second evaluation. Also the result is not > embedded in the #+being_example/#+end_example for the second evaluation. > > I want to hunt down the problem. Any hints/helps is greatly appreciated. > > Shiyuan > > Hi Guys, please permit a comment after some times - it's just not to create heroes :) IMHO the complexity orb-babel took by creating its own slots for symbols like function names, variables etc. is not to handle reliably across the languages. A net and simple way out would be just to employ commands delivered by existing Emacs modes on org-source sections. Inserting the results might be provided by a hook. Cheers, Andreas