This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.
This commit reverts back the maint branch to its state before
merging the master branch. From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
* contrib/lisp/org-element.el (org-element-example-block-parser,
org-element-src-block-parser): Add `:number-lines',
`:preserve-indent, `:retain-labels', `:use-labels' and
`:label-fmt' properties.
* contrib/lisp/org-export.el (org-export-resolve-coderef,
org-export-get-loc): Apply changes to src-block and example-block
elements' properties.
(org-export-unravel-code, org-export-format-code,
org-export-format-code-default): New functions.
(org-export-handle-code): Removed function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-example-block): Use new
function.
(org-e-latex-src-block): Use new API. Better handling of numbered
lines with special packages.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-example-block,
org-e-ascii-src-block): Use new functions.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-org-export.el: Add tests.
* contrib/lisp/org-element.el (org-element-map): New optional argument
to avoid recursion into certain recursive types.
* contrib/lisp/org-export.el (org-export-footnote-first-reference-p,
org-export-get-footnote-number,
org-export-collect-footnote-definitions): Use new argument from
`org-element-map'.
* testing/lisp/test-org-export.el: Add test.
The new argument allows to force entering footnotes definitions at
a certain time (when their first reference is found) but not a second
time when they are encountered in the parse tree.
Thanks to Jambunathan for reporting this.
* lisp/org.el (org-link-search): Search for #+name affiliated keywords
and invisible targets.
* contrib/lisp/org-element.el (org-element-link-parser): Remove "ref"
links relative part.
(org-element-target-parser): Move property name from `:raw-value' to
`:value'.
(org-element-recursive-objects): Remove targets from tables. Cells
are not parsed unless explicitely asked by back-end developer, too
late. A target wouldn't be noticed in time. One solution could be to
parse every table, but that's time consumming.
(org-element-object-restrictions): Target are not recursive anymore.
* contrib/lisp/org-export.el (org-export-resolve-fuzzy-link): Find
elements with a matching "#+name: path" affiliated keyword.
(org-export-get-ordinal): Make special cases for headlines, items,
footnotes definitions and references.
(org-export-resolve-ref-link): Removed function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Handle
cross-reference numbers.
(org-e-latex-target): Targets have no contents.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--describe-links): Ignore
fuzzy links in link description at the end of the section.
(org-e-ascii-link): Handle cross-reference numbers.
* testing/contrib/lisp/test-org-export.el: Add tests.
* testing/lisp/test-org.el: Add tests.
* contrib/lisp/org-export.el (org-export-numbered-headline-p): New function.
* EXPERIMENTAL/org-e-ascii.el: Apply new function.
* EXPERIMENTAL/org-e-latex.el: Apply new function.
* testing/lisp/test-org-export.el: Add a test.
* contrib/lisp/org-element.el (org-element-map): Don't forget to apply
function on paragraph even when no object should be mapped. Just
don't recurse in it.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-footnote-reference):
Correctly handle numbering with nested footnotes.
* contrib/lisp/org-element.el (org-element-map): Apply function to
element or object before applying it to its secondary string, if
any. Otherwise, linearity is broken.
* contrib/lisp/org-export.el (org-export-footnote-first-reference-p,
org-export-get-footnote-number): Take care of recursive footnotes.
(org-export-get-genealogy): Correctly get genealogy of an item within
a secondary string.
* testing/contrib/lisp/test-org-export.el: Add tests.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-footnote-reference): Allow
nested footnotes.
* contrib/lisp/org-element.el (org-element-string-restrictions): Allow
footnote references within a footnote reference.
* testing/contrib/lisp/test-org-export.el: Add a test for nested
footnotes.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
Do not overwrite any user's ignore list.
* testing/contrib/lisp/test-org-export.el: Add test.
A good way to populate `:ignore-list' is through the use of
`org-export-filter-parse-tree-functions', with the help of
`org-element-map' and `org-export-ignore-element'. As an example, the
following code will skip every headline containing the word "note"
in its title during a LaTeX export:
(defun user-skip-note-headlines (data backend info)
;; For now LaTeX back-end is called `e-latex'.
(when (eq backend 'test)
;; Traverse the parse tree, adding to ignore list any headline
;; matching criteria.
(org-element-map
data 'headline
(lambda (headline)
(when (string-match "\\<note\\>"
(org-element-property :raw-value headline))
(org-export-ignore-element headline info)))
info))
;; Return original DATA.
data)
Then install it in parse-tree filters:
(add-to-list 'user-skip-note-headlines org-export-filter-parse-tree-functions)
Back-end delevopers will install it via `org-BACKEND-filters-alist'
where BACKEND stands for the name of the back-end considered. Se
`org-export-filters-alist' for more information.
* contrib/lisp/org-element.el (org-element-map): Remove use of an
alternate communication channel. Function is now called with only
one argument.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
(org-export-collect-headline-numbering, org-export--selected-trees,
org-export-collect-footnote-definitions,
org-export-footnote-first-reference-p,
org-export-get-footnote-number, org-export-resolve-fuzzy-link,
org-export-resolve-id-link, org-export-resolve-ref-link,
org-export-resolve-coderef, org-export-get-ordinal,
org-export-get-loc, org-export-collect-headlines): Apply changes.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--unique-links): Apply
changes.
* EXPERIMENTAL/org-e-publish.el (org-e-publish-collect-index): Apply
changes.
* contrib/lisp/org-export.el (org-export-expand-include-keyword): Use
another optional argument to specify the current working directory.
(org-export-as): Apply changes.
* testing/contrib/lisp/test-org-export.el: Add tests.
* testing/examples/include.org: New test file.
* testing/examples/include2.org: New test file.
* contrib/lisp/org-export.el (org-export-snippet-backend): New
function.
(org-export--skip-p): Remove automatic skip of export snippets.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-export-snippet): Use new
function.
* EXPERIMENTAL/org-e-html.el (org-e-html-export-snippet): Use new
function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-export-snippet): Use new
function.
* EXPERIMENTAL/org-e-odt.el (org-e-odt-export-snippet): Use new
function.
* testing/contrib/lisp/test-org-export.el: Add test.
The idea behind this change is that a given back-end may decide to
keep an export snippet not directly targetted at it (i.e. a beamer
back-end that would want to keep latex snippets). Hence, filtering
snippets is on back-ends side, and a new function is added to help
them in that task.
* contrib/lisp/org-element.el (org-element-headline-parser): COMMENT
and QUOTE keywords, ARCHIVE tags are case sensitive.
* testing/contrib/lisp/test-org-element.el: New file.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
Remove `:use-select-tags' property.
(org-export-populate-ignore-list): Renamed from
`org-export-get-ignore-list'.
(org-export--selected-trees): Renamed from
`org-export-use-select-tag-p'.
(org-export--skip-p): Use an additional argument to specify list of
trees containing a select tag.
(org-export-select-tags, org-export-exclude-tags,
org-export-with-priority): Change doc-string.
* testing/contrib/lisp/test-org-export.el: Tests modified
accordingly.
* contrib/lisp/org-element.el: Move archived tree handling out of
org-element-map.
* contrib/lisp/org-export.el (org-export-get-ignore-list): Properly
ignore archived with `org-export-with-archived-trees' set to
`headline'.
* testing/contrib/lisp/test-org-export.el (test-org-export/handle-options):
Add a test for that.
* contrib/lisp/org-export.el (org-export-get-inbuffer-options): Fix
but with incomplete macros returning an error. Also with behaviour
`nil', only insert new value if none was defined before.
(org-export-use-select-tags-p): Fix bug preventing it from properly
detecting select-tags.
(org-export--skip-p): Small refactoring
* testing/contrib/lisp/test-org-export.el: New test file.
* contrib/lisp/org-export.el (org-export-get-parent): New function.
(org-export-data, org-export-get-previous-element,
org-export-get-next-element): Use new function.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-item): Use new function.
Refactor code.
(org-e-ascii-paragraph): Use new function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-item): Use new function.
* EXPERIMENTAL/org-e-html.el (org-e-html-item): Use new function.
* EXPERIMENTAL/org-e-odt.el (org-e-odt-item): Use new function.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii-item, org-e-ascii-paragraph): Apply `:genealogy' removal.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-item): Apply `:genealogy'
removal.
* contrib/lisp/org-element.el (org-element-map): Do not compile
genealogy. Also use `:ignore-list' when possible.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
Populate `:ignore-list' before starting to transcode each element in
subtree.
(org-export-get-min-level): Use `:ignore-list'.
(org-export--skip-p): Renamed from `org-export-skip-p'. This is now
an internal function.
(org-export-data): Use and update `:ignore-list'. Do not update
genealogy.
(org-export-ignore-element): New function
(org-export-last-sibling-p): Small refactoring.
(org-export-resolve-fuzzy-link): Apply `:genealogy' removal.
(org-export-get-genealogy): Use a more efficient algorithm.
The equivalent of (plist-get info :genealogy) is
now (org-export-get-genealogy blob info), blob being any element or
object.