From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Don't ask, don't run Date: Sun, 10 Jul 2011 09:08:23 -0600 Message-ID: <87r55yruyu.fsf@gmail.com> References: <87sjqg4jiq.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfwMF-0003iA-8s for emacs-orgmode@gnu.org; Sun, 10 Jul 2011 11:55:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfwMC-0007GA-Qq for emacs-orgmode@gnu.org; Sun, 10 Jul 2011 11:55:46 -0400 Received: from mail-pz0-f41.google.com ([209.85.210.41]:51796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfwMC-0007Fz-Dk for emacs-orgmode@gnu.org; Sun, 10 Jul 2011 11:55:44 -0400 Received: by pzk4 with SMTP id 4so2945138pzk.0 for ; Sun, 10 Jul 2011 08:55:42 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Eric S Fraga writes: > writes: > >> Hi, >> >> I know from the manual that I can set 'org-confirm-babel-evaluate' to t, >> or nil, or a function, to control whether I'm asked permission to run a >> code block. >> >> However, that only gives me two choices - ask the user, or pretend the >> user said "yes". Sometimes I'd like to pretend the user said "no", >> without asking. >> >> Specifically, I'd like to always manually control when code blocks are >> executed. When exporting, I don't want them executed (and I don't want to >> be asked about my dozens of blocks each time). When hitting C-c C-c >> manually, I just want it to run (and I don't want to be asked whether I'm >> sure). >> >> Is there a similar variable, or perhaps an export option, that will give >> me this kind of workflow? >> >> Thanks. > > I can't help you directly although I also often want the behaviour you > are describing. One workaround that should give you what you want is to > enable evaluation without prompting (org-confirm-babel-evaluate: nil) > and to have the results from runs cached so that, when exporting, the > source code blocks shouldn't have to execute; see [[info:org#cache]]. There is no way to customize `org-confirm-evaluate' to achieve this behavior, however it can be accomplished through creative use of the :eval header argument, by using the `org-export-current-backend' variable to inhibit evaluation during export. #+begin_src emacs-lisp :eval (if org-export-current-backend "never" "yes") :exports results (message "launch missles") #+end_src Best -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/