emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using Org and eev together - problem with source blocks
@ 2019-11-10  1:54 Eduardo Ochs
  2019-11-10 10:39 ` Ken Mankoff
  0 siblings, 1 reply; 5+ messages in thread
From: Eduardo Ochs @ 2019-11-10  1:54 UTC (permalink / raw)
  To: Org Mode, Alan Schmitt

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

Hi list,

I gave a presentation about eev at the EmacsConf a few days ago, and
after the conference I started to work on a tutorial to explain how to
use Org and eev together... links:

  http://angg.twu.net/emacsconf2019.html
  http://angg.twu.net/LATEX/2019emacsconf-long.pdf (slides)
  http://www.youtube.com/watch?v=86yiRG8YJD0&t=774 (demo)
  http://www.youtube.com/watch?v=86yiRG8YJD0&t=956 (demo: eepitch)
  http://angg.twu.net/eev-intros/find-org-intro.html (eev+Org, html)
  http://angg.twu.net/eev-intros/find-org-intro      (eev+Org, src)
  https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00124.html

I am longtime Org user that only uses a few features of Org - mainly
the ones here,

  (info "(org)Document Structure")

and when I tried to explain in my tutorial how to execute org source
blocks I stumbled on a behavior that I found very puzzling... I will
copy the relevant code here. The section on preparation says to run
these sexps,

  (require 'org)
  (require 'ob-sh)
  ;; or: (require 'ob-shell)
  (require 'ob-python)

and then a bit later the tutorial has this:



# (info "(org)Working With Source Code")
# (info "(org)Evaluating code blocks")

#+BEGIN_SRC sh
seq 200 204
#+END_SRC

#+BEGIN_SRC python
def square (x):
    return x*x

print(square(5))
#+END_SRC



but when I run the shell block with C-c C-c I get these errors

  Error reading results: (user-error No table at point)
  Code block produced no output.

and an empty "#+RESULTS:" block in Emacs24, and the right results
block in some later versions of Emacs, and when I run the Python block
with C-c C-c I always get a results block like this (without the
indentation):

  #+RESULTS:
  : None

What am I doing wrong? I expected an output of "25"... =(

Thanks in advance!

  Eduardo Ochs
  http://angg.twu.net/#eev

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

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

* Re: Using Org and eev together - problem with source blocks
  2019-11-10  1:54 Using Org and eev together - problem with source blocks Eduardo Ochs
@ 2019-11-10 10:39 ` Ken Mankoff
  2019-11-10 14:36   ` Eduardo Ochs
  0 siblings, 1 reply; 5+ messages in thread
From: Ken Mankoff @ 2019-11-10 10:39 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: Alan Schmitt, Org Mode


On 2019-11-10 at 02:54 +01, Eduardo Ochs <eduardoochs@gmail.com> wrote...
> #+BEGIN_SRC python
> def square (x):
>     return x*x
>
> print(square(5))
> #+END_SRC
>
> [...] when I run the Python block with C-c C-c I always get a results
> block like this (without the indentation):
>
>   #+RESULTS:
>   : None
>
> What am I doing wrong? I expected an output of "25"... =(

Adding ":output results" makes this work for me, but I'm not using emacs24.

  -k.

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

* Re: Using Org and eev together - problem with source blocks
  2019-11-10 10:39 ` Ken Mankoff
@ 2019-11-10 14:36   ` Eduardo Ochs
  2019-11-10 16:13     ` Ken Mankoff
  0 siblings, 1 reply; 5+ messages in thread
From: Eduardo Ochs @ 2019-11-10 14:36 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Alan Schmitt, Org Mode

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

Changing the Python source block to

#+BEGIN_SRC python :output results
def square (x):
    return x*x

print(square(5))
#+END_SRC

didn't change anything here, neither with emacs24 nor with git emacs,
and I grepped (recursively) for ":output" in the directory where I
cloned https://code.orgmode.org/bzg/org-mode.git and only found
references to ":output-dir" - except for a single occurrence of
":output" in contrib/lisp/ob-sclang.el...

Are you sure that you wrote it correctly?

  Cheers, E. =)
  http://angg.twu.net/#eev


On Sun, 10 Nov 2019 at 08:39, Ken Mankoff <mankoff@gmail.com> wrote:

>
> On 2019-11-10 at 02:54 +01, Eduardo Ochs <eduardoochs@gmail.com> wrote...
> > #+BEGIN_SRC python
> > def square (x):
> >     return x*x
> >
> > print(square(5))
> > #+END_SRC
> >
> > [...] when I run the Python block with C-c C-c I always get a results
> > block like this (without the indentation):
> >
> >   #+RESULTS:
> >   : None
> >
> > What am I doing wrong? I expected an output of "25"... =(
>
> Adding ":output results" makes this work for me, but I'm not using emacs24.
>
>   -k.
>

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

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

* Re: Using Org and eev together - problem with source blocks
  2019-11-10 14:36   ` Eduardo Ochs
@ 2019-11-10 16:13     ` Ken Mankoff
  2019-11-11 14:30       ` Eduardo Ochs
  0 siblings, 1 reply; 5+ messages in thread
From: Ken Mankoff @ 2019-11-10 16:13 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: Alan Schmitt, Org Mode


On 2019-11-10 at 15:36 +01, Eduardo Ochs <eduardoochs@gmail.com> wrote...
> Changing the Python source block to
>
> #+BEGIN_SRC python :output results
>
> Are you sure that you wrote it correctly?

I'm pretty sure I did not. Try ":results output"

  -k.

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

* Re: Using Org and eev together - problem with source blocks
  2019-11-10 16:13     ` Ken Mankoff
@ 2019-11-11 14:30       ` Eduardo Ochs
  0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Ochs @ 2019-11-11 14:30 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Alan Schmitt, Org Mode

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

Perfect!
I've added several mentions to ":results output" to the tutorial:
  http://angg.twu.net/eev-intros/find-org-intro.html
Thanks a lot! =)
  Eduardo
    http://angg.twu.net/#eev


On Sun, 10 Nov 2019 at 14:13, Ken Mankoff <mankoff@gmail.com> wrote:

>
> On 2019-11-10 at 15:36 +01, Eduardo Ochs <eduardoochs@gmail.com> wrote...
> > Changing the Python source block to
> >
> > #+BEGIN_SRC python :output results
> >
> > Are you sure that you wrote it correctly?
>
> I'm pretty sure I did not. Try ":results output"
>
>   -k.
>
>

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

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

end of thread, other threads:[~2019-11-11 14:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-10  1:54 Using Org and eev together - problem with source blocks Eduardo Ochs
2019-11-10 10:39 ` Ken Mankoff
2019-11-10 14:36   ` Eduardo Ochs
2019-11-10 16:13     ` Ken Mankoff
2019-11-11 14:30       ` Eduardo Ochs

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