emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* results from Python block not visible
@ 2014-06-26 16:16 Daniel Clemente
  2014-06-26 16:36 ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Clemente @ 2014-06-26 16:16 UTC (permalink / raw)
  To: org-mode Mailinglist


Hi, this babel code recently stopped working on my system:

#+BEGIN_SRC python :results output
print "x"
#+END_SRC

It prints:

#+RESULTS:
: None

I expected to see "x". This worked some days ago.

If I use a command like os.system("xeyes"), I see it running.

In addition I don't see the Python block highlighted


GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2014-06-20 on la4
org-mode from today
Debian. Python 2.7 (same with Python 3).
It also happens under emacs -Q

Of course I loaded Python support:

(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (C . t)
; …
   (python . t)
   (ruby . t)
   (sql . t)
   (sqlite . t)))


Greetings, Daniel

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

* Re: results from Python block not visible
  2014-06-26 16:16 results from Python block not visible Daniel Clemente
@ 2014-06-26 16:36 ` Eric Schulte
  2014-06-26 17:19   ` Daniel Clemente
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Schulte @ 2014-06-26 16:36 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: org-mode Mailinglist

Daniel Clemente <n142857@gmail.com> writes:

> Hi, this babel code recently stopped working on my system:
>
> #+BEGIN_SRC python :results output
> print "x"
> #+END_SRC
>
> It prints:
>
> #+RESULTS:
> : None
>
> I expected to see "x". This worked some days ago.
>

This works for me using the latest version of Org-mode with an Emacs
launched by running "make vanilla" from the base of the Org-mode repo.

Maybe the problem is in your configuration?

>
> If I use a command like os.system("xeyes"), I see it running.
>
> In addition I don't see the Python block highlighted
>
>
> GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2014-06-20 on la4
> org-mode from today
> Debian. Python 2.7 (same with Python 3).
> It also happens under emacs -Q
>
> Of course I loaded Python support:
>
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)
>    (C . t)
> ; …
>    (python . t)
>    (ruby . t)
>    (sql . t)
>    (sqlite . t)))
>
>
> Greetings, Daniel
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)

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

* Re: results from Python block not visible
  2014-06-26 16:36 ` Eric Schulte
@ 2014-06-26 17:19   ` Daniel Clemente
  2014-06-27  9:50     ` Daniel Clemente
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Clemente @ 2014-06-26 17:19 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode Mailinglist


El Thu, 26 Jun 2014 12:36:47 -0400 Eric Schulte va escriure:
> > #+BEGIN_SRC python :results output
> > print "x"
> > #+END_SRC
> >
> > It prints:
> >
> > #+RESULTS:
> > : None
> >
> > I expected to see "x". This worked some days ago.
> >
> 
> This works for me using the latest version of Org-mode with an Emacs
> launched by running "make vanilla" from the base of the Org-mode repo.
>
  I didn't know "make vanilla". It worked fine from there, I don't know why from „emacs -Q“ it didn't.
  
> Maybe the problem is in your configuration?

  Exactly, it is from my configuration, because after loading my full configuration, I see the problem again and code highlighting suddenly disappears.
  
  I identified the exact lines that cause org-babel to stop failing. Bewonder:

  (autoload 'tramp "tramp" "Remotely access files." t)
  (require 'tramp-cache)

  Yes! After C-x C-e on the first line, org-babel still works. After C-x C-e on the second line, it doesn't work anymore.
  There were some Tramp changes in latest Emacs, maybe they are bad. I'm using:  GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2014-06-20 on la4
  

  What a strange bug…

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

* Re: results from Python block not visible
  2014-06-26 17:19   ` Daniel Clemente
@ 2014-06-27  9:50     ` Daniel Clemente
  2014-07-02 16:51       ` Daniel Clemente
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Clemente @ 2014-06-27  9:50 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

I confirm that with Debian's Emacs, org-babel works well after the (require
'tramp-cache):
GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-06-06
on barber, modified by Debian

But it fails with my compiled one from 2014-06-20.

So is it because of tramp-cache or org-babel?


On Fri, Jun 27, 2014 at 12:19 AM, Daniel Clemente <n142857@gmail.com> wrote:

>
> El Thu, 26 Jun 2014 12:36:47 -0400 Eric Schulte va escriure:
> > > #+BEGIN_SRC python :results output
> > > print "x"
> > > #+END_SRC
> > >
> > > It prints:
> > >
> > > #+RESULTS:
> > > : None
> > >
> > > I expected to see "x". This worked some days ago.
> > >
> >
> > This works for me using the latest version of Org-mode with an Emacs
> > launched by running "make vanilla" from the base of the Org-mode repo.
> >
>   I didn't know "make vanilla". It worked fine from there, I don't know
> why from "emacs -Q" it didn't.
>
> > Maybe the problem is in your configuration?
>
>   Exactly, it is from my configuration, because after loading my full
> configuration, I see the problem again and code highlighting suddenly
> disappears.
>
>   I identified the exact lines that cause org-babel to stop failing.
> Bewonder:
>
>   (autoload 'tramp "tramp" "Remotely access files." t)
>   (require 'tramp-cache)
>
>   Yes! After C-x C-e on the first line, org-babel still works. After C-x
> C-e on the second line, it doesn't work anymore.
>   There were some Tramp changes in latest Emacs, maybe they are bad. I'm
> using:  GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw
> scroll bars) of 2014-06-20 on la4
>
>
>   What a strange bug...
>
>

[-- Attachment #2: Type: text/html, Size: 2342 bytes --]

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

* Re: results from Python block not visible
  2014-06-27  9:50     ` Daniel Clemente
@ 2014-07-02 16:51       ` Daniel Clemente
  2014-07-24  7:18         ` Daniel Clemente
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Clemente @ 2014-07-02 16:51 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 2812 bytes --]

Since this org-babel + tramp-cache incompatibility is very puzzling, I
continued researching it. The line that makes my Python block stop working
(i.e. outputting None instead of the "x" I asked with print "x') is this
one, found in tramp-cache.el:

(add-hook 'kill-buffer-hook 'tramp-flush-file-function)

Its code is:

(defun tramp-flush-file-function ()
 "Flush all Tramp cache properties from `buffer-file-name'.
This is suppressed for temporary buffers."
 (unless (string-match "^ \\*temp\\*" (or (buffer-name) ""))
   (let ((bfn (if (stringp (buffer-file-name))
  (buffer-file-name)
default-directory)))
     (when (tramp-tramp-file-p bfn)
(with-parsed-tramp-file-name bfn nil
 (tramp-flush-file-property v localname))))))


That "temporary buffer detector" is working correctly because org-babel
buffers have names like " *temp*-993012", which are correctly detected.
I'm afraid that the (string-match ...) will forget the last search, so later
(match-string) done by babel will be from the wrong search. Can this happen?

--
Daniel


On Fri, Jun 27, 2014 at 4:50 PM, Daniel Clemente <n142857@gmail.com> wrote:

> I confirm that with Debian's Emacs, org-babel works well after the
> (require 'tramp-cache):
> GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-06-06
> on barber, modified by Debian
>
> But it fails with my compiled one from 2014-06-20.
>
> So is it because of tramp-cache or org-babel?
>
>
> On Fri, Jun 27, 2014 at 12:19 AM, Daniel Clemente <n142857@gmail.com>
> wrote:
>
>>
>> El Thu, 26 Jun 2014 12:36:47 -0400 Eric Schulte va escriure:
>> > > #+BEGIN_SRC python :results output
>> > > print "x"
>> > > #+END_SRC
>> > >
>> > > It prints:
>> > >
>> > > #+RESULTS:
>> > > : None
>> > >
>> > > I expected to see "x". This worked some days ago.
>> > >
>> >
>> > This works for me using the latest version of Org-mode with an Emacs
>> > launched by running "make vanilla" from the base of the Org-mode repo.
>> >
>>   I didn't know "make vanilla". It worked fine from there, I don't know
>> why from "emacs -Q" it didn't.
>>
>> > Maybe the problem is in your configuration?
>>
>>   Exactly, it is from my configuration, because after loading my full
>> configuration, I see the problem again and code highlighting suddenly
>> disappears.
>>
>>   I identified the exact lines that cause org-babel to stop failing.
>> Bewonder:
>>
>>   (autoload 'tramp "tramp" "Remotely access files." t)
>>   (require 'tramp-cache)
>>
>>   Yes! After C-x C-e on the first line, org-babel still works. After C-x
>> C-e on the second line, it doesn't work anymore.
>>   There were some Tramp changes in latest Emacs, maybe they are bad. I'm
>> using:  GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw
>> scroll bars) of 2014-06-20 on la4
>>
>>
>>   What a strange bug...
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4066 bytes --]

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

* Re: results from Python block not visible
  2014-07-02 16:51       ` Daniel Clemente
@ 2014-07-24  7:18         ` Daniel Clemente
  2014-07-24 10:07           ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Clemente @ 2014-07-24  7:18 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 3167 bytes --]

I reported this to emacs (bug 18095):
http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-07/msg00736.html

It's still happening with latest emacs and org-mode


On Wed, Jul 2, 2014 at 11:51 PM, Daniel Clemente <n142857@gmail.com> wrote:

> Since this org-babel + tramp-cache incompatibility is very puzzling, I
> continued researching it. The line that makes my Python block stop working
> (i.e. outputting None instead of the "x" I asked with print "x') is this
> one, found in tramp-cache.el:
>
> (add-hook 'kill-buffer-hook 'tramp-flush-file-function)
>
> Its code is:
>
> (defun tramp-flush-file-function ()
>  "Flush all Tramp cache properties from `buffer-file-name'.
> This is suppressed for temporary buffers."
>  (unless (string-match "^ \\*temp\\*" (or (buffer-name) ""))
>    (let ((bfn (if (stringp (buffer-file-name))
>   (buffer-file-name)
> default-directory)))
>      (when (tramp-tramp-file-p bfn)
> (with-parsed-tramp-file-name bfn nil
>  (tramp-flush-file-property v localname))))))
>
>
> That "temporary buffer detector" is working correctly because org-babel
> buffers have names like " *temp*-993012", which are correctly detected.
> I'm afraid that the (string-match ...) will forget the last search, so later
> (match-string) done by babel will be from the wrong search. Can this happen?
>
> --
> Daniel
>
>
> On Fri, Jun 27, 2014 at 4:50 PM, Daniel Clemente <n142857@gmail.com>
> wrote:
>
>> I confirm that with Debian's Emacs, org-babel works well after the
>> (require 'tramp-cache):
>> GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-06-06
>> on barber, modified by Debian
>>
>> But it fails with my compiled one from 2014-06-20.
>>
>> So is it because of tramp-cache or org-babel?
>>
>>
>> On Fri, Jun 27, 2014 at 12:19 AM, Daniel Clemente <n142857@gmail.com>
>> wrote:
>>
>>>
>>> El Thu, 26 Jun 2014 12:36:47 -0400 Eric Schulte va escriure:
>>> > > #+BEGIN_SRC python :results output
>>> > > print "x"
>>> > > #+END_SRC
>>> > >
>>> > > It prints:
>>> > >
>>> > > #+RESULTS:
>>> > > : None
>>> > >
>>> > > I expected to see "x". This worked some days ago.
>>> > >
>>> >
>>> > This works for me using the latest version of Org-mode with an Emacs
>>> > launched by running "make vanilla" from the base of the Org-mode repo.
>>> >
>>>   I didn't know "make vanilla". It worked fine from there, I don't know
>>> why from "emacs -Q" it didn't.
>>>
>>> > Maybe the problem is in your configuration?
>>>
>>>   Exactly, it is from my configuration, because after loading my full
>>> configuration, I see the problem again and code highlighting suddenly
>>> disappears.
>>>
>>>   I identified the exact lines that cause org-babel to stop failing.
>>> Bewonder:
>>>
>>>   (autoload 'tramp "tramp" "Remotely access files." t)
>>>   (require 'tramp-cache)
>>>
>>>   Yes! After C-x C-e on the first line, org-babel still works. After C-x
>>> C-e on the second line, it doesn't work anymore.
>>>   There were some Tramp changes in latest Emacs, maybe they are bad. I'm
>>> using:  GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw
>>> scroll bars) of 2014-06-20 on la4
>>>
>>>
>>>   What a strange bug...
>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4742 bytes --]

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

* Re: results from Python block not visible
  2014-07-24  7:18         ` Daniel Clemente
@ 2014-07-24 10:07           ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2014-07-24 10:07 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: org-mode Mailinglist, Eric Schulte

Daniel Clemente <n142857@gmail.com> writes:

> I reported this to emacs (bug 18095):
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-07/msg00736.html
>
> It's still happening with latest emacs and org-mode

It's fixed in Emacs' trunk.

Best regards, Michael.

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

end of thread, other threads:[~2014-07-24 10:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26 16:16 results from Python block not visible Daniel Clemente
2014-06-26 16:36 ` Eric Schulte
2014-06-26 17:19   ` Daniel Clemente
2014-06-27  9:50     ` Daniel Clemente
2014-07-02 16:51       ` Daniel Clemente
2014-07-24  7:18         ` Daniel Clemente
2014-07-24 10:07           ` Michael Albinus

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).