emacs-orgmode
[Top][All Lists]
Advanced

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

Re: execute elisp link without prompt


From: Colin Baxter
Subject: Re: execute elisp link without prompt
Date: Sat, 22 May 2021 07:02:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

>>>>> Tom Gillespie <tgbugs@gmail.com> writes:

    >> 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


Thanks Tom. I'll try this.

Best wishes,

Colin Baxter.



reply via email to

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