emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable


From: Max Nikulin
Subject: Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable
Date: Tue, 13 Dec 2022 23:15:06 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]