* lisp/ob-core.el (org-babel-params-from-properties): Do not force
using `org-babel-current-src-block-location'. Extract properties
from point.
(org-babel--noweb-reference): Remove function.
(org-babel-expand-noweb-references): Apply function removal. Small
refactoring.
* lisp/ob-lob.el (org-babel-lob-get-info): Small refactoring.
* lisp/ob-lob.el (org-babel-default-lob-header-args): Change value.
(org-babel-lob--src-info): Ignore `org-babel-default-lob-header-args'.
(org-babel-lob-get-info): Header arguments in
`org-babel-default-lob-header-args' have precedence over those inherited
from the original source block.
* lisp/ob-lob.el (org-babel-lob-files): Remove variable.
(org-babel-library-of-babel): Fix docstring.
Since its creation, `org-babel-lob-files' has been a no-op. Since no-one
noticed it during those 7 years, it can safely be removed.
Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/107824>
* lisp/ob-lob.el (org-babel-default-lob-header-args): Merge value with
`org-babel-default-header-args' since this variable is meant to
replace the latter.
(org-babel-lob-ingest): Make sure `org-babel-default-lob-header-args' is
used instead of `org-babel-default-header-args'.
(org-babel-lob--src-info): New function.
(org-babel-lob-get-info): Use new function. Make return value
a replacement for `org-babel-get-src-block-info'.
(org-babel-lob-execute): Use `org-babel-execute-src-block' instead of
duplicating functionalities.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply changes to
`org-babel-lob-get-info' return value.
* testing/examples/ob-header-arg-defaults.org:
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/caching-call-line):
(test-ob-lob/named-caching-call-line): Update tests.
The purpose of this commit is to make Babel calls more
predictable (e.g., wrt property inheritance) and to remove code
duplication. Also, Babel calls results are no longer treated as Emacs
Lisp values.
* lisp/ob-lob.el (org-babel-lob-get-info): Make the function on par with
`org-babel-get-src-block-info' by providing the beginning position of
Babel code.
(org-babel-lob-execute):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Handle new data.
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp):
(org-babel-inline-lob-one-liner-regexp):
(org-babel-lob-one-line-regexp):
* lisp/ob-core.el (org-babel-inline-src-block-regexp): Remove variables.
(org-babel-map-inline-src-blocks):
(org-babel-map-call-lines):
(org-babel-map-executables):
(org-babel-execute-buffer):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
(org-babel-exp-results): Do not use removed variables.
Babel now mostly uses the parser to handle Babel code. Regexps are not
needed anymore.
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Remove function.
* testing/lisp/test-ob.el (test-ob/combining-scalar-and-raw-result-types):
Update test.
This function is unused and inaccurate. If needed, the parser should be
used instead.
* lisp/ob-core.el (org-babel-get-src-block-info): Do not return block
indentation.
(org-babel-parse-src-block-match): Ignore block indentation.
(org-babel-demarcate-block): Find appropriate indentation instead of
using the one from the original block.
(org-babel-where-is-src-block-result): Change signature. Indent
according to context instead of relying on indentation from original
block.
(org-babel-insert-result): Change signature.
(org-babel-check-confirm-evaluate):
(org-babel-execute-src-block):
(org-babel-insert-header-arg): Apply change to src-block info.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply change to
src-block info.
* lisp/ob-lob.el (org-babel-lob-get-info): Do not return indentation.
(org-babel-lob-execute): Apply change to lob-info.
Indentation from source block is often wrong at the block and its
results may not be in the same context.
* lisp/ob-core.el (org-babel-goto-named-src-block): Use parser instead
of `org-babel-lob-one-liner-regexp'.
* lisp/ob-lob.el (org-babel-lob-execute-maybe): Ignore spurious check,
now handled by the parser.
(org-babel-lob-get-info): Fully use parser. Accept a new optional
argument to avoid parsing the same location twice.
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-ref.el (org-babel-ref-resolve): Optimize call to
`org-babel-lob-get-info'.
* lisp/ob-lob.el (org-babel-lob-execute): Do not use defun subseq from
cl at runtime. Replace concatenation of sub-sequences by splicing
the modified params list into a copy of info (pre-must info be
preserved).
* lisp/ob-core.el (org-babel-current-result-hash): Additional info
argument so that named call line results may be found.
(org-babel-set-current-result-hash): Additional info argument so
that named call line results may be found.
* lisp/ob-lob.el (org-babel-lob-execute): Passing info to hash finding
functions so that named results may be found.
* lisp/ob-core.el (org-babel-find-named-result): Call lines are not
results.
(org-babel-where-is-src-block-result): Don't implicitly name the
results of call lines.
* lisp/ob-exp.el (org-babel-exp-non-block-elements): There is now
another element on the call line info list.
* lisp/ob-lob.el (org-babel-lob-get-info): Return the name (if any)
at the end of the info list.
(org-babel-lob-execute): Pass the name through to execution.
The `org-babel-params-from-properties' command was calling
`org-babel-merge-params', the output of which was then being fed back
to another call to `org-babel-merge-params'. The merge params
function is not designed to allow this form of recursive calling, and
as a result many variables were being set to empty values.
The first noticed side effect of this bug was the breakage of the
org-babel-load-file command, which relies on default header
arguments (namely :tangle), which were overwritten by the bug above.
The fix involved having the `org-babel-params-from-properties'
function return a list of alists, which may then all be handed to the
top-level merge-params call.
* lisp/ob-core.el (org-babel-params-from-properties): Now returns a list
of alists and does *not* call `org-babel-merge-params'.
(org-babel-parse-src-block-match): Handle new list of lists output of
`org-babel-params-from-properties'.
(org-babel-parse-inline-src-block-match): Handle new list of lists
output of `org-babel-params-from-properties'.
* lisp/ob-exp.el (org-babel-exp-src-block): Handle new list of lists
output of `org-babel-params-from-properties'.
(org-babel-exp-non-block-elements): Handle new list of lists output of
`org-babel-params-from-properties'.
* lisp/ob-lob.el (org-babel-lob-execute): Handle new list of lists
output of `org-babel-params-from-properties'.
* lisp/ob-exp.el (org-babel-exp-results): Suppress user confirmation
of the emacs-lisp wrapper execution around a lob call.
* lisp/ob-lob.el (org-babel-lob-execute): Suppress user confirmation
of the emacs-lisp wrapper execution around a lob call.