emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problem with babel call with post action
@ 2017-06-20 15:28 Eric S Fraga
  2017-06-20 19:23 ` Nicolas Goaziou
       [not found] ` <7f25f31c2d8946deb9f1ac6d35fede98@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Eric S Fraga @ 2017-06-20 15:28 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

the following single line command (may be wrapped in email) used to work
a while back (maybe last year?):

  #+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*)

This now gives this error message if I evaluate it:

  org-babel-ref-resolve: Reference ‘file dependency-graph.pdf](graph=*this*’ not found in this buffer

I've tried this with an up to date org (on another system) with same
outcome.  I have not yet tried emacs -Q.

For background, this call is to an elisp code block which converts two
tables describing a task network into dot/graphviz code which is then
fed to a skeleton dot code block.

I can post codes if required but I think the problem is with the actual
call line somehow.  Some change to links along the way?  Any suggestions
most welcome!

Thanks,
eric

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.7-531-g530113

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

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

* Re: problem with babel call with post action
  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>
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2017-06-20 19:23 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> the following single line command (may be wrapped in email) used to work
> a while back (maybe last year?):
>
>   #+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*)

That is a serious babel call.

> This now gives this error message if I evaluate it:
>
>   org-babel-ref-resolve: Reference ‘file dependency-graph.pdf](graph=*this*’ not found in this buffer
>
> I've tried this with an up to date org (on another system) with same
> outcome.  I have not yet tried emacs -Q.

I improved babel call arguments parsing. Could you confirm that your
wizardry is in order now?

Regards,

-- 
Nicolas Goaziou

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

* Re: problem with babel call with post action
       [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>
  0 siblings, 2 replies; 8+ messages in thread
From: Eric S Fraga @ 2017-06-21  5:51 UTC (permalink / raw)
  To: emacs-orgmode


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


Hi Nicolas,

Thanks for the quick response!

On Tuesday, 20 Jun 2017 at 19:23, Nicolas Goaziou wrote:

[...]

> That is a serious babel call.

:-)

I think it's a symptom of being lazy and spending way too much time on
codes to make life easier...  as in "The tale of the man who was too
lazy to fail" by Robert Heinlein [1].

> I improved babel call arguments parsing. Could you confirm that your
> wizardry is in order now?

I got further but there's still an error.  See attached debug output.  I
don't understand as org-table-to-lisp does exist.  I don't think it's a
configuration problem but...

thanks,
eric

Footnotes: 
[1]  https://en.wikipedia.org/wiki/Time_Enough_for_Love

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.8-568-ga615d3

[-- Attachment #1.2: debugoutput.txt --]
[-- Type: text/plain, Size: 15902 bytes --]

Debugger entered--Lisp error: (void-function org-table-to-lisp)
  (org-table-to-lisp)
  (mapcar (function (lambda (row) (if (and (symbolp row) (equal row (quote hline))) row (mapcar (function (lambda (el) (org-babel-read el ...))) row)))) (org-table-to-lisp))
  org-babel-read-table()
  (cond ((eq val (quote fixed-width)) (let ((v (org-trim (org-element-property :value element)))) (or (org-babel--string-to-number v) v))) ((eq val (quote table)) (org-babel-read-table)) ((eq val (quote plain-list)) (org-babel-read-list)) ((eq val (quote example-block)) (let ((v (org-element-property :value element))) (if (or org-src-preserve-indentation (org-element-property :preserve-indent element)) v (org-remove-indentation v)))) ((eq val (quote export-block)) (org-remove-indentation (org-element-property :value element))) ((eq val (quote paragraph)) (skip-chars-forward " 	") (if (and (looking-at org-bracket-link-regexp) (save-excursion (goto-char (match-end 0)) (skip-chars-forward " \r	\n") (<= (org-element-property :end element) (point)))) (org-babel-read-link) (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) ((memq val (quote (special-block verse-block quote-block center-block))) (org-remove-indentation (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) (t nil))
  (let* ((val (org-element-type element))) (cond ((eq val (quote fixed-width)) (let ((v (org-trim (org-element-property :value element)))) (or (org-babel--string-to-number v) v))) ((eq val (quote table)) (org-babel-read-table)) ((eq val (quote plain-list)) (org-babel-read-list)) ((eq val (quote example-block)) (let ((v (org-element-property :value element))) (if (or org-src-preserve-indentation (org-element-property :preserve-indent element)) v (org-remove-indentation v)))) ((eq val (quote export-block)) (org-remove-indentation (org-element-property :value element))) ((eq val (quote paragraph)) (skip-chars-forward " 	") (if (and (looking-at org-bracket-link-regexp) (save-excursion (goto-char (match-end 0)) (skip-chars-forward " \r	\n") (<= (org-element-property :end element) (point)))) (org-babel-read-link) (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) ((memq val (quote (special-block verse-block quote-block center-block))) (org-remove-indentation (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) (t nil)))
  (save-restriction (widen) (goto-char (org-element-property :post-affiliated element)) (let* ((val (org-element-type element))) (cond ((eq val (quote fixed-width)) (let ((v (org-trim ...))) (or (org-babel--string-to-number v) v))) ((eq val (quote table)) (org-babel-read-table)) ((eq val (quote plain-list)) (org-babel-read-list)) ((eq val (quote example-block)) (let ((v (org-element-property :value element))) (if (or org-src-preserve-indentation (org-element-property :preserve-indent element)) v (org-remove-indentation v)))) ((eq val (quote export-block)) (org-remove-indentation (org-element-property :value element))) ((eq val (quote paragraph)) (skip-chars-forward " 	") (if (and (looking-at org-bracket-link-regexp) (save-excursion (goto-char ...) (skip-chars-forward " \r	\n") (<= ... ...))) (org-babel-read-link) (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) ((memq val (quote (special-block verse-block quote-block center-block))) (org-remove-indentation (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) (t nil))))
  (save-excursion (save-restriction (widen) (goto-char (org-element-property :post-affiliated element)) (let* ((val (org-element-type element))) (cond ((eq val (quote fixed-width)) (let ((v ...)) (or (org-babel--string-to-number v) v))) ((eq val (quote table)) (org-babel-read-table)) ((eq val (quote plain-list)) (org-babel-read-list)) ((eq val (quote example-block)) (let ((v ...)) (if (or org-src-preserve-indentation ...) v (org-remove-indentation v)))) ((eq val (quote export-block)) (org-remove-indentation (org-element-property :value element))) ((eq val (quote paragraph)) (skip-chars-forward " 	") (if (and (looking-at org-bracket-link-regexp) (save-excursion ... ... ...)) (org-babel-read-link) (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) ((memq val (quote (special-block verse-block quote-block center-block))) (org-remove-indentation (buffer-substring-no-properties (org-element-property :contents-begin element) (org-element-property :contents-end element)))) (t nil)))))
  org-babel-read-element((table (:begin 14485 :end 15445 :type org :tblfm nil :contents-begin 14508 :contents-end 15444 :value nil :post-blank 1 :post-affiliated 14508 :name "subtasks-table" :parent nil)))
  (let* ((sym (org-babel-read-element e))) (if sym (let ((v sym)) (throw :found v)) (error "Reference not found")))
  (cond ((eq val (quote babel-call)) (throw :found (org-babel-execute-src-block nil (org-babel-lob-get-info e) params))) ((eq val (quote src-block)) (throw :found (org-babel-execute-src-block nil nil (and (not org-babel-update-intermediate) params)))) (t (let* ((sym (org-babel-read-element e))) (if sym (let ((v sym)) (throw :found v)) (error "Reference not found")))))
  (let* ((val (org-element-type e))) (cond ((eq val (quote babel-call)) (throw :found (org-babel-execute-src-block nil (org-babel-lob-get-info e) params))) ((eq val (quote src-block)) (throw :found (org-babel-execute-src-block nil nil (and (not org-babel-update-intermediate) params)))) (t (let* ((sym (org-babel-read-element e))) (if sym (let ((v sym)) (throw :found v)) (error "Reference not found"))))))
  (progn (goto-char (org-element-property :post-affiliated e)) (let* ((val (org-element-type e))) (cond ((eq val (quote babel-call)) (throw :found (org-babel-execute-src-block nil (org-babel-lob-get-info e) params))) ((eq val (quote src-block)) (throw :found (org-babel-execute-src-block nil nil (and (not org-babel-update-intermediate) params)))) (t (let* ((sym (org-babel-read-element e))) (if sym (let (...) (throw :found v)) (error "Reference not found")))))))
  (if (equal (org-element-property :name e) ref) (progn (goto-char (org-element-property :post-affiliated e)) (let* ((val (org-element-type e))) (cond ((eq val (quote babel-call)) (throw :found (org-babel-execute-src-block nil (org-babel-lob-get-info e) params))) ((eq val (quote src-block)) (throw :found (org-babel-execute-src-block nil nil (and ... params)))) (t (let* ((sym ...)) (if sym (let ... ...) (error "Reference not found"))))))))
  (let ((e (org-element-at-point))) (if (equal (org-element-property :name e) ref) (progn (goto-char (org-element-property :post-affiliated e)) (let* ((val (org-element-type e))) (cond ((eq val (quote babel-call)) (throw :found (org-babel-execute-src-block nil ... params))) ((eq val (quote src-block)) (throw :found (org-babel-execute-src-block nil nil ...))) (t (let* (...) (if sym ... ...))))))))
  (if (org-in-commented-heading-p) nil (let ((e (org-element-at-point))) (if (equal (org-element-property :name e) ref) (progn (goto-char (org-element-property :post-affiliated e)) (let* ((val (org-element-type e))) (cond ((eq val ...) (throw :found ...)) ((eq val ...) (throw :found ...)) (t (let* ... ...))))))))
  (while (re-search-forward regexp nil t) (if (org-in-commented-heading-p) nil (let ((e (org-element-at-point))) (if (equal (org-element-property :name e) ref) (progn (goto-char (org-element-property :post-affiliated e)) (let* ((val ...)) (cond (... ...) (... ...) (t ...))))))))
  (catch :found (while (re-search-forward regexp nil t) (if (org-in-commented-heading-p) nil (let ((e (org-element-at-point))) (if (equal (org-element-property :name e) ref) (progn (goto-char (org-element-property :post-affiliated e)) (let* (...) (cond ... ... ...))))))) (if (org-babel-ref-goto-headline-id ref) (progn (throw :found (org-babel-ref-headline-body)))) (let ((info (cdr (assq (intern ref) org-babel-library-of-babel)))) (if info (progn (throw :found (org-babel-execute-src-block nil info params))))) (error "Reference `%s' not found in this buffer" ref))
  (let* ((params (append args (quote ((:results . "silent"))))) (regexp (org-babel-named-data-regexp-for-name ref)) (result (catch :found (while (re-search-forward regexp nil t) (if (org-in-commented-heading-p) nil (let (...) (if ... ...)))) (if (org-babel-ref-goto-headline-id ref) (progn (throw :found (org-babel-ref-headline-body)))) (let ((info (cdr ...))) (if info (progn (throw :found ...)))) (error "Reference `%s' not found in this buffer" ref)))) (cond ((symbolp result) (format "%S" result)) ((and index (listp result)) (org-babel-ref-index-list index result)) (t result)))
  (save-restriction (widen) (goto-char (point-min)) (let* ((params (append args (quote ((:results . "silent"))))) (regexp (org-babel-named-data-regexp-for-name ref)) (result (catch :found (while (re-search-forward regexp nil t) (if (org-in-commented-heading-p) nil (let ... ...))) (if (org-babel-ref-goto-headline-id ref) (progn (throw :found ...))) (let ((info ...)) (if info (progn ...))) (error "Reference `%s' not found in this buffer" ref)))) (cond ((symbolp result) (format "%S" result)) ((and index (listp result)) (org-babel-ref-index-list index result)) (t result))))
  (save-excursion (save-restriction (widen) (goto-char (point-min)) (let* ((params (append args (quote (...)))) (regexp (org-babel-named-data-regexp-for-name ref)) (result (catch :found (while (re-search-forward regexp nil t) (if ... nil ...)) (if (org-babel-ref-goto-headline-id ref) (progn ...)) (let (...) (if info ...)) (error "Reference `%s' not found in this buffer" ref)))) (cond ((symbolp result) (format "%S" result)) ((and index (listp result)) (org-babel-ref-index-list index result)) (t result)))))
  (let ((case-fold-search t) args new-refere new-header-args new-referent split-file split-ref index) (if (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((str (substring ref 0 (match-beginning 0)))) (= (cl-count 40 str) (cl-count 41 str)))) (progn (setq index (match-string 1 ref)) (setq ref (substring ref 0 (match-beginning 0))))) (if (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (progn (setq new-refere (match-string 1 ref)) (setq new-header-args (match-string 3 ref)) (setq new-referent (match-string 5 ref)) (if (> (length new-refere) 0) (progn (if (> (length new-referent) 0) (progn (setq args ...))) (if (> (length new-header-args) 0) (progn (setq args ...))) (setq ref new-refere))))) (if (string-match "^\\(.+\\):\\(.+\\)$" ref) (progn (setq split-file (match-string 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-file) (setq ref split-ref))) (save-excursion (save-restriction (widen) (goto-char (point-min)) (let* ((params (append args (quote ...))) (regexp (org-babel-named-data-regexp-for-name ref)) (result (catch :found (while ... ...) (if ... ...) (let ... ...) (error "Reference `%s' not found in this buffer" ref)))) (cond ((symbolp result) (format "%S" result)) ((and index (listp result)) (org-babel-ref-index-list index result)) (t result))))))
  (save-excursion (let ((case-fold-search t) args new-refere new-header-args new-referent split-file split-ref index) (if (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((str (substring ref 0 ...))) (= (cl-count 40 str) (cl-count 41 str)))) (progn (setq index (match-string 1 ref)) (setq ref (substring ref 0 (match-beginning 0))))) (if (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (progn (setq new-refere (match-string 1 ref)) (setq new-header-args (match-string 3 ref)) (setq new-referent (match-string 5 ref)) (if (> (length new-refere) 0) (progn (if (> ... 0) (progn ...)) (if (> ... 0) (progn ...)) (setq ref new-refere))))) (if (string-match "^\\(.+\\):\\(.+\\)$" ref) (progn (setq split-file (match-string 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-file) (setq ref split-ref))) (save-excursion (save-restriction (widen) (goto-char (point-min)) (let* ((params (append args ...)) (regexp (org-babel-named-data-regexp-for-name ref)) (result (catch :found ... ... ... ...))) (cond ((symbolp result) (format "%S" result)) ((and index ...) (org-babel-ref-index-list index result)) (t result)))))))
  (save-current-buffer (set-buffer (or org-babel-exp-reference-buffer (current-buffer))) (save-excursion (let ((case-fold-search t) args new-refere new-header-args new-referent split-file split-ref index) (if (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((str ...)) (= (cl-count 40 str) (cl-count 41 str)))) (progn (setq index (match-string 1 ref)) (setq ref (substring ref 0 (match-beginning 0))))) (if (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (progn (setq new-refere (match-string 1 ref)) (setq new-header-args (match-string 3 ref)) (setq new-referent (match-string 5 ref)) (if (> (length new-refere) 0) (progn (if ... ...) (if ... ...) (setq ref new-refere))))) (if (string-match "^\\(.+\\):\\(.+\\)$" ref) (progn (setq split-file (match-string 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-file) (setq ref split-ref))) (save-excursion (save-restriction (widen) (goto-char (point-min)) (let* ((params ...) (regexp ...) (result ...)) (cond (... ...) (... ...) (t result))))))))
  (progn (save-current-buffer (set-buffer (or org-babel-exp-reference-buffer (current-buffer))) (save-excursion (let ((case-fold-search t) args new-refere new-header-args new-referent split-file split-ref index) (if (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let (...) (= ... ...))) (progn (setq index (match-string 1 ref)) (setq ref (substring ref 0 ...)))) (if (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (progn (setq new-refere (match-string 1 ref)) (setq new-header-args (match-string 3 ref)) (setq new-referent (match-string 5 ref)) (if (> ... 0) (progn ... ... ...)))) (if (string-match "^\\(.+\\):\\(.+\\)$" ref) (progn (setq split-file (match-string 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-file) (setq ref split-ref))) (save-excursion (save-restriction (widen) (goto-char (point-min)) (let* (... ... ...) (cond ... ... ...))))))))
  (unwind-protect (progn (save-current-buffer (set-buffer (or org-babel-exp-reference-buffer (current-buffer))) (save-excursion (let ((case-fold-search t) args new-refere new-header-args new-referent split-file split-ref index) (if (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ... ...)) (progn (setq index ...) (setq ref ...))) (if (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (progn (setq new-refere ...) (setq new-header-args ...) (setq new-referent ...) (if ... ...))) (if (string-match "^\\(.+\\):\\(.+\\)$" ref) (progn (setq split-file ...) (setq split-ref ...) (find-file split-file) (setq ref split-ref))) (save-excursion (save-restriction (widen) (goto-char ...) (let* ... ...))))))) (set-window-configuration wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn (save-current-buffer (set-buffer (or org-babel-exp-reference-buffer (current-buffer))) (save-excursion (let ((case-fold-search t) args new-refere new-header-args new-referent split-file split-ref index) (if (and ... ...) (progn ... ...)) (if (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (progn ... ... ... ...)) (if (string-match "^\\(.+\\):\\(.+\\)$" ref) (progn ... ... ... ...)) (save-excursion (save-restriction ... ... ...)))))) (set-window-configuration wconfig)))
  org-babel-ref-resolve("subtasks-table[2:-1]")

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

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

* Re: problem with babel call with post action
  2017-06-21  5:51   ` Eric S Fraga
@ 2017-06-22  7:30     ` Nicolas Goaziou
       [not found]     ` <7d0fe5cb25c04ee3bc8331ed0138a19f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2017-06-22  7:30 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I think it's a symptom of being lazy and spending way too much time on
> codes to make life easier...  as in "The tale of the man who was too
> lazy to fail" by Robert Heinlein [1].

Thank you for the reference. I hadn't heard about this novel before.

>> I improved babel call arguments parsing. Could you confirm that your
>> wizardry is in order now?
>
> I got further but there's still an error.  See attached debug output.  I
> don't understand as org-table-to-lisp does exist.  I don't think it's a
> configuration problem but...

I don't understand it either. Could you edebug `org-babel-read-table',
or post an ECM? Anyway, this seems unrelated to babel call parsing.

Regards,

-- 
Nicolas Goaziou

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

* Re: problem with babel call with post action
       [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-22 15:32       ` Eric S Fraga
  1 sibling, 2 replies; 8+ messages in thread
From: Eric S Fraga @ 2017-06-22 15:24 UTC (permalink / raw)
  To: emacs-orgmode

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

On Thursday, 22 Jun 2017 at 07:30, Nicolas Goaziou wrote:

[...]

> I don't understand it either. Could you edebug `org-babel-read-table',
> or post an ECM? Anyway, this seems unrelated to babel call parsing.

Hi Nicolas,

I'm not au fait with using edebug.  Will try to learn it (about time,
probably).  In the meantime, here is an ECM which definitely fails for
me with my normal configuration but which almost works with emacs
-Q.  The almost is that the final output looks like this:

#+begin_src org
  ,#+RESULTS:
  ,#+BEGIN_src dot
  [[file:dependency-graph.pdf]]
  ,#+END_src
#+end_src

where I did not expect the wrapping within a src block.

The error using my configuration is

: org-indent-add-properties: Wrong type argument: arrayp, nil

I will try to debug when I get a chance.

Thanks again,
eric

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

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

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

* Re: problem with babel call with post action
       [not found]     ` <7d0fe5cb25c04ee3bc8331ed0138a19f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  2017-06-22 15:24       ` Eric S Fraga
@ 2017-06-22 15:32       ` Eric S Fraga
  1 sibling, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2017-06-22 15:32 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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 --]

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

* Re: problem with babel call with post action
  2017-06-22 15:24       ` Eric S Fraga
@ 2017-06-24 10:05         ` Nicolas Goaziou
       [not found]         ` <307ed99a7a0b43a7b76a79b4c4fb9eb7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2017-06-24 10:05 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I'm not au fait with using edebug.  Will try to learn it (about time,
> probably).  In the meantime, here is an ECM which definitely fails for
> me with my normal configuration but which almost works with emacs
> -Q.  The almost is that the final output looks like this:
>
> #+begin_src org
>   ,#+RESULTS:
>   ,#+BEGIN_src dot
>   [[file:dependency-graph.pdf]]
>   ,#+END_src
> #+end_src
>
> where I did not expect the wrapping within a src block.
>
> The error using my configuration is
>
> : org-indent-add-properties: Wrong type argument: arrayp, nil

I think this was fixed recently. Could you confirm it?

Regards,

-- 
Nicolas Goaziou

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

* Re: problem with babel call with post action
       [not found]         ` <307ed99a7a0b43a7b76a79b4c4fb9eb7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-06-26  9:48           ` Eric S Fraga
  0 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2017-06-26  9:48 UTC (permalink / raw)
  To: emacs-orgmode

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

On Saturday, 24 Jun 2017 at 10:05, Nicolas Goaziou wrote:

[...]

> I think this was fixed recently. Could you confirm it?

Yes, thank you.  Seems to work just fine now!

I had to change my original babel src blocks and remove a ":wrap src
dot" that I had in the intermediate block but otherwise I get the same
behaviour I used to get.

Thanks again,
eric

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612

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

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

end of thread, other threads:[~2017-06-26  9:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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