7

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)
n1k31t4
  • 669
  • 8
  • 18

1 Answers1

15

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.

ryuslash
  • 266
  • 2
  • 3