Alex Bennée <alex.ben...@linaro.org> writes: > Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > >> Hello, >> >> Alex Bennée <alex.ben...@linaro.org> writes: >> >>> So calling scramble-string works as expected... >>> >>> #+tblname: reversed-strings >>> | abcde | #ERROR | >>> >>> | flibble | #ERROR | >>> | dibble | #ERROR | >>> | xyzzy | #ERROR | >>> | another | #ERROR | >>> >>> #+TBLFM: $2='(org-sbe scramble-string (str $$1)) >> >> I cannot reproduce it. I get: > > Hmm it turns out this interferes: > > ;; See > http://emacs.stackexchange.com/questions/499/finding-and-executing-org-babel-snippets-programatically > (defun my-babel-hashed-confirm (lang body) <snip> > > (setq org-confirm-babel-evaluate 'my-babel-hashed-confirm) > > Resetting to org-confirm-babel-evaluate to nil and it works.
So more correctly when org-confirm-babel-evaluate is set it breaks due to info not containing a character position for the TBLFM code. I fixed this by patching org-babel-check-confirm-evaluate: modified lisp/ob-core.el @@ -242,7 +242,8 @@ should be asked whether to allow evaluation." (and export (equal eval "query-export")) (if (functionp org-confirm-babel-evaluate) (save-excursion - (goto-char (nth 5 info)) + (when (nth 5 info) + (goto-char (nth 5 info))) (funcall org-confirm-babel-evaluate ;; language, code block body (nth 0 info) (nth 1 info))) I'm not sure the goto-char is legitimate anyway as the documentation for org-confirm-babel-evaluate says nothing about point being set while it executes. -- Alex Bennée