* lisp/org-element.el (org-element-context): Fix parsing of bold
objects at the beginning of a headline.
* testing/lisp/test-org-element.el (test-org-element/context): Add
test.
* lisp/org-element.el (org-element-inlinetask-parser): Fix parsing
when regular and degenerate inlinetasks are mixed in the section.
* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
Add tests.
Thanks to Anders Johansson for reporting it.
* lisp/org-element.el (org-element-normalize-contents): Do not ignore
empty lines when an object follows.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
Add test.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Also check
`org-src-preserve-indentation' to know when to preserve indentation.
* testing/lisp/test-ob-exp.el (ob-export/export-and-indentation): New
test.
Thanks to John Hendy for reporting it.
* lisp/ob-exp.el (org-babel-exp-code-template): Include switches in
template.
(org-babel-exp-code): Provide %switches placeholder.
* testing/lisp/test-ob-exp.el (ob-export/export-src-block-with-switches):
New test.
(ob-export/export-src-block-with-flags): Fix indentation.
This fixes dde6af3a62. The confusion
came from the fact that "flags" placeholder had two meanings:
the :flags value and the block's switches (e.g., "-n"). This patch
separates these two meanings.
* lisp/ob-exp.el (org-babel-exp-code): Fix export of src blocks with
flags.
* testing/lisp/test-ob-exp.el (ob-export/export-src-block-with-flags):
New test.
Thanks to Giuseppe Lipari for reporting it.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Make processing more
robust when results are inserted before source block or when source
block is followed by multiple blank lines.
* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
Add test.
* 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.
* 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/org-element.el (org-element-at-point): If point is at the end
of the buffer, and that buffer ends with a list, and there's no
final newline, return last element in last item instead of plain
list.
* testing/lisp/test-org-element.el: Add test.
This fix allows to fill correctly the following construct:
- Item with a very long line ending at the end of buffer.
* lisp/org-element.el (org-element-footnote-definition-parser): Fix
value for :contents-begin when first line of footnote definition is
empty besides the label.
* testing/lisp/test-org-element.el (test-org-element/footnote-definition-parser):
Add test.
* lisp/org-element.el (org-element-at-point): Return correct element
when point is on a blank line just below a headline.
* testing/lisp/test-org-element.el: Add test.
* lisp/org.el (org-adaptive-fill-function): Do not handle
`adaptive-fill-regexp' in comments as the behaviour is not
satisfying.
* testing/lisp/test-org.el: Remove test.
* lisp/org-list.el (org-list-struct-apply-struct): Do not move item's
contents within a child above when repairing indentation.
* testing/lisp/test-org-list.el: Add tests.
* lisp/ox.el (org-export-collect-headlines): Do not build TOC for
headlines below H value.
* testing/lisp/test-ox.el: Add test.
Reported-by: Jambunathan K <kjambunathan@gmail.com>
* lisp/org-element.el (org-element-text-markup-successor,
org-element-latex-or-entity-successor,
org-element-export-snippet-successor,
org-element-footnote-reference-successor,
org-element-inline-babel-call-successor,
org-element-inline-src-block-successor,
org-element-line-break-successor, org-element-link-successor,
org-element-plain-link-successor, org-element-macro-successor,
org-element-radio-target-successor,
org-element-statistics-cookie-successor,
org-element-sub/superscript-successor,
org-element-table-cell-successor, org-element-target-successor,
org-element-timestamp-successor): Remove LIMIT argument.
(org-element--parse-objects, org-element--get-next-object-candidates):
Apply signature change to successors.
(org-element-context): Narrow buffer around object containers so
parsing of objects when using this function is done under the same
restrictions as in buffer parsing.
* testing/lisp/test-org-element.el: Add test.
* lisp/org.el (org-adaptive-fill-function): Look for a fill prefix at
the beginning of the paragraph and subsquently on its second line
instead of the current line.
* testing/lisp/test-org.el: Add test
* lisp/ox.el (org-export-data-with-backend): Set temporary back-end as
the new back-end in local communication channel.
(org-export-filter-apply-functions): Handle corner case where back-end
is nil.
* testing/lisp/test-ox.el: Small refactoring.
* lisp/org.el (org-adaptive-fill-function, org-fill-paragraph): Add
support for `adaptive-fill-regexp' in paragraphs and comments.
* testing/lisp/test-org.el: Add tests.
* lisp/org-element.el (org-element-plain-list-parser): Fix infloop
when parsing a list at the end of buffer, if buffer doesn't end at
a line beginning.
* testing/lisp/test-org-element.el: Add test.
* lisp/org.el (org-fill-paragraph): Use empty commented lines as
separators when filling comments. This mimics default behaviour
from "newcomment.el", which is not used in Org.
* testing/lisp/test-org.el: Add tests.
* lisp/org.el (org-fill-paragraph): Do not mix consecutive comments
when filling any of them.
* testing/lisp/test-org.el: Add test.
Thanks to Samuel Wales for reporting it.