Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I disable the security confirmation for certain languages in org-mode src blocks?

Tags:

emacs

org-mode

I've written my own little language for displaying trees - it's just some string-replacement for tkiz-qtree. Can I somehow disable the security questions for that language? I'm developing a habit to hit y 6 times when exporting.

like image 732
Reactormonk Avatar asked Dec 07 '25 13:12

Reactormonk


1 Answers

As it's written in org manual :

User Option: org-confirm-babel-evaluate
When t (the default), the user is asked before every code block evaluation. When nil, the user is not asked. When set to a function, it is called with two arguments (language and body of the code block) and should return t to ask and nil not to ask.

So just set this variable to nil if you trust your source code blocks.

You can disable the message for your language:

(defun my-org-confirm-babel-evaluate (lang body)
    (not (string= lang "tkiz")))  ; don't ask for tkiz
(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
like image 53
Oleg Pavliv Avatar answered Dec 10 '25 15:12

Oleg Pavliv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!