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: Wed, 06 Sep 2017 22:46:00 +0100 Message-ID: <87d173mrfr.fsf@linaro.org> References: <35a64fca-7d01-b382-15f0-568d93af4f61@fgiasson.com> <87k2hgakna.fsf@saiph.selenimh> <87efrjn8pu.fsf@linaro.org> <87fubzajnu.fsf@nicolasgoaziou.fr> 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]:41791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpi9A-0004LN-5F for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 17:46:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpi95-0004RA-Tm for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 17:46:08 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:33249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpi95-0004Qo-Ls for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 17:46:03 -0400 Received: by mail-wm0-x233.google.com with SMTP id f145so18839633wme.0 for ; Wed, 06 Sep 2017 14:46:03 -0700 (PDT) In-reply-to: <87fubzajnu.fsf@nicolasgoaziou.fr> 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 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) "Check against known hashes before prompting for confirmation. See `org-confirm-babel-evaluate'." (let ((check (list lang (md5 body)))) ;; If not hashed, prompt (if (not (member check my-org-babel-hashes)) ;; Ask if you want to hash (if (yes-or-no-p "Store hash for block? ") ;; Hash is added, proceed with evaluation (progn (add-to-list 'my-org-babel-hashes check) 'nil) ;; Return 't to prompt for evaluation 't) (message "Valid hash auto-confirmed") 'nil))) (setq org-confirm-babel-evaluate 'my-babel-hashed-confirm) Resetting to org-confirm-babel-evaluate to nil and it works. > > #+name: reversed-strings > | abcde | edcba | > | flibble | elbbilf | > | dibble | elbbid | > | xyzzy | yzzyx | > | another | rehtona | > #+TBLFM: $2='(org-sbe scramble-string (str $$1)) > >> Even calling org-sbe directly from a source block: >> >> #+name: call-scramble-string-via-sbe >> #+begin_src emacs-lisp :var val="thing" >> >> (org-sbe scramble-string (str val)) >> #+end_src > > AFAIK, `org-sbe' is limited to tables. I was trying to replicate the way TBLFM compiles the macro. > > Regards, -- Alex Bennée