all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-babel-execute:dot -- why doesn't this work?
@ 2015-09-24  1:29 Matt Price
  2015-09-24  4:00 ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Price @ 2015-09-24  1:29 UTC (permalink / raw)
  To: Org Mode

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

I'm trying to draw some silly diagrams with dot, based on code stolen from
tutorials here:
http://irreal.org/blog/?p=2866
and here:
http://orgmode.org/worg/org-tutorials/org-dot-diagrams.html

The code won't work, though I can generate the diagram using a somewhat
clumsier method from here:
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-dot.html

Here are my two tables, one for nodes and one for edges (the real ones are
longer, with something like 30 or 40 nodes):

#+name: students-table
| *node* | *label*   | *shape* | *fillcolor* |
|--------+-----------+---------+-------------|
| a      | Omar      | ellipse | green       |
| b      | Hindia    | ellipse | orange      |
| c      | Yuvrai    | ellipse | purple      |

#+name: students-graph
| a | b |
| a | c |
| b | c |

I can generate my table using these two code blocks:

#+name: make-dot
#+BEGIN_SRC emacs-lisp :var table=students-table graph=students-graph
:results output :exports none
  (mapcar #'(lambda (x)
              (princ (format "%s [label=\"%s\" shape=%s style=\"filled\"
fillcolor=\"%s\"];\n"
                             (car x) (second x) (nth 2 x) (nth 3 x) )))
table)
  (mapcar #'(lambda (x)
              (princ (format "%s -- %s;\n"
                             (first x) (second x)))) graph)


#+END_SRC

#+BEGIN_SRC dot :file Images/test-dot.png :var input=make-dot :exports
results
graph {
rankdir=TB
$input
}
#+END_SRC



I would, however, like to avoid the clumsy intermediate step and use
something like this instead:
#+name: graph-from-tables
#+HEADER: :var nodes=students-table graph=students-graph horiz='t
#+BEGIN_SRC emacs-lisp :file ~/example-diagram.png :colnames yes :exports
results
  (org-babel-execute:dot
   (concat
    "graph {\n"
    (when horiz "rankdir=LR;\n")       ;up-down or left-right
    (mapconcat
     (lambda (x)
       (format "%s [label=\"%s\" shape=%s style=\"filled\"
fillcolor=\"%s\"]"
               (car x)
               (nth 1 x)
               (if (string= "" (nth 2 x)) "box" (nth 2 x))
               (if (string= "" (nth 3 x)) "none" (nth 3 x))
               )) nodes "\n")
    "\n"
    (mapconcat
    (lambda (x)
      (format "%s -- %s;"
              (car x) (nth 1 x) )) graph "\n")
    "}\n") params)
#+END_SRC


However, this just creates a file ~/example-diagram.png whose content is
"nil%".  I'm not sure how to debug the problem.  Any suggestions? Does this
code work for you guys? I am using an uptodate arch linux, emacs 25, and a
recent graphviz.

thanks as always for the help.

Also -- WISHLIST: instead of a manually-entered list of edges, I'd like to
randomly create a  random set of connections between the nodes. I can
easily create a list of nodes:

 (let ((names () ))
   (dolist (x nodes)
     (push (nth 1 x ) names)
     )
    ... do some stuff here)

but generating a list of unique edges -- that is, node pairs where
(a . b) and (b . a) are considered equivalent -- is somewhat beyond me.

Again, many thanks,
Matt

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

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

* Re: org-babel-execute:dot -- why doesn't this work?
  2015-09-24  1:29 org-babel-execute:dot -- why doesn't this work? Matt Price
@ 2015-09-24  4:00 ` Nick Dokos
  2015-09-24 11:10   ` Matt Price
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2015-09-24  4:00 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

> I would, however, like to avoid the clumsy intermediate step and use something like this instead:
> #+name: graph-from-tables
> #+HEADER: :var nodes=students-table graph=students-graph horiz='t
> #+BEGIN_SRC emacs-lisp :file ~/example-diagram.png :colnames yes :exports results
>   (org-babel-execute:dot
>    (concat
>     "graph {\n"
>     (when horiz "rankdir=LR;\n")       ;up-down or left-right
>     (mapconcat
>      (lambda (x)
>        (format "%s [label=\"%s\" shape=%s style=\"filled\" fillcolor=\"%s\"]"
>                (car x)
>                (nth 1 x)
>                (if (string= "" (nth 2 x)) "box" (nth 2 x))
>                (if (string= "" (nth 3 x)) "none" (nth 3 x))
>                )) nodes "\n")
>     "\n"
>     (mapconcat
>     (lambda (x)
>       (format "%s -- %s;"
>               (car x) (nth 1 x) )) graph "\n")
>     "}\n") params)   
> #+END_SRC
>

There are a couple of problems, one minor (the :colnames yes part
truncates the graph so you have only two edges), and one major: the
"params" argument is not defined.

When a dot source block is passed to org-babel-execute:dot, the params
argument I get [fn:1] is:

((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#)
 (:noweb . "no") (:tangle . "no") (:exports . "results")
 (:results . "file replace") (:session . "none") (:hlines . "no")
 (:file . "Images/foobar.png") (:result-type . value)
 (:result-params "file" "replace") (:rowname-names) (:colname-names))

So I tried passing it to org-babel-execute:dot and somewhat
to my surprise it worked [fn:2] - try evaluating the following in your
*scratch* buffer (make sure there is an Images subdir under the
current directory of that buffer):

--8<---------------cut here---------------start------------->8---

(org-babel-execute:dot
 "graph {
rankdir=LR;
a [label=\"Omar\" shape=ellipse style=\"filled\" fillcolor=\"green\"]
b [label=\"Hindia\" shape=ellipse style=\"filled\" fillcolor=\"orange\"]
c [label=\"Yuvrai\" shape=ellipse style=\"filled\" fillcolor=\"purple\"]
a -- b;
a -- c;
b -- c;
}
"
 '((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#)
 (:noweb . "no") (:tangle . "no") (:exports . "results")
 (:results . "file replace") (:session . "none") (:hlines . "no")
 (:file . "Images/foobar.png") (:result-type . value)
 (:result-params "file" "replace") (:rowname-names) (:colname-names)))
--8<---------------cut here---------------end--------------->8---

But I would hardly call this method less clumsy than your earlier
attempt.

Footnotes:

[fn:1]  I made a simple dot source block with your graph

#+BEGIN_SRC dot :file Images/foobar.png
graph {
rankdir=LR;
a [label="Omar" shape=ellipse style="filled" fillcolor="green"]
b [label="Hindia" shape=ellipse style="filled" fillcolor="orange"]
c [label="Yuvrai" shape=ellipse style="filled" fillcolor="purple"]
a -- b;
a -- c;
b -- c;
}
#+END_SRC

and instrumented org-babel-execute:dot under edebug - when I executed the code
block, the debugger kicked in when the function got called and I could
get the "params" argument.

[fn:2] I thought the #1 and #1# constructs (which I don't understand at
       all) would make it blow up.

-- 
Nick

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

* Re: org-babel-execute:dot -- why doesn't this work?
  2015-09-24  4:00 ` Nick Dokos
@ 2015-09-24 11:10   ` Matt Price
  2015-09-24 12:46     ` Matt Price
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Price @ 2015-09-24 11:10 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Org Mode

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

On Thu, Sep 24, 2015 at 12:00 AM, Nick Dokos <ndokos@gmail.com> wrote:

> Matt Price <moptop99@gmail.com> writes:
>
> > I would, however, like to avoid the clumsy intermediate step and use
> something like this instead:
> > #+name: graph-from-tables
> > #+HEADER: :var nodes=students-table graph=students-graph horiz='t
> > #+BEGIN_SRC emacs-lisp :file ~/example-diagram.png :colnames yes
> :exports results
> >   (org-babel-execute:dot
> >    (concat
> >     "graph {\n"
> >     (when horiz "rankdir=LR;\n")       ;up-down or left-right
> >     (mapconcat
> >      (lambda (x)
> >        (format "%s [label=\"%s\" shape=%s style=\"filled\"
> fillcolor=\"%s\"]"
> >                (car x)
> >                (nth 1 x)
> >                (if (string= "" (nth 2 x)) "box" (nth 2 x))
> >                (if (string= "" (nth 3 x)) "none" (nth 3 x))
> >                )) nodes "\n")
> >     "\n"
> >     (mapconcat
> >     (lambda (x)
> >       (format "%s -- %s;"
> >               (car x) (nth 1 x) )) graph "\n")
> >     "}\n") params)
> > #+END_SRC
> >
>
> There are a couple of problems, one minor (the :colnames yes part
> truncates the graph so you have only two edges), and one major: the
> "params" argument is not defined.
>
> When a dot source block is passed to org-babel-execute:dot, the params
> argument I get [fn:1] is:
>
> ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#)
>  (:noweb . "no") (:tangle . "no") (:exports . "results")
>  (:results . "file replace") (:session . "none") (:hlines . "no")
>  (:file . "Images/foobar.png") (:result-type . value)
>  (:result-params "file" "replace") (:rowname-names) (:colname-names))
>
> So I tried passing it to org-babel-execute:dot and somewhat
> to my surprise it worked [fn:2] - try evaluating the following in your
> *scratch* buffer (make sure there is an Images subdir under the
> current directory of that buffer):
>
> --8<---------------cut here---------------start------------->8---
>
> (org-babel-execute:dot
>  "graph {
> rankdir=LR;
> a [label=\"Omar\" shape=ellipse style=\"filled\" fillcolor=\"green\"]
> b [label=\"Hindia\" shape=ellipse style=\"filled\" fillcolor=\"orange\"]
> c [label=\"Yuvrai\" shape=ellipse style=\"filled\" fillcolor=\"purple\"]
> a -- b;
> a -- c;
> b -- c;
> }
> "
>  '((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#)
>  (:noweb . "no") (:tangle . "no") (:exports . "results")
>  (:results . "file replace") (:session . "none") (:hlines . "no")
>  (:file . "Images/foobar.png") (:result-type . value)
>  (:result-params "file" "replace") (:rowname-names) (:colname-names)))
> --8<---------------cut here---------------end--------------->8---
>
> But I would hardly call this method less clumsy than your earlier
> attempt.
>
> Footnotes:
>
> [fn:1]  I made a simple dot source block with your graph
>
> #+BEGIN_SRC dot :file Images/foobar.png
> graph {
> rankdir=LR;
> a [label="Omar" shape=ellipse style="filled" fillcolor="green"]
> b [label="Hindia" shape=ellipse style="filled" fillcolor="orange"]
> c [label="Yuvrai" shape=ellipse style="filled" fillcolor="purple"]
> a -- b;
> a -- c;
> b -- c;
> }
> #+END_SRC
>
> and instrumented org-babel-execute:dot under edebug - when I executed the
> code
> block, the debugger kicked in when the function got called and I could
> get the "params" argument.
>
> [fn:2] I thought the #1 and #1# constructs (which I don't understand at
>        all) would make it blow up.
>
> --
> Nick
>
> Many thanks, Nick, and especially to the pointer to edebug (so obvious
once you say it!).  With my original code, I stepped through the whole
function and I can't quite understand why it's not working. The code block
text is generated as expected, but somehow it's not getting written, or
perhaps not executed by dot, as hoped.  Here is the debugging output:

(nodes (quote (("a" "Omar" "ellipse" "green") ("b" "Hindia" "ellipse"
"orange") ("c" "Yuvrai" "ellipse" "purple"))))

(graph (quote (("a" "b") ("a" "c"))))

(horiz (quote t))

funcall-interactively: Buffer is read-only: #<buffer ob-dot.el> [4 times]

Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline .
#1#) (:noweb . "no") (:tangle . "no") (:exports . "results") (:results .
"file replace") (:var nodes ("a" "Omar" "ellipse" "green") ("b" "Hindia"
"ellipse" "orange") ("c" "Yuvrai" "ellipse" "purple")) (:var graph ("a"
"b") ("a" "c")) (:var horiz . t) (:colnames . "yes") (:file .
"~/example-diagram.png") (:hlines . "no") (:session . "none") (:result-type
. value) (:result-params "file" "replace") (:rowname-names) (:colname-names
(nodes "*node*" "*label*" "*shape*" "*fillcolor*") (graph "From" "To")))

Result: (:result-params "file" "replace")

Result: ("file" "replace")

Stop

Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline .
#1#) (:noweb . "no") (:tangle . "no") (:exports . "results") (:results .
"file replace") (:var nodes ("a" "Omar" "ellipse" "green") ("b" "Hindia"
"ellipse" "orange") ("c" "Yuvrai" "ellipse" "purple")) (:var graph ("a"
"b") ("a" "c")) (:var horiz . t) (:colnames . "yes") (:file .
"~/example-diagram.png") (:hlines . "no") (:session . "none") (:result-type
. value) (:result-params "file" "replace") (:rowname-names) (:colname-names
(nodes "*node*" "*label*" "*shape*" "*fillcolor*") (graph "From" "To")))
Stop

Result: (:file . "~/example-diagram.png")
Stop

Result: (:file . "~/example-diagram.png")
Stop

Result: "~/example-diagram.png"

Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline .
#1#) (:noweb . "no") (:tangle . "no") (:exports . "results") (:results .
"file replace") (:var nodes ("a" "Omar" "ellipse" "green") ("b" "Hindia"
"ellipse" "orange") ("c" "Yuvrai" "ellipse" "purple")) (:var graph ("a"
"b") ("a" "c")) (:var horiz . t) (:colnames . "yes") (:file .
"~/example-diagram.png") (:hlines . "no") (:session . "none") (:result-type
. value) (:result-params "file" "replace") (:rowname-names) (:colname-names
(nodes "*node*" "*label*" "*shape*" "*fillcolor*") (graph "From" "To")))
Stop

Result: nil
Stop

Result: nil
Stop

Stop

Result: "~/example-diagram.png"

Result: "png"

Result: "-Tpng"

Result: "-Tpng"

Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline .
#1#) (:noweb . "no") (:tangle . "no") (:exports . "results") (:results .
"file replace") (:var nodes ("a" "Omar" "ellipse" "green") ("b" "Hindia"
"ellipse" "orange") ("c" "Yuvrai" "ellipse" "purple")) (:var graph ("a"
"b") ("a" "c")) (:var horiz . t) (:colnames . "yes") (:file .
"~/example-diagram.png") (:hlines . "no") (:session . "none") (:result-type
. value) (:result-params "file" "replace") (:rowname-names) (:colname-names
(nodes "*node*" "*label*" "*shape*" "*fillcolor*") (graph "From" "To")))
Stop

Result: nil
Stop

Result: nil
Stop

Result: "dot"

Result: "/tmp/babel-2749DTL/dot-2749Nkt"

Result: "/tmp/babel-2749DTL/dot-2749Nkt"

Result: "graph {\nrankdir=LR;\na [label=\"Omar\" shape=ellipse
style=\"filled\" fillcolor=\"green\"]\nb [label=\"Hindia\" shape=ellipse
style=\"filled\" fillcolor=\"orange\"]\nc [label=\"Yuvrai\" shape=ellipse
style=\"filled\" fillcolor=\"purple\"]\na -- b;\na -- c;}\n"
Stop

Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline .
#1#) (:noweb . "no") (:tangle . "no") (:exports . "results") (:results .
"file replace") (:var nodes ("a" "Omar" "ellipse" "green") ("b" "Hindia"
"ellipse" "orange") ("c" "Yuvrai" "ellipse" "purple")) (:var graph ("a"
"b") ("a" "c")) (:var horiz . t) (:colnames . "yes") (:file .
"~/example-diagram.png") (:hlines . "no") (:session . "none") (:result-type
. value) (:result-params "file" "replace") (:rowname-names) (:colname-names
(nodes "*node*" "*label*" "*shape*" "*fillcolor*") (graph "From" "To")))
Stop

Result: "graph {\nrankdir=LR;\na [label=\"Omar\" shape=ellipse
style=\"filled\" fillcolor=\"green\"]\nb [label=\"Hindia\" shape=ellipse
style=\"filled\" fillcolor=\"orange\"]\nc [label=\"Yuvrai\" shape=ellipse
style=\"filled\" fillcolor=\"purple\"]\na -- b;\na -- c;}\n"
Stop

Result: nil
Stop

Result: nil
Stop

Stop

Stop

Result: "dot"

Result: "/tmp/babel-2749DTL/dot-2749Nkt"

Result: "/tmp/babel-2749DTL/dot-2749Nkt"

Result: "-Tpng"

Stop

Result: "~/example-diagram.png"

Result: "/home/matt/example-diagram.png"
Stop

Result: "dot /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o
/home/matt/example-diagram.png"
Stop

Wrote /tmp/babel-2749DTL/ob-input-2749auz
Result: ""

Result: nil

Code block evaluation complete.
Mark set

-----
it looks about right until the very end; Manually running "dot
/tmp/babel-2749DTL/dot-2749Nkt -Tpng -o /home/matt/example-diagram.png"
from a shell works fine. However, the result of:

(org-babel-eval
     (concat cmd
         " " (org-babel-process-file-name in-file)
         " " cmdline
         " -o " (org-babel-process-file-name out-file)) "")

is "nil".  Any idea why that might be?

Again, many thanks,
Matt

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

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

* Re: org-babel-execute:dot -- why doesn't this work?
  2015-09-24 11:10   ` Matt Price
@ 2015-09-24 12:46     ` Matt Price
  2015-10-23 12:27       ` Éibhear
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Price @ 2015-09-24 12:46 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Org Mode

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

On Thu, Sep 24, 2015 at 7:10 AM, Matt Price <moptop99@gmail.com> wrote:

>
>
> On Thu, Sep 24, 2015 at 12:00 AM, Nick Dokos <ndokos@gmail.com> wrote:
>
>> Matt Price <moptop99@gmail.com> writes:
>>
>
> -----
> it looks about right until the very end; Manually running "dot
> /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o /home/matt/example-diagram.png"
> from a shell works fine. However, the result of:
>
> (org-babel-eval
>      (concat cmd
>          " " (org-babel-process-file-name in-file)
>          " " cmdline
>          " -o " (org-babel-process-file-name out-file)) "")
>
> is "nil".  Any idea why that might be?
>
>
Just a quick addendum.  Pausing during debugging and running

(with-temp-file in-file )
(org-babel-eval
 "dot /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o
/home/matt/example-diagram.png"  "")

from a scratch buffer also works.  So I am really confused -- maybe there
is something wrong with ob-dot itself?

Again, many thanks,
> Matt
>

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

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

* Re: org-babel-execute:dot -- why doesn't this work?
  2015-09-24 12:46     ` Matt Price
@ 2015-10-23 12:27       ` Éibhear
  2015-10-23 17:43         ` Matt Price
  0 siblings, 1 reply; 7+ messages in thread
From: Éibhear @ 2015-10-23 12:27 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99 <at> gmail.com> writes:

> 
> 
> 
> On Thu, Sep 24, 2015 at 7:10 AM, Matt Price <moptop99 <at> gmail.com> wrote:
> 
> 
> On Thu, Sep 24, 2015 at 12:00 AM, Nick Dokos <ndokos <at> gmail.com> wrote:
> Matt Price <moptop99 <at> gmail.com> writes:
> 
> 
> 
> -----
> 
> it looks about right until the very end; Manually running "dot
/tmp/babel-2749DTL/dot-2749Nkt -Tpng -o /home/matt/example-diagram.png" from
a shell works fine. However, the result of:(org-babel-eval     (concat
cmd         " " (org-babel-process-file-name in-file)         " " cmdline   
     " -o " (org-babel-process-file-name out-file)) "")
> 
> is "nil".  Any idea why that might be?  
> 
> 
> 
> Just a quick addendum.  Pausing during debugging and running
(with-temp-file in-file )(org-babel-eval  "dot
/tmp/babel-2749DTL/dot-2749Nkt -Tpng -o /home/matt/example-diagram.png"  "")  
> 
> from a scratch buffer also works.  So I am really confused -- maybe there
is something wrong with ob-dot itself?
> 
> 
> 
> 
> Again, many thanks,
> 
> Matt
> 
> 
> 
> 
> 
> 
> 

Hi Matt,

Did you get this worked out?

Thanks,

Éibhear


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

* Re: org-babel-execute:dot -- why doesn't this work?
  2015-10-23 12:27       ` Éibhear
@ 2015-10-23 17:43         ` Matt Price
  2015-10-23 20:48           ` Éibhear
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Price @ 2015-10-23 17:43 UTC (permalink / raw)
  To: Éibhear; +Cc: Org Mode

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

On Fri, Oct 23, 2015 at 8:27 AM, Éibhear <eibhear.geo@gmail.com> wrote:

> Matt Price <moptop99 <at> gmail.com> writes:
>
> >
> >
> >
> > On Thu, Sep 24, 2015 at 7:10 AM, Matt Price <moptop99 <at> gmail.com>
> wrote:
> >
> >
> > On Thu, Sep 24, 2015 at 12:00 AM, Nick Dokos <ndokos <at> gmail.com>
> wrote:
> > Matt Price <moptop99 <at> gmail.com> writes:
> >
> >
> >
> > -----
> >
> > it looks about right until the very end; Manually running "dot
> /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o /home/matt/example-diagram.png"
> from
> a shell works fine. However, the result of:(org-babel-eval     (concat
> cmd         " " (org-babel-process-file-name in-file)         " "
> cmdline
>      " -o " (org-babel-process-file-name out-file)) "")
> >
> > is "nil".  Any idea why that might be?
> >
> >
> >
> > Just a quick addendum.  Pausing during debugging and running
> (with-temp-file in-file )(org-babel-eval  "dot
> /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o /home/matt/example-diagram.png"
> "")
> >
> > from a scratch buffer also works.  So I am really confused -- maybe there
> is something wrong with ob-dot itself?
> >
> >
> >
> >
> > Again, many thanks,
> >
> > Matt
> >
> >
> >
> >
> >
> >
> >
>
> Hi Matt,
>
> Did you get this worked out?
>
> Thanks,
>
> Éibhear
>
>
hmm.  It looks like maybe I didn't -- I confess I'd forgotten about this
old email.  Looks like I just generated the diagram from a scratch buffer,
as described in my email.  Sorry I didn't get further!

Matt

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

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

* Re: org-babel-execute:dot -- why doesn't this work?
  2015-10-23 17:43         ` Matt Price
@ 2015-10-23 20:48           ` Éibhear
  0 siblings, 0 replies; 7+ messages in thread
From: Éibhear @ 2015-10-23 20:48 UTC (permalink / raw)
  To: Matt Price; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 23/10/15 18:43, Matt Price wrote:
> 
> 
> On Fri, Oct 23, 2015 at 8:27 AM, Éibhear <eibhear.geo@gmail.com 
> <mailto:eibhear.geo@gmail.com>> wrote:
> 
> Matt Price <moptop99 <at> gmail.com <http://gmail.com>> writes:
> 
>> 
>> 
>> 
>> On Thu, Sep 24, 2015 at 7:10 AM, Matt Price <moptop99 <at>
> gmail.com <http://gmail.com>> wrote:
>> 
>> 
>> On Thu, Sep 24, 2015 at 12:00 AM, Nick Dokos <ndokos <at>
>> gmail.com <http://gmail.com>> wrote: Matt Price <moptop99 <at>
>> gmail.com <http://gmail.com>> writes:
>> 
>> 
>> 
>> -----
>> 
>> it looks about right until the very end; Manually running "dot
> /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o 
> /home/matt/example-diagram.png" from a shell works fine. However,
> the result of:(org-babel-eval     (concat cmd         " "
> (org-babel-process-file-name in-file)         " " cmdline " -o "
> (org-babel-process-file-name out-file)) "")
>> 
>> is "nil".  Any idea why that might be?
>> 
>> 
>> 
>> Just a quick addendum.  Pausing during debugging and running
> (with-temp-file in-file )(org-babel-eval  "dot 
> /tmp/babel-2749DTL/dot-2749Nkt -Tpng -o 
> /home/matt/example-diagram.png"  "")
>> 
>> from a scratch buffer also works.  So I am really confused --
>> maybe there
> is something wrong with ob-dot itself?
>> 
>> 
>> 
>> 
>> Again, many thanks,
>> 
>> Matt
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> Hi Matt,
> 
> Did you get this worked out?
> 
> Thanks,
> 
> Éibhear
> 
> 
> hmm.  It looks like maybe I didn't -- I confess I'd forgotten about
> this old email.  Looks like I just generated the diagram from a
> scratch buffer, as described in my email.  Sorry I didn't get
> further!
> 
> Matt
> 

No problems.

I've determined tonight that it was working fine in org 8.2.10, but
the problem you report is in org 8.3.1. There are many changes in
ob-core.el, but little in ob-dot.el or ob-eval.el, so further
investigation is required. I'll continue plugging. I really like
building graphs using dot through org-mode, so I'd love to see this
fixed (e.g. I had to revert to LibreOffice Draw today!).

Thanks,

Éibhear

- -- 
Éibhear Ó hAnluain
Dublin, Ireland.
+-------------------------------+--------------------------------+
| e-mail: eibhear.geo@gmail.com | Web: [http://www.gibiris.org/] |
| Twitter: @eibhear             | Google+: +Éibhear Ó hAnluain   |
| Mobile: +353 86 856 5666      | VoIP: sip:eibhear@linphone.org |
+-------------------------------+--------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlYqnQcACgkQ0ST+nPIXcQZurgCggeNdy7yv1hY3ItQ4JhvBYOLm
pnQAoJM0/DNnCmOC1EsWP1C0mqEwDxpr
=KF2z
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2015-10-23 20:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24  1:29 org-babel-execute:dot -- why doesn't this work? Matt Price
2015-09-24  4:00 ` Nick Dokos
2015-09-24 11:10   ` Matt Price
2015-09-24 12:46     ` Matt Price
2015-10-23 12:27       ` Éibhear
2015-10-23 17:43         ` Matt Price
2015-10-23 20:48           ` Éibhear

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.