emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Don't ask, don't run
Date: Sun, 10 Jul 2011 09:08:23 -0600	[thread overview]
Message-ID: <87r55yruyu.fsf@gmail.com> (raw)
In-Reply-To: 87sjqg4jiq.fsf@ucl.ac.uk

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> <Ken.Williams@thomsonreuters.com> 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/

  reply	other threads:[~2011-07-10 15:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 19:19 Don't ask, don't run Ken.Williams
2011-07-08 20:14 ` Eric S Fraga
2011-07-10 15:08   ` Eric Schulte [this message]
2011-07-11 15:19     ` Ken Williams
2011-07-11 17:51       ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r55yruyu.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).