[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Table (used a "spreadsheet") org-sbe issues when the value is a
From: |
Alex Bennée |
Subject: |
Re: [O] Table (used a "spreadsheet") org-sbe issues when the value is a string |
Date: |
Thu, 07 Sep 2017 16:21:26 +0100 |
User-agent: |
mu4e 0.9.19; emacs 25.2.50.3 |
Alex Bennée <address@hidden> writes:
> Nicolas Goaziou <address@hidden> writes:
>
>> Hello,
>>
>> Alex Bennée <address@hidden> 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