[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Babel evaluation: location and timing information (v2)
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] Babel evaluation: location and timing information (v2) |
Date: |
Sat, 24 Sep 2022 11:11:03 +0800 |
Timothy <orgmode@tec.tecosaur.net> writes:
> * lisp/ob-core.el (org-babel-execute-src-block,
> org-babel-format-result): Record the babel execution time, and then
> supplement the "Code block evaluation complete." (etc.) messages with
> the execution time when >0.05s.
I'd also mention the new optional arguments.
> -(defun org-babel-execute-src-block (&optional arg info params)
> +(defun org-babel-execute-src-block (&optional arg info params executor)
> "Execute the current source code block and return the result.
> Insert the results of execution into the buffer. Source code
> execution and the collection and formatting of results can be
> @@ -729,13 +729,31 @@ (defun org-babel-execute-src-block (&optional arg info
> params)
>
> Optionally supply a value for PARAMS which will be merged with
> the header arguments specified at the front of the source code
> -block."
> +block.
> +
> +EXECUTOR is the type of the org element responsible for the
> +execution of the source block. If not provided then this is
> +inferred to be a source block or inline source block, inspecting
> +the buffer content at the block location to determine which."
This argument name executor sounds awkward. Why not something like
src-block-type?
> + (executor
> + (or executor
> + ;; If `executor' is unset, then this cannot be a babel
> + ;; call (as `org-babel-lob-execute-maybe' provides the
> + ;; type of the execution triggering element) and so this
> + ;; must be an inline src block or src block. We can
> + ;; easily pick between the two by just looking at the
> + ;; first character of each case. In case something
> + ;; strange happens, this can be set to unknown.
This comment is confusing. From my reading of it, you only consider
internal usage of `org-babel-execute-src-block' in Org code. But
`org-babel-execute-src-block' is not an internal function and hence we
cannot assume the callers.
I think that it is sufficient to stick to what the docstring says about
nil EXECUTOR value.
--
Ihor Radchenko,
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
- Re: [PATCH] Babel evaluation: location and timing information, (continued)
Re: [PATCH] Babel evaluation: location and timing information, Ihor Radchenko, 2022/09/20
Re: [PATCH] Babel evaluation: location and timing information (v2), Timothy, 2022/09/23
- Re: [PATCH] Babel evaluation: location and timing information (v2),
Ihor Radchenko <=