* lisp/ob-core.el (org-babel-execute-src-block): Fix behaviour of
":dir path" when ":mkdirp" is not defined.
* testing/lisp/test-ob.el (test-ob-core/dir-mkdirp): Add a test case.
TINYCHANGE
* lisp/ob-core.el (org-babel-execute-src-block): Make directory if
":dir path" does not exist when ":mkdirp yes" exist.
* doc/org-manual.org (Header arguments): Document it.
* testing/lisp/test-ob.el: Add a specific testing file for ob-core.el,
and add a testing for ":mkdir yes" work with :dir header argument
usage.
* lisp/ob-core.el (org-babel--string-to-number): Fix the regular expression.
* testing/lisp/test-ob.el (test-ob/string-to-number): Test cases.
If people write the data in the form "0001"", it means that he wants to
treat it as a string.
TINYCHANGE
> #+name: TBL
> | id | name | age |
> |------|--------|-----|
> | 0001 | Apollo | 16 |
> | 0002 | Bmw | 16 |
>
> #+BEGIN_SRC emacs-lisp :results value pp :var tbl=TBL
> (mapc 'print tbl)
> #+END_SRC
>
> #+RESULTS:
> : (("0001" "Apollo" 16)
> : ("0002" "Bmw" 16))
TINYCHANGE
* lisp/ob-core.el (org-babel-execute-src-block): ":results file" must
be specified in order to return a file.
(org-babel-merge-params): :file and :file-ext no longer imply :results
file.
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
(test-ob/result-file-link-type-header-argument):
(test-ob/result-graphics-link-type-header-argument): Update tests.
Deducing the results from some other arguments is not obvious.
Moreover, it prevents users from setting, e.g., :file-ext, in a node
property, as every block would then create a file.
Reported-by: Alex Fenton <alex@pressure.to>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00469.html>
* lisp/ob-core.el (org-babel-execute-src-block): Handle "link" :results
format.
* doc/org-manual.org: Add document for new result format "link".
* testing/lisp/test-ob.el (test-ob/result-file-link-type-header-argument):
New test.
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-list):
Removed the inner list. Expectation "- (quote (4 5))" did not match
the result "- '(4 5)". I think this difference is not worth testing
in this test.
* lisp/ob-core.el (org-babel-expand-noweb-references): Get :noweb-ref
from definition instead of point of call.
* testing/lisp/test-ob.el (test-ob/noweb-expansion-1):
(test-ob/noweb-expansion-2): Merge tests. Add test.
* lisp/ob-core.el (org-babel-use-quick-and-dirty-noweb-expansion):
Remove variable.
(org-babel-expand-noweb-references): Update function.
* doc/org.texi (noweb-ref): Document new behaviour.
(Noweb reference syntax): Delete reference to removed variable.
`org-babel-use-quick-and-dirty-noweb-expansion' main use is to speed
up Noweb expansion when expanding only by name. By distinguishing
name and reference expansion, we no longer need this variable. In the
first case, the expansion is quicker anyway, and in the second case,
we most certainly need an accurate expansion.
* lisp/ob-core.el (org-babel-examplify-region): Escape Org syntax
before wrapping it.
* testing/lisp/test-ob.el (test-ob/org-babel-insert-result): Add test.
Renamed from `test-ob/org-babel-insert-result--improper-lists'.
Reported-by: D M German <dmg@turingmachine.org>
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
Use `expand-file-name' to prevent introducing "//" patterns in file
name.
Reported-by: David Talmage <david.talmage@shoutpoint.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110285>
* lisp/ob-core.el (org-babel--insert-results-keyword):
(org-babel-where-is-src-block-result): Control better the number of
empty lines around results of a source block evaluation.
* testing/lisp/test-ob.el (test-ob/blocks-with-spaces): Add tests.
(test-ob/specific-colnames): Fix test.
* lisp/ob-core.el (org-babel--normalize-body): New function.
(org-babel-get-src-block-info): Use new function.
* lisp/org-src.el (org-src-coderef-regexp): New function.
* lisp/ox.el (org-export-unravel-code): Use new function.
* testing/lisp/test-ob.el (test-ob/evaluate-body-with-coderefs): New
test.
* lisp/ob-core.el (org-babel-goto-named-src-block): The user prompt
(i.e. `initial-input' arg of `completing-read') will be the name of
the results block, noweb reference, call reference, or symbol if
point is in such.
* testing/lisp/test-ob.el (test-ob/goto-named-src-block): Simulate
interactive use of `org-babel-goto-named-src-block'.
* lisp/ob-core.el (org-babel-where-is-src-block-result): Return nil when
anonymous results would be located outside of the container of the
source block.
* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): Add test.
Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105309>
* lisp/ob-core.el (org-babel-where-is-src-block-result): Find results
for inline src-blocks or inline babel call not located on a subsequent
line, e.g., because of filling.
(org-babel-insert-result): When inline results exist, replace them
in-place.
(org-babel-remove-inline-result): Also remove results not located on the
same line as the source code.
(org-babel-examplify-region): Change signature. Properly mark inline
results at the beginning of a line.
* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
Add tests.
* lisp/ob-core.el (org-babel-get-inline-src-block-matches): Remove
function.
(org-babel-when-in-src-block):
(org-babel-insert-result): Do not use removed function.
(org-babel-remove-inline-result): Add an optional argument for a tiny
speed-up.
* testing/examples/babel.org:
* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
Remove needless tests.
* lisp/ob-core.el (org-babel-get-src-block-info): Rewrite function.
Change signature.
(org-babel-parse-src-block-match):
(org-babel-parse-inline-src-block-match): Remove functions.
(org-babel-execute-src-block): Remove useless function call.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Make use of signature
change.
(org-babel-exp-results): Use new return value from
`org-babel-get-src-block-info'. Tiny refactoring.
* testing/lisp/test-ob.el (test-ob/nested-code-block): Fix test.
* contrib/lisp/org-eldoc.el (org-eldoc-get-src-lang): Use parser instead
of removed function.
* testing/examples/babel.org: Fix test environment.
* 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--insert-results-keyword):
(org-babel--clear-results-maybe): New functions.
(org-babel-where-is-src-block-result): Rewrite function. Improve
accuracy, in particular when RESULTS is not the closest affiliated
keyword from the results.
* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): New test.
* testing/examples/ob-C-test.org:
* testing/examples/ob-fortran-test.org:
* testing/examples/ob-maxima-test.org:
* testing/lisp/test-ob-python.el (test-ob-python/colnames-yes-header-argument-again):
(test-ob-python/colnames-no-header-argument-again):
* testing/lisp/test-ob.el (test-ob/do-not-resolve-to-partial-names-data):
Use NAME instead of TBLNAME.
TBLNAME is deprecated syntax since Org 8.
* lisp/ob-core.el (org-babel-find-named-result): Prevent false positive
using parser.
(org-babel-current-result-hash):
(org-babel-set-current-result-hash):
(org-babel-where-is-src-block-result): Do not rely on some undocumented
match data.
* testing/lisp/test-ob.el (test-ob/find-name-result): New test.