On 12/12/2022 03:27, Tom Gillespie wrote:
#+begin_src elisp :results none (setq-local org-confirm-babel-evaluate-cell (lambda (lang body) (ignore lang) (let ((rb (read body))) (not ; aka (unless condition t) (or (member rb '((or) (and) ;; add more forms that are known safe here ))
Thank you, Tom. At first I thought you managed to define a function that treats particular directories as safe (to discriminate own files and files having non-trusted origins). However in such case you would not need additional user option and `org-confirm-babel-evaluate' would be enough.
Walking through the passed expression to prove that it has no side effects is an interesting and challenging problem.
And frankly speaking, I was confused and believed that it is responsibility of the new function to issue e.g. `yes-or-no-p' prompt. Now I see that it is `org-babel-confirm-evaluate' that shows such prompt.