* lisp/org.el (org-planning-line-re): New variable. Renamed from
`org-planning-or-clock-line-re'.
* lisp/org-element.el (org-element-paragraph-separate,
org-element-headline-parser, org-element-inlinetask-parser, ,
org-element--current-element): Use new variable.
(org-element-planning-parser): Check previous line before parsing
planning info. When right after a headline, fallback to paragraph
parsing.
* testing/lisp/test-org-element.el (test-org-element/planning-parser):
Add a test. Update others.
(test-org-element/timestamp): Remove a test.
* testing/lisp/test-ox.el (test-org-export/handle-options): Update
test.
* lisp/org-element.el (org-element-property-drawer-parser,
org-element-node-property-parser): Ignore lines that are not node
properties.
(org-element-node-property-interpreter): Allow nil properties.
* lisp/org.el (org-re-property): Fix regexp to match properties with
empty values.
* testing/lisp/test-org-element.el (test-org-element/node-property):
Add tests.
Thanks to Eike for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/90293
* lisp/org-element.el (org-element-headline-interpreter): Take into
consideration `org-odd-levels-only' value. Small refactoring.
* testing/lisp/test-org-element.el (test-org-element/headline-interpreter):
Add test.
* lisp/ob-exp.el (org-babel-exp-inline-code-template): New
customizable variable to export inline source code (similar to
`org-babel-exp-code-template').
(org-babel-exp-code): New `type' argument to differentiate between
inline and standard code blocks.
* lisp/ob-core.el (org-babel-inline-src-block-regexp): Allow empty set
of switches and header arguments as in "src_sh[]{echo foo;}". Also
permit spaces before them.
* testint/lisp/test-org-element.el
(test-org-element/inline-src-block-parser): Test extended syntax for
inline source code.
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): New
function for testing inline source code handling. Also add three new
failing tests exhibiting unexpected results with ":results code"
switches.
* testing/lisp/test-ob.el
(test-org-babel/org-babel-get-inline-src-block-matches): Test for
inline source blocks with empty header arguments.
* testing/examples/babel.org: New sections for testing (i) exported
inline source code (used by `ob-exp/exports-inline-code'); (ii)
parsing inline source blocks with empty header arguments (used by
`test-org-babel/org-babel-get-inline-src-block-matches').
Until now pieces of inline source code were handled as standard code
blocks during export. These changes enable them to be exported.
* lisp/org-element.el (org-element-normalize-contents): Fix
indentation removal when there is an empty line within a verse block.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
Add test.
* lisp/org-element.el (org-element-comment-block-interpreter,
org-element-example-block-interpreter,
org-element-src-block-interpreter): Handle values with missing final
newline, e.g., when built by the user.
* testing/lisp/test-org-element.el (test-org-element/comment-block-interpreter,
test-org-element/example-block-interpreter,
test-org-element/src-block-interpreter): Add tests
Thanks to Thorsten Jolitz for suggesting the idea.
http://permalink.gmane.org/gmane.emacs.orgmode/89602
* lisp/org-element.el (org-element-all-elements): Remove
`export-block' type.
(org-element-block-name-alist): Make it a defconst since it is not
meant to be changed anymore.
(org-element-export-block-parser,
org-element-export-block-interpreter): Remove functions.
* lisp/ox.el (org-export-filters-alist): Remove export block filter.
(org-export-register-backend): Do not alter
`org-export-block-name-alist' anymore.
(org-export-define-backend, org-export-define-derived-backend): Update
docstring.
(org-export-filter-export-block-functions): Remove variable.
* testing/lisp/test-org-element.el (test-org-element/export-block-parser,
test-org-element/export-block-interpreter): Remove tests.
* testing/lisp/test-ox.el (test-org-export/define-backend): Update test.
* lisp/org-element.el (org-element-parse-secondary-string): Clone all
local variables from current buffer before parsing a secondary
string. Small refactoring.
(org-element-object-variables): Remove variable.
* testing/lisp/test-org-element.el (test-org-element/secondary-string-parsing):
Add test.
Thanks to Thomas S. Dye for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88850
* org-element.el (org-element--latex-begin-environment,
org-element--latex-end-environment): New format strings to identify
beginning and ending of LaTeX environments.
(org-element-latex-environment-parser, org-element-paragraph-parser,
org-element--current-element): Use `org-element--latex-begin-environment'
and `org-element--latex-end-environment'.
* test-org-element.el (test-org-element/latex-environment-parser):
Add tests.
* lisp/org-element.el (org-element--cache-process-request): Correctly
re-parent elements in cache in some corner cases.
* testing/lisp/test-org-element.el (test-org-element/cache): Add tests.
* lisp/org-element.el (org-element-recursive-objects): Add
`footnote-reference'.
(org-element-secondary-value-alist): Remove reference to
`footnote-reference'.
(org-element-footnote-reference-parser): Definition for inline
references is stored as the contents of the reference, not in
a secondary string.
(org-element-footnote-reference-interpreter): Apply changes from
parser.
* lisp/ox.el (org-export-get-footnote-definition,
org-export-get-environment): Apply changes from parser.
* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
Update test.
(test-org-element/context): Add test.
Storing definition in a secondary string was a poor design choice as
there is no "primary" string anyway. This also prevents
`org-element-context' from finding objects within the inline
definition.
* lisp/org-element.el (org-element-inlinetask-parser): Do not infloop
when parsing property drawer in an inlinetask.
* testing/lisp/test-org-element.el (test-org-element/headline-properties):
Add test.
Thanks to Aaron Ecay for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88133
* lisp/org-element.el (org-element-headline-parser,
org-element-inlinetask-parser): First find appropriate property
drawer in order to read properties.
* testing/lisp/test-org-element.el (test-org-element/headline-properties):
Add tests.
Thanks to Sébastien Vauban for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/87701
* lisp/org-element.el (org-element-context): Fix infloop. Be more
cautious when point is at the end of buffer.
* testing/lisp/test-org-element.el (test-org-element/context): Add
test.
* lisp/org.el (org-make-target-link-regexp): Change regexp so
alphanumeric characters cannot be found next to a radio link.
(org-activate-target-links): Apply changes to radio link regexp.
* lisp/org-element.el (org-element--object-lex,
org-element-link-parser): Apply changes to radio link regexp.
* testing/lisp/test-org-element.el (test-org-element/link-parser):
Update test.
Patch suggested by Daniel Clemente.
http://permalink.gmane.org/gmane.emacs.orgmode/84461
* lisp/org.el (org-make-link-regexps): Allow optional double slashes
after type. Small refactoring.
* testing/lisp/test-org-element.el (test-org-element/link-parser):
Update test.
This patch allows to write both [[file:/file.org]] and [[file:///file.org]].
See bug#16751.
* lisp/org-element.el (org-element-table-cell-parser,
org-element-table-cell-successor): Recognize cell even when last
vertical bar is missing.
* testing/lisp/test-org-element.el (test-org-element/table-cell-parser):
Add test.
Thanks to Thorsten Jolitz for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84713
* lisp/org.el (org-radio-target-regexp): Radio targets cannot begin or
end with whitespace.
(org-target-regexp): Update syntax according to previous rule.
(org-any-target-regexp): Fix fontification bug.
* testing/lisp/test-org-element.el (test-org-element/radio-target-parser):
Add test.
Variables are turned into defconst to emphasize the fact that they are
not subject to change.
Thanks to Daniel Clemente for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84461
* lisp/org-element.el (org-element-all-successors,
org-element-object-restrictions): Prioritize `link' over other
successors in order to find radio links starting with another syntax
object (e.g., an entity). Also allow text markup within radio
targets.
(org-element-link-parser): Add contents to radio targets.
* lisp/org.el (org-make-target-link-regexp): Fix regexp so it can
match targets starting with an Org object (e.g., an entity).
(org-ctrl-c-ctrl-c): Fix function when applied on an object contained
within a radio target.
* testing/lisp/test-org-element.el (test-org-element/radio-target-parser): Add test.
* testing/lisp/test-ox.el (test-org-export/resolve-radio-link): Add test.
* 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-context): If function is called at
the end of buffer, return any object that ends there.
* testing/lisp/test-org-element.el (test-org-element/context): Add
test.
* lisp/org-element.el (org-element-cache-sync-idle-time): Change
default value.
(org-element-cache-sync-duration, org-element-cache-sync-break,
org-element--cache-sync-requests, org-element--cache-sync-timer,
org-element--cache-sync-keys, org-element--cache-default-key,
org-element--cache-change-warning): New variables.
(org-element-cache-merge-changes-threshold,
org-element--cache-status): Removed variables.
(org-element--cache-key, org-element--cache-generate-key,
org-element--cache-key-less-p, org-element--cache-find,
org-element--cache-set-timer, org-element--cache-process-request,
org-element--cache-submit-request, org-element--parse-to,
org-element--cache-interrupt-p, org-element--cache-put,
org-element--cache-active-p): New functions.
(org-element--cache-compare): Adapt to new keys in AVL tree.
(org-element--cache-pending-changes-p,
org-element--cache-cancel-changes, org-element--cache-mapc,
org-element-cache-get, org-element-cache-put): Removed functions.
(org-element--cache-before-change): Use new variables.
(org-element--cache-after-change): Renamed from
`org-element--cache-record-change'.
(org-element-cache-get): Change signature.
(org-element-cache-put): Rewrite function. Use new tools.
(org-element-cache-reset): Adapt to new variables.
(org-element--cache-sync): Rewrite function.
* lisp/ox.el (org-export--generate-copy-script): Do not copy through
new cache-related variables.
(org-export-ignored-local-variables): New variable.
* testing/lisp/test-org-element.el (test-org-element/cache): New test.
Now only the part of the cache that needs to be accessed is updated
synchronously. Otherwise, it happens on idle time.
* 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/org-element.el (org-element-quote-section-parser,
org-element-quote-section-interpreter): Remove functions.
(org-element--current-element, org-element--parse-elements): Do not
handle quote sections at all.
* testing/lisp/test-org-element.el (test-org-element/quote-section-parser):
Remove test.
* 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.
* 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.
* 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/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-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-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-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-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-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-element.el (org-element-item-interpreter): Correctly
interpret back plain lists with "*" items. This fixes "This is not
a list" error returned in this case.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element--current-element): Fix
org-meta-return error at the end of buffer.
* testing/lisp/test-org-element.el: Add test.
Thanks to Nicolas Richard for reporting this.
* lisp/org-element.el (org-element-special-block-parser): Fix typo in
regexp matching block type. Also quote the type so it can contain
special characters.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element--remove-indentation): New function.
(org-element-example-block-parser, org-element-src-block-parser): Use
new function.
(org-element-src-block-interpreter): Update function according to
change.
* lisp/ox.el (org-export-unravel-code): Do not remove any indentation
since it now happens at the parser level.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-ox.el: Refactor tests.
* lisp/org-element.el (org-element--current-element): Be stricter when
matching arguments in LaTeX environments. In particular, do not
allow anything else than options and arguments in the opening line.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element--current-element): Allow the
opening string of a LaTeX environment to contain additional
arguments.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-fixed-width-interpreter): Fix
interpretation of fixed-width elements with a nil or empty string
value.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-macro-parser): Allow to escape
escaping character before a comma. Also do not trim spaces at
argument boundaries.
* doc/org.texi (Macro replacement): Update documentation about
possible locations and escaping mechanism.
* testing/lisp/test-org-element.el: Add tests.
With this patch, macro's arguments are read as the following:
"a,b" -> '("a" "b")
"a\,b" -> '("a,b")
"a\\,b" -> '("a\" "b")
"a\\\,b" -> '("a\,b")
"a\\\\,b" -> '(a"\\" "b")
Note that with the patch, you only need to escape backslashes before
a comma:
"a\\b\,c" -> '("a\\b,c")
* lisp/org-element.el (org-element-all-successors): Add `plain-link'
successor.
(org-element-object-restrictions): Remove `link' within `link'. Allow
`plain-link' instead.
(org-element-plain-link-successor): New function.
* testing/lisp/test-org-element.el: Add test.
Plain links within links are needed for the following kind of syntax:
[[http://orgmode.org][file:unicorn.png]]
No other link type is allowed within links.
* lisp/org.el (org-match-substring-regexp,
org-match-substring-with-braces-regexp): Update regexp.
A sub/superscript cannot start anymore at the beginning of the line
or after a space.
* lisp/org-element.el (org-element-footnote-definition-parser):
Require 2 blank lines to separate footnote definition.
* lisp/org-footnote.el (org-footnote-at-definition-p): Require 2 blank
lines to separate footnote definition.
* doc/org.texi: Update documentation for footnotes.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-footnote.el: Add tests.
Footnote definitions can still be separated with other footnote
definitions and headlines. This change allows to have multiple
paragraphs in a footnote definition without resorting to the "\par"
trick.
* lisp/ox.el (org-export-resolve-fuzzy-link): Whitespaces are not
significant when matching a fuzzy link.
* lisp/org-element.el (org-element-link-parser): Do not remove
newlines characters in paths anymore, since this is not required.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-ox.el: Add test.
* lisp/org-element.el (org-element--current-element): Add a limit
argument.
(org-element--collect-affiliated-keywords): Fix parsing of orphaned
keyword at the end of an element.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element-macro-parser): Fix error when last
argument ends with a protected comma.
* testing/lisp/test-org-element.el (test-org-element/macro-parser):
Add tests.
* lisp/org-element.el (org-element-at-point): When point is before any
element, in the first blank lines of the buffer, return nil. When
point is within blank lines just after a headline, return that
headline.
(org-element-context): Return nil when point is within the blank at
the beginning of the buffer.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-context): Add an optional argument
so (org-element-context)
and (org-element-context (org-element-at-point)) are equivalent.
* testing/lisp/test-org-element.el: Add test.
* org-agenda.el (org-float): Don't alias `org-float'.
* org.texi (Timestamps, Deadlines and scheduling): Use
`diary-float' instead of the now obsolete alias `org-float'.
* test-org-element.el
(test-org-element/timestamp-interpreter): Ditto.
* lisp/org-element.el (org-element--parse-elements,
org-element-at-point): Fix parsing of a list in a block in a list.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element-timestamp-interpreter): Fix
timestamp interpreter when raw value isn't available.
* testing/lisp/test-org-element.el: Update test.
* lisp/org-element.el (org-element-context): When point is between two
objects, be sure to return the second one.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element-timestamp-parser): Timestamp with
time range has active/inactive-range type.
* testing/lisp/test-org-element.el: Add test.
In order to know if starting date/time is really the same as ending
date/time, this patch permits to use the following:
(memq (org-element-property :type timestamp) '(active inactive))
* 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/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.
* 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.
* lisp/org-element.el (org-element--get-next-object-candidates): Fix
parsing of objects of the same type in a single paragraph.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-sub/superscript-successor): Fix
parsing of sub/superscript at beginning of item.
(org-element-latex-or-entity-successor): Fix parsing of latex
fragments at beginning of item.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element-context,
org-element--get-next-object-candidates): Fix `org-element-context'.
In particular, the restrictions for an object may be different from
those of its container (i.e. table rows and table cells).
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-example-block-parser,
org-element-src-block-parser): Store value of example-blocks and
src-blocks unescaped.
(org-element-example-block-interpreter,
org-element-src-block-interpreter): Escape value again when storing
it.
* contrib/lisp/org-export.el (org-export-unravel-code): Don't clean
commas from code since org-element already took care of it.
* testing/lisp/test-org-export.el: Update test.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-headline-parser): Fix parsing for
headlines with a single COMMENT or QUOTE keyword.
* testing/lisp/test-org-element.el: Add tests.
* lisp/org-element.el (org-element-all-elements): Add `node-property'
as a new element type.
(org-element-greater-elements): Add property-drawer element to greater
elements since they now contain node-property elements.
(org-element-drawer-parser): Small refactoring.
(org-element-property-drawer-parser): Move into Greater Elements file
section.
(org-element-node-property-parser,
org-element-node-property-interpreter): New functions.
(org-element--current-element, org-element-at-point,
org-element--parse-elements): Handle new element type.
* testing/lisp/test-org-element.el: Add tests.