[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: execute elisp link without prompt
From: |
Tom Gillespie |
Subject: |
Re: execute elisp link without prompt |
Date: |
Fri, 21 May 2021 15:01:03 -0700 |
> In the end I've set as to nil as a local variable
If you want something a bit more secure you could use a function that
checks the block name ("some-block" in this example). Best!
Tom
(lambda (_lang _body)
(not
(string= "some-block"
(plist-get (cadr (org-element-at-point)) :name))))
#+begin_src elisp
(setq-local
org-confirm-babel-evaluate
(lambda (_lang _body)
(not
(string= "some-block"
(plist-get (cadr (org-element-at-point)) :name)))))
#+end_src
#+name: some-block
#+begin_src elisp
(message "yay!")
#+end_src
#+RESULTS: some-block
: yay!
#+name: some-other-block
#+begin_src elisp
(message "I ask to run")
#+end_src
#+RESULTS: some-other-block
: I ask to run