From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Re: Table (used a "spreadsheet") org-sbe issues when the value is a string Date: Thu, 07 Sep 2017 16:21:26 +0100 Message-ID: <87a826mt55.fsf@linaro.org> References: <35a64fca-7d01-b382-15f0-568d93af4f61@fgiasson.com> <87k2hgakna.fsf@saiph.selenimh> <87efrjn8pu.fsf@linaro.org> <87fubzajnu.fsf@nicolasgoaziou.fr> <87d173mrfr.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpyca-0007yR-Tt for emacs-orgmode@gnu.org; Thu, 07 Sep 2017 11:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpycV-0003mD-TR for emacs-orgmode@gnu.org; Thu, 07 Sep 2017 11:21:36 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:35550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpycV-0003jc-LH for emacs-orgmode@gnu.org; Thu, 07 Sep 2017 11:21:31 -0400 Received: by mail-wm0-x229.google.com with SMTP id f199so1058035wme.0 for ; Thu, 07 Sep 2017 08:21:28 -0700 (PDT) In-reply-to: <87d173mrfr.fsf@linaro.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Frederick Giasson Alex Bennée writes: > Nicolas Goaziou writes: > >> Hello, >> >> Alex Bennée 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) > > (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