From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: Re: problem with babel call with post action
Date: Wed, 21 Jun 2017 06:51:01 +0100 [thread overview]
Message-ID: <878tkllwhm.fsf@t3610> (raw)
In-Reply-To: <7f25f31c2d8946deb9f1ac6d35fede98@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Nicolas Goaziou's message of "Tue, 20 Jun 2017 19:23:25 +0000")
[-- 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 --]
next prev parent reply other threads:[~2017-06-21 5:51 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 [this message]
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
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878tkllwhm.fsf@t3610 \
--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 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).