* lisp/ob-exp.el (org-babel-exp-process-buffer): Change variable
name `org-export-babel-evaluate' to `org-export-use-babel'. Also
change the name in its `defcustom' and set the `:safe' key.
* lisp/ox-icalendar.el (org-icalendar-export-current-agenda): Change
variable name.
* lisp/ox.el (org-export-as): Change variable name.
* doc/org.texi (Exporting code blocks): Change variable name. Amplify
the explanation of what the variable does. Add variable index entry.
* testing/lisp/test-ob-exp.el: Change variable name.
* testing/lisp/test-ob-lob.el: Change variable name.
* testing/lisp/test-ox.el: Change variable name.
Users were often confused that setting this variable to `nil' will
cause header arguments to be ignored in addition to preventing code
from being evaluated. It is hoped that the documentation changes and
the name `org-export-use-babel' will better convey that everything
babel does can be switched off with this variable.
* 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.
* test/examples/babel.org: Miscellaneous fixes for new inline src
block schema. Return a scalar to avoid unwanted error. Return a raw
result from `src_emacs-lisp' to make checking results cleaner than
dealing with `results' macro.
* testing/lisp/test-ob-exp.el: Wrap some expected results in
`{{{results(' and ')}}}' and drop `=%s=' formatting of others.
* testing/lisp/test-ob-lob.el: Wrap some expected results in
`{{{results(' and ')}}}'.
* testing/lisp/test-ob.el: Wrap some expected results in `{{{results('
and ')}}}'.
* testing/lisp/test-ob.el
(test-org-babel/org-babel-get-inline-src-block-matches,
test-org-babel/inline-src_blk-results-silent): Tests of inline src
block matches (and `org-ctrl-ctrl-c') conform to the `:begin' and
`:end' properties of `org-element-context'.
* testing/lisp/test-ob.el
(test-org-babel/inline-src_blk-default-results-replace-line-1,
test-org-babel/inline-src_blk-default-results-replace-line-2):
Inline results are self replacing.
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
Replace `cl-letf' with `letf' for compatibility with older Emacsen.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
Also check for 'error since 'user-error is not used by older Emacsen.
* testing/examples/babel.org: Change spaces to dashes in #+name
lines.
* testing/lisp/test-ob-exp.el (org-test-with-expanded-babel-code):
(ob-exp/evaluate-all-executables-in-order):
(ob-exp/exports-inline-code):
(ob-exp/exports-inline):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-exp/use-case-of-reading-entry-properties):
(ob-exp/export-from-a-temp-buffer):
(ob-export/export-with-results-before-block):
(ob-export/export-under-commented-headline):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
* testing/lisp/test-ob.el (test-org-babel/inline-src_blk-default-results-replace-line-1):
(test-org-babel/inline-src_blk-default-results-replace-line-2):
(test-org-babel/inline-src_blk-manual-results-replace):
(test-org-babel/inline-src_blk-results-scalar):
(test-org-babel/inline-src_blk-results-verbatim):
(test-org-babel/inline-src_blk-preceded-punct-preceded-by-point):
* testing/lisp/test-ox.el (test-org-export/export-scope):
Bind ‘org-babel-inline-result-wrap’ and/or ‘org-export-babel-evaluate’
so tests work when users have customized these variables.
* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
Add ‘org-trim’ where an extra newline was creeping in.
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
Neutralize org-babel-insert-result, which was stomping on the buffer
contents and disrupting the test
* testing/lisp/test-org-element.el (test-org-element/block-switches):
Replace (should (and ...)) with multiple (should ...). This gives
more precise indications of what is wrong when a test fails.
(test-org-element/link-parser): Require org-docview.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
Add the error type for ‘should-error’.
* testing/lisp/test-ox.el (test-org-export/set-title):
(test-org-export/handle-options):
(test-org-export/with-timestamps):
(test-org-export/comment-tree):
(test-org-export/handle-inlinetasks): Let
‘org-export-filter-body-functions’ and
‘org-export-filter-final-output-functions’ to nil where an empty
string is the expected result. ‘org-export-filter-apply-functions’
treats an empty string as special, and changes it to nil. This
creates test failures when the user has customized these variables.
* testing/org-test.el (org-test-with-temp-text): Let ‘org-mode-hook’
to nil.
(org-test-table-target-expect): Require ert since this function calls
some of its should* functions.
* lisp/ob-core.el (org-babel-exp-reference-buffer): New variable, as
a replacement for `org-current-export-file'.
(org-babel-check-confirm-evaluate): Use new variable.
* lisp/ob-exp.el (org-babel-exp-in-export-file): Use new variable.
(org-babel-exp-get-export-buffer): Remove function.
(org-babel-exp-process-buffer): Change signature.
* lisp/ob-ref.el (org-babel-ref-resolve): Use new variable during
export in order to properly resolve references.
* lisp/ox.el (org-export-execute-babel-code): Use new variable.
* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
Remove a cond branch as it is always
false (`org-current-export-file' couldn't be a string).
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines): Update
test.
* testing/lisp/test-ob.el (test-ob/eval-header-argument): Update test.
* testing/lisp/test-ob-exp.el (ob-export/reference-in-post-header):
New test.
During export, Babel executes sequentially all blocks in the buffer
being exported. This can lead to modifications preventing some
references from being resolved. As a workaround, Babel stores
a pristine copy of the buffer in a variable so it can always find
needed references.
Before this patch, the variable storing this copy was
`org-current-export-file' and was dynamically bound in "ox.el". It
was used to resolve noweb references (`org-babel-expand-noweb-references')
but not regular references (`org-babel-ref-resolve').
Now, the variable is `org-babel-exp-reference-buffer' and it is bound
from `org-babel-exp-process-buffer'. It is used to resolve all
references. In particular, this allows to use references in :post
header.
Thanks to Jarmo Hurri for reporting it.
* 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-exp.el (org-babel-exp-process-buffer): Renamed from
`org-export-blocks-preprocess'.
* lisp/ox.el (org-export-execute-babel-code): Apply previous renaming.
* testing/org-test.el (org-test-at-id): Make sure the function returns
the value of the last form in its body.
* testing/lisp/test-ob-exp.el: Fix tests.
* testing/lisp/test-ob-lob.el: Fix tests.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.
This commit also bumps the version number to 7.8.06.
The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.
This commit reverts back the maint branch to its state before
merging the master branch. From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
* lisp/ob-exp.el (org-babel-exp-lob-one-liners): Don't limit
in-verbatim check to inline code blocks, do lob code blocks as well.
* testing/lisp/test-ob-lob.el (test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export):
Test ensuring that #+call lines in verbatim blocks are not evaluated
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Also check for in
verbatim emphasis.
(org-babel-exp-lob-one-liners): Cleaner checking for escaped call
lines.
Thanks to Charles C. Berry for insisting on this issues existence
This change is now secured with a unit test
* lisp/ob.el (org-babel-parse-header-arguments): Stripping trailing
spaces off of header arguments (even the first one).
* lisp/ob-lob.el (org-babel-lob-execute): now expanding variable
references before execution
* lisp/ob.el (org-babel-merge-params): better indentation, and finally
sorted out the proper replacement of conflicting variable
definitions
ob-get-src-block-info wasn't correctly returning the name of the
code block
* lisp/ob-lob.el (org-babel-lob-ingest): now returns the count of
ingested code blocks
* lisp/ob.el (org-babel-get-src-block-info): walks up possible
additional header arg lines before checking for the code block name
(org-babel-merge-params): can now handle empty variables gracefully