8

I only want to turn off the warnings for certain source block languages.

I couldn't find an answer to this anywhere, only how to turn off the confirmation requests for all languages:

(setq org-confirm-babel-evaluate nil) 

This is a super easy question for someone who knows e-lisp. It should be included with the documentation in my opinion, but there is only one language in the example.

How can I extend this to include more languages?

(defun my-org-confirm-babel-evaluate (lang body) (not (string= lang "ditaa"))) ; don't ask for ditaa (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) 
1
  • Disclaimer: I didn't try it: (member* "python" '("ditaa" "python") :test 'string=). Commented Mar 21, 2016 at 8:28

1 Answer 1

16

While I personally don't use babel much, going from the example, this should simply be:

(defun my-org-confirm-babel-evaluate (lang body) (not (member lang '("C" "clojure" "sh")))) (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) 

Where C, clojure and sh should be replaced by the languages you don't want the confirmation for.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.