all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: Re: problem with babel call with post action
Date: Thu, 22 Jun 2017 16:32:53 +0100	[thread overview]
Message-ID: <878tkkavh6.fsf@delle7240.chemeng.ucl.ac.uk> (raw)
In-Reply-To: <7d0fe5cb25c04ee3bc8331ed0138a19f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Nicolas Goaziou's message of "Thu, 22 Jun 2017 07:30:30 +0000")


[-- Attachment #1.1: Type: text/plain, Size: 110 bytes --]

Helps if I attached the file...  <blush>

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: callexample.org --]
[-- Type: text/x-org, Size: 2716 bytes --]

A small example in which the ~call~ statement below fails with error message:
Successfully reloaded Org
#+begin_example
Org mode version 9.0.9 (release_9.0.9-551-g92e8c8 @ /home/ucecesf/git/org-mode/lisp/)
Evaluate this emacs-lisp code block on your system? (y or n) y
executing Emacs-Lisp code block...

(options (quote "rankdir=LR;"))

(nodes (quote (("start" "start" "ellipse" "" "") ("one" "first" "" "" "the first task") ("two" "second" "" "" "second task") ("end" "End" "ellipse" "" "project complete"))))

(graph (quote (("start" "one" "") ("start" "two" "") ("one" "end" "test") ("two" "end" ""))))

Evaluate this dot code block (plot-graph) on your system? (y or n) y
executing Dot code block (plot-graph)...
Wrote /tmp/babel-7617mN6/ob-input-7617ncr
"[[file:dependency-graph.pdf]]"
org-indent-add-properties: Wrong type argument: arrayp, nil
#+end_example

* Overview                                               :ignoreheading:
#+call: graph-from-tables(options="rankdir=LR;",nodes=subtasks-table[2:-1],graph=dependency-table[2:-1]) :exports results :results file :post plot-graph[:results file :exports results :file dependency-graph.pdf](graph=*this*)



#+name: subtasks-table
| node     | label    | shape   | colour | description                      |
|----------+----------+---------+--------+----------------------------------|
| start    | start    | ellipse |        |                                  |
| one      | first    |         |        | the first task                   |
| two      | second   |         |        | second task                      |
| end      | End      | ellipse |        | project complete                 |

#+name: dependency-table
| from     | to       | label |
|----------+----------+-------|
| start    | one      |       |
| start    | two      |       |
| one      | end      | test  |
| two      | end      |       |

* graph from table
#+name: graph-from-tables
#+header: :var options="" :var nodes='() graph='()
#+BEGIN_SRC emacs-lisp :wrap src dot
  (concat
   "digraph {\n"
   options "\n"   ;; "//rankdir=LR;\n" ;; remove comment characters '//' for horizontal layout; add for vertical layout
   (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 [taillabel=\"%s\"]"
              (car x) (nth 1 x) (nth 2 x))) graph "\n")
   "}\n")
#+END_SRC

#+name: plot-graph
#+begin_src dot :var graph="digraph { anode;}" :file graph.pdf
$graph
#+end_src

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

      parent reply	other threads:[~2017-06-22 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 15:28 problem with babel call with post action Eric S Fraga
2017-06-20 19:23 ` Nicolas Goaziou
     [not found] ` <7f25f31c2d8946deb9f1ac6d35fede98@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-21  5:51   ` Eric S Fraga
2017-06-22  7:30     ` Nicolas Goaziou
     [not found]     ` <7d0fe5cb25c04ee3bc8331ed0138a19f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-22 15:24       ` Eric S Fraga
2017-06-24 10:05         ` Nicolas Goaziou
     [not found]         ` <307ed99a7a0b43a7b76a79b4c4fb9eb7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-26  9:48           ` Eric S Fraga
2017-06-22 15:32       ` Eric S Fraga [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tkkavh6.fsf@delle7240.chemeng.ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.