emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [BUG] [PATCH] org-babel-execute-buffer: Prevent executing non-code b


From: Ihor Radchenko
Subject: Re: [BUG] [PATCH] org-babel-execute-buffer: Prevent executing non-code blocks [9.6.20 ( @ /home/cassou/.emacs.d/lib/org/lisp/)]
Date: Tue, 12 Mar 2024 12:18:53 +0000

Damien Cassou <damien@cassou.me> writes:

> The command `org-babel-execute-buffer' tries to execute all source code
> blocks of the current buffer. When it encounters a block that is not
> executable the command crashes. The attached patch makes the command ignore
> non-executable blocks and move on.
> ...
> -        (org-babel-execute-src-block arg)))))
> +        (let* ((info (org-babel-get-src-block-info))
> +               (lang (nth 0 info))
> +               (cmd (intern (concat "org-babel-execute:" lang))))
> +          (when (fboundp cmd)
> +            (org-babel-execute-src-block arg)))))))

Thanks for the patch, but it is not obvious that skipping src blocks
that cannot be executed is always a good idea.
Consider, for example, that some blocks are used as input for other
blocks. Then, failing to execute them means that other blocks may have
unpredictable side effects.

May you please provide a concrete use-case when skipping some src code
blocks is desired?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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