* contrib/lisp/org-export.el (org-export-before-processing-hook): New
variable.
(org-export-as): Run a hook just before expanding include keywords and
macros, and evaluating Babel blocks.
* testing/lisp/test-org-export.el: Add test.
* contrib/lisp/org-export.el (org-export-get-previous-element,
org-export-get-next-element): Correctly retrieve previous and next
object, if any, in secondary strings.
* testing/lisp/test-org-export.el: Add tests.
* lisp/ob-python.el (org-babel-python-hline-to): Customize hline
conversion to python.
(org-babel-python-None-to): Customize none conversion from python.
(org-babel-python-var-to-python): Use new variable.
(org-babel-python-table-or-string): Use new variable.
* lisp/org-element.el (org-element-headline-parser,
org-element-inlinetask-parser): Remove :clockedp property.
This property isn't even remotely related to the structure of the
document and, as such, doesn't belong to Org element.
* lisp/org.el (org-macro-replace-all): Signal an error when a circular
macro expansion happens.
(org-macro-initialize-templates): Fix docstring.
* testing/lisp/test-org.el: Add test.
* contrib/lisp/org-export.el (org-export-as): Expand correctly
{{{title}}} and such when they already contain a regular macro.
This is done by expanding macros in two steps: at first regular
macros, then document specific macros.
(org-export-expand-macro): Remove function.
* testing/lisp/test-org-export.el: Add test.
* lisp/org-element.el (org-element-center-block-parser,
org-element-drawer-parser, org-element-dynamic-block-parser,
org-element-footnote-definition-parser,
org-element-plain-list-parser, org-element-property-drawer-parser,
org-element-quote-block-parser, org-element-special-block-parser,
org-element-babel-call-parser, org-element-comment-parser,
org-element-comment-block-parser, org-element-diary-sexp-parser,
org-element-example-block-parser, org-element-export-block-parser,
org-element-fixed-width-parser, org-element-horizontal-rule-parser,
org-element-keyword-parser, org-element-latex-environment-parser,
org-element-paragraph-parser, org-element-src-block-parser,
org-element-table-parser, org-element-verse-block-parser): Add
`:post-affiliated' property to elements.
(org-element-inlinetask-parser): Remove affilated keywords.
* lisp/org.el (org-adaptive-fill-function): Use new property.
This property is cheap to compute during parsing and allows to
determine if point is on an affiliated keyword or not by checking if
it is between :begin and :post-affiliated positions.
* org-remember.el (org-remember-handler): Correctly strip the comment lines
in the temporary buffer *Remember* when handling a remember note.
TINYCHANGE
* lisp/org-element.el (org-element--collect-affiliated-keywords):
Allow duals keywords with only secondary value.
* testing/lisp/test-org-element.el: Add test.
This patch allows to parse correctly the following:
#+CAPTION[short caption]:
#+CAPTION: Very long caption
Some paragraph.
* lisp/org-element.el (org-element-timestamp-parser): Modify timestamp
objects properties.
(org-element-headline-parser, org-element-inlinetask-parser): Remove
`:timestamp' and `:clock' property. Add `:clockedp' property. Also,
set `:closed', `:deadline' and `:scheduled' values to timestamp
objects, not strings. Small refactoring.
(org-element-clock-parser): Rename `:time' property into `:duration'.
Also, set `:value' value as a timestamp object, not a string.
(org-element-planning-parser): Set `:closed', `:deadline' and
`:scheduled' values to timestamp objects, not strings.
(org-element-clock-interpreter, org-element-planning-interpreter)
(org-element-timestamp-interpreter): Update interpreters.
(org-element--current-element): Tiny refactoring.
* testing/lisp/test-org-element.el: Add tests.
* lisp/ob.el (org-babel-where-is-src-block-result): Insert new results
keyword in current narrowed part of buffer, if necessary. Small
refactoring.
(org-babel-insert-result): Do not widen buffer when new results have
to be inserted. Therefore, results inserted after the last block of
a narrowed buffer still belong to the narrowed part of the buffer.
* testing/lisp/test-ob.el: Add tests.
* testing/lisp/test-ob-exp.el: Move test to test-ob.el
* contrib/lisp/org-export.el (org-export-as):
`org-current-export-file' should refer to current, temporary, buffer
containing included contents, not to original buffer with include
keywords.
(org-export-with-current-buffer-copy): Buffer copy must contain the
whole buffer, possibly narrowed to a proper part, not only the
narrowed part.
* testing/lisp/test-org-export.el: Tweak tests.
* lisp/org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled):
Add an option to skip the deadline prewarning if the scheduled date is
in the future.
* org-remember.el (org-remember-apply-template): Start the commented
lines in the Remember temporary buffer with the appropriate
characters.
TINYCHANGE
* lisp/org-element.el (org-element-paragraph-separate): Diary-sexp
elements can separate paragraphs.
(org-element-all-elements): Install new `diary-sexp' type.
(org-element--current-element): Recognize new `diary-sexp' elements.
(org-element-diary-sexp-parser, org-element-diary-sexp-interpreter):
New functions.
* testing/lisp/test-org-element.el: Add tests.
* contrib/lisp/org-export.el (org-export-options-alist): Add an option
item to toggle smart quotes during export.
(org-export-with-smart-quotes, org-export-smart-quotes-alist,
org-export-smart-quotes-regexps): New variables.
(org-export-activate-smart-quotes): New function.
(org-export-data): Remove residual text properties.
* testing/lisp/test-org-export.el: Add tests.
* lisp/org-element.el (org-element-property): Access to text
properties when argument is a string.
(org-element-put-property): Correctly set property when target is
a string.
(org-element-adopt-elements): Also put :parent properties on strings.
* testing/lisp/test-org-element.el: Add test.