* lisp/org-element.el (org-element-secondary-p): New function.
* lisp/ox.el (org-export-get-previous-element,
org-export-get-next-element): Use new function.
* testing/lisp/test-org-element.el (test-org-element/secondary-p): New
test.
* mk/default.mk: Add default for new variable BTEST_RE to select all
tests. (BTEST_OB_LANGUAGES): Remove sh (always needed, as
emacs-lisp) and add comment for ruby. (BTEST): Use BTEST_RE to
select tests from the test suite. Reorganize pre-loading of Org,
Babel, Ox and babel languages into a known clean environment.
* mk/targets.mk (CONF_TEST): Add BTEST_RE to the output of
config-test.
* testing/org-batch-test-init.el: New file. Remove all traces of any
Org built into Emacs or otherwise present in the environment so it
can not be picked up spuriously during testing or conceal errors in
the Org version under test.
* testing/org-test.el (org-test-run-batch-tests): Showtest selection
in messages. (org-test-run-all-tests): Update ID locations.
* testing/org-test.el (org-test-with-temp-text,
org-test-with-temp-text-in-file): Correct quoting of macro
expansion.
Macro arguments must not be used during macro expansion since they are
not available at that time; conversely, bindings established during
macro expansion generally can not be used at macro execution
time (unless un-quoted during expansion).
* lisp/org.el (org-clock-string, org-closed-string)
(org-deadline-string, org-scheduled-string)
(org-archive-tag, org-comment-string, org-quote-string)
(org-effort-property, org-latex-regexps): Turn variables into
constants.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-ox.el: Update tests.
Also collect all syntax related constants in the same part of the
file.
* lisp/org-element.el (org-element-timestamp-interpreter):
Ignore :raw-value and build timestamp from numeric properties
instead.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-ox.el: Update tests.
This change allow to modify and update a timestamp easily without
requiring to reset :raw-value first, which was not intuitive.
* testing/lisp/test-ob.el: The default header arguments have added
'(hlines . yes)´ in commit c67e3cda15, also add them to the test so
that the two are consistent again.
* doc/org.texi (Field coordinates in formulas): Rephrase and add an
example with a Lisp formula to copy from remote table.
* testing/lisp/test-org-table.el (Comments): Adapt comment.
(test-org-table/copy-field): Add reference to
`test-org-table/remote-reference-access'.
(test-org-table/remote-reference-access): Add reference to
`test-org-table/copy-field'. Differentiate between Lisp formula to
copy and Calc (or Lisp) formula to calculate.
* lisp/org-element.el (org-element-interpret-data): Change signature.
One can now define pseudo elements and objects types.
(org-element--interpret-data-1): New function.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-ox.el: Update tests.
A pseudo element or object is a new element or object type that is
created and treated locally within an export back-end. The back-end
provides a translator for it and it is ignored when interpreted back
into Org syntax.
* lisp/ox.el (org-export-get-previous-element,
org-export-get-next-element): Fix return value for non plain text
objects in a secondary string.
* testing/lisp/test-ox.el: Add tests.
* lisp/org-element.el (org-element-comment-parser): Fix infloop when
a non-empty blank line follows a comment at the end of the buffer.
* testing/lisp/test-org-element.el: Add test.
* testing/lisp/test-org-table.el: Replace hline lhs expression in table
formula with relative row expression.
This fixes a test fail introduced by a2c71a6e35. The failing test
does not check relative hline references, so it should not rely on
undocumented behaviour.
* lisp/org.el (org-insert-comment, org-comment-or-uncomment-region):
Use `org-element-at-point' instead of `org-in-src-block-p' to check
if we're within a source block.
* testing/lisp/test-org.el: Add test.
* lisp/org.el (org-flag-drawer): Rewrite function using Elements.
Also prevents flagging drawers within example blocks.
* testing/lisp/test-org.el (test-org/flag-drawer): Add test.
* lisp/org.el (org-insert-heading): Do not error out when inserting is
to be done at one of the buffer's boundaries.
* testing/lisp/test-org.el: Add tests.
* lisp/org-element.el (org-element-latex-or-entity-successor,
org-element-latex-fragment-parser): Use `org-latex-regexps' instead
of `org-format-latex-options'.
* testing/lisp/test-org-element.el: Fix tests.
`org-latex-regexps' defines the correct syntax for LaTeX code within
an Org buffer. On the other hand, `org-format-latex-options'
determines which syntax can be previewed within the buffer.
* lisp/ob-ruby.el (org-babel-ruby-evaluate):
set conf.echo=false for the duration of evaluation.
* testing/lisp/test-ob-ruby.el (test-ob-ruby/session-output): new test.
* lisp/org-element.el (org-element-center-block-parser,
org-element-drawer-parser, org-element-dynamic-block-parser,
org-element-item-parser, org-element-quote-block-parser,
org-element-comment-block-parser, org-element-export-block-parser,
org-element-verse-block-parser, org-element-special-block-parser,
org-element-example-block-parser, org-element-headline-parser,
org-element-inlinetask-parser): Remove :hiddenp property.
* lisp/org.el (org-end-of-line, org-down-element): Use an equivalent
of :hiddenp property.
* testing/lisp/test-org-element.el: Remove tests.
The property is removed because it is buggy (e.g., when there's a link
just after a block opening line) and not really useful.
* lisp/org.el (org-link-escape-chars): Add comment with escape numbers
alphabetically ordered.
(org-link-escape-chars-browser): Add comment with escape numbers.
(org-link-escape): Use better readable char constant instead of number
constant for percent char.
(org-link-escape-browser): New function to substitute duplicate source
code.
(org-open-at-point): Substitute duplicate source code.
* testing/README: Make comment in source code example clearer.
* testing/lisp/test-org.el (test-org/org-link-escape-chars-browser):
Change URL to real use case and use the new function
`org-link-escape-browser'.