* lisp/org-element.el (org-element-context): Do not look for objects
within TODO keyword, priority cookie, comment keyword or tags.
* lisp/org.el (org-activate-tags): Fix regexp.
* testing/lisp/test-org-element.el (test-org-element/context): Add test.
Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
* lisp/org-element.el (org-element--next-mode): Line following an
inlinetask can be a planning.
* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
Update test.
Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/101958>
* lisp/org-element.el (org-element-link-parser): Call
`org-link-translation-function' if required.
(org-element-link-interpreter): Build link from type and path instead of
simply pasting raw value.
* lisp/org.el (org-translate-link): Call parser to extract proper path
and type.
* testing/lisp/test-org-element.el (test-org-element/link-interpreter):
Add test.
Reported-by: Sergei Nosov <sergei.nosov@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100227>
* lisp/org-element.el (org-element-link-parser): Correctly parse links
with newline characters.
* lisp/org.el (org-make-link-regexps): Allow newline characters within
angle links.
(org-activate-angle-links): Support multiline angle links.
* testing/lisp/test-org-element.el (test-org-element/link-parser):
Update tests.
As a rule of thumb, any newline character and all surrounding
whitespaces are treated as a single space in a bracket link. They are
removed in angle links.
* lisp/org-element.el (org-element-table-parser): Properly parse an
Org table followed by a line starting with a "+".
* testing/lisp/test-org-element.el (test-org-element/context): Fix
test.
* lisp/org-element.el (org-element--cache-sync-requests): Remove a now
useless element from requests
(org-element--cache-submit-request): Apply change to sync request.
(org-element--cache-process-request): Apply change to sync requests.
Fix removal of orphaned elements, i.e., elements not affected by
a change, but with an ancestor that was.
* testing/lisp/test-org-element.el (test-org-element/cache): Add test.
Reported-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98260>
* lisp/org-element.el (org-element--set-regexps): Refine
`org-element-paragraph-separate'.
(org-element-paragraph-parser): Fix paragraph parsing when followed by
a dual keyword or an ill-formed latex environment.
* testing/lisp/test-org-element.el (test-org-element/paragraph-parser):
Add tests.
Reported-by: Jacob Gerlach <jacobgerlach@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97256>
* lisp/org-element.el (org-element--cache-for-removal): Be more
careful when altering a properties drawer.
* testing/lisp/test-org-element.el (test-org-element/cache): Add test.
* lisp/org-element.el (org-element-document-properties): Remove
variable.
(org-element-context): Ignore ex-"document keywords".
* testing/lisp/test-org-element.el (test-org-element/context): Remove
no longer applicable tests.
Parsed keywords are no longer hard-coded and can be set per export
back-end.
As a consequence, `org-element-context' no longer returns objects in
"TITLE", "DATE" or "AUTHOR" keywords. This makes sense as these
objects would only make sense during export, and only if the chosen
back-end actually uses them.
* lisp/org-element.el (org-element-line-break-parser): Tiny
refactoring.
(org-element-normalize-contents): Take into consideration line breaks
when removing common indentation. Small refactoring.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
Add tests.
* lisp/org-element.el (org-element-object-containers): New variable
(org-element-interpret-data): Remove optional argument.
(org-element--interpret-data-1): Remove optional argument. Guess when
a given element or object has a pseudo type.
* lisp/ox-latex.el (org-latex-pseudo-objects): Remove variable.
(org-latex-table, org-latex--math-table): Apply signature change above.
* testing/lisp/test-org-element.el (test-org-element/interpret-data):
Update test.
* lisp/org-element.el (org-element-link-type-is-file): Remove.
(org-element-link-parser): Do not treat specially anymore "docview"
link type.
* testing/lisp/test-org-element.el (test-org-element/link-parser):
Update test.
* lisp/org-docview.el (org-docview-export): Fix path.
"docview" is a custom link type handled in its own library. There is
no reason to include it in core parser.
* testing/examples/babel.org: Change spaces to dashes in #+name
lines.
* testing/lisp/test-ob-exp.el (org-test-with-expanded-babel-code):
(ob-exp/evaluate-all-executables-in-order):
(ob-exp/exports-inline-code):
(ob-exp/exports-inline):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-exp/use-case-of-reading-entry-properties):
(ob-exp/export-from-a-temp-buffer):
(ob-export/export-with-results-before-block):
(ob-export/export-under-commented-headline):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
* testing/lisp/test-ob.el (test-org-babel/inline-src_blk-default-results-replace-line-1):
(test-org-babel/inline-src_blk-default-results-replace-line-2):
(test-org-babel/inline-src_blk-manual-results-replace):
(test-org-babel/inline-src_blk-results-scalar):
(test-org-babel/inline-src_blk-results-verbatim):
(test-org-babel/inline-src_blk-preceded-punct-preceded-by-point):
* testing/lisp/test-ox.el (test-org-export/export-scope):
Bind ‘org-babel-inline-result-wrap’ and/or ‘org-export-babel-evaluate’
so tests work when users have customized these variables.
* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
Add ‘org-trim’ where an extra newline was creeping in.
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
Neutralize org-babel-insert-result, which was stomping on the buffer
contents and disrupting the test
* testing/lisp/test-org-element.el (test-org-element/block-switches):
Replace (should (and ...)) with multiple (should ...). This gives
more precise indications of what is wrong when a test fails.
(test-org-element/link-parser): Require org-docview.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
Add the error type for ‘should-error’.
* testing/lisp/test-ox.el (test-org-export/set-title):
(test-org-export/handle-options):
(test-org-export/with-timestamps):
(test-org-export/comment-tree):
(test-org-export/handle-inlinetasks): Let
‘org-export-filter-body-functions’ and
‘org-export-filter-final-output-functions’ to nil where an empty
string is the expected result. ‘org-export-filter-apply-functions’
treats an empty string as special, and changes it to nil. This
creates test failures when the user has customized these variables.
* testing/org-test.el (org-test-with-temp-text): Let ‘org-mode-hook’
to nil.
(org-test-table-target-expect): Require ert since this function calls
some of its should* functions.
* lisp/org-element.el (org-element-context): Fix 'search failed ":"'
error when point is on a blank line after a keyword.
* testing/lisp/test-org-element.el (test-org-element/context): Add
tests.
* lisp/org-element.el (org-element--get-node-properties,
org-element--get-time-properties): New functions.
(org-element-headline-parser, org-element-inlinetask-parser): Use new
functions.
(org-element-property-drawer-parser): Change signature. Simplify
parsing.
drawer.
(org-element--current-element, org-element--next-mode): Property
drawers are located right after a headline or a planning element.
* testing/lisp/test-org-element.el (test-org-element/drawer-parser,
test-org-element/node-property,
test-org-element/property-drawer-interpreter): Update tests.
(test-org-element/property-drawer-parser): Add tests.
* testing/lisp/test-org.el (test-org/indent-line,
test-org/indent-region, test-org/forward-paragraph,
test-org/backward-paragraph): Update tests.
* 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