From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Welle Subject: Re: Table formula from code block Date: Wed, 25 Jan 2017 15:19:33 +0100 Message-ID: <8737g72pe2.fsf@luisa.c0t0d0s0.de> References: <87ziighlqi.fsf@pinto.chemeng.ucl.ac.uk> <87a8aghedy.fsf@pinto.chemeng.ucl.ac.uk> <3b626627d0e74bd69bcf3a7941acf9f8@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <871svsjv0b.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWP6K-0000UL-9E for emacs-orgmode@gnu.org; Wed, 25 Jan 2017 10:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWP6F-0003Wy-EG for emacs-orgmode@gnu.org; Wed, 25 Jan 2017 10:03:08 -0500 Received: from mout.gmx.net ([212.227.15.18]:50789) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cWP6F-0003We-3g for emacs-orgmode@gnu.org; Wed, 25 Jan 2017 10:03:03 -0500 Received: from stella.c0t0d0s0.de ([141.99.200.222]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lbujs-1c6vhY1sJw-00jFrX for ; Wed, 25 Jan 2017 16:03:00 +0100 Received: from Stella (stella.c0t0d0s0.de [192.168.42.1]) by stella.c0t0d0s0.de (Postfix) with ESMTP id 24B66C45FC for ; Wed, 25 Jan 2017 15:19:33 +0100 (CET) In-Reply-To: <871svsjv0b.fsf@delle7240.chemeng.ucl.ac.uk> (Eric S. Fraga's message of "Tue, 24 Jan 2017 16:13:56 +0000") 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: emacs-orgmode@gnu.org Hello, Eric S Fraga writes: > On Tuesday, 24 Jan 2017 at 14:14, Michael Welle wrote: >> ohschockschwerenot, I found it. I set org-confirm-babel-evaluate to a >> function that does look at the body of the code block and then decides >> if it should be executed without confirmation or not. >> >> I'm not sure, why that is a problem. In the case of the examples, the >> function returns t and that is the default value of o-c-b-evaluate. > > Interesting. I cannot help with this but I would be quite interested in > seeing your function in case it's something I could use! Would it be > possible to share? it's quite a hack. I don't want Org to evaluate source code blocks without confirmation. This could lead to all sorts of trouble. On the other hand, there are a few source code blocks, that I want to eval without confirmation. So I use this: (defun hmw/org-post-publish-export-confirm-evaluate (lang body) (not (string-match "^#post publish exporter" body))) (setq org-confirm-babel-evaluate 'hmw/org-post-publish-export-confirm-evaluate) A source code block looks like follows: #+BEGIN_SRC shell :exports results :shebang #!/bin/sh :var SRCDIR=(expand-file-name (plist-get plist :base-directory)) :var DESTDIR=(expand-file-name (plist-get plist :publishing-directory)) #post publish exporter ( echo "Starting esxwithforeman.org $(date)" cd ${SRCDIR} .... echo "Finish esxwithforeman.org $(date)" ) >> /tmp/c0t0d0s0_publish.log 2>&1 #+END_SRC As you can see, this is not a security feature, esp. now that I published it ;). Regards hmw