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.
* lisp/ob-lilypond.el: Make auditioning of midi and pdf asynchronous,
and add easy pdf generation in the form of `ly-gen-pdf' variable.
* testing/lisp/test-ob-lilypond.el: Tests for above.
* 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-footnote.el (org-footnote-normalize): Fix normalization of
inline footnotes with no footnote section.
* testing/lisp/test-org-footnote.el: New test file.
Thanks to Samuel Wales 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.
* testing/lisp/test-org-element.el: Moved location from
testing/contrib/lisp/ to testing/lisp.
* testing/lisp/test-org-export.el: Moved location from
testing/contrib/lisp/ to testing/lisp.
* 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-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.
* lisp/ob.el:
Fix `org-babel-result-end' command to provide consistent result
removal where result is type `wrap'. Prior to this fix
multiple (org-ctrl-c-ctrl-c) commands will add multiple newlines to
the end of results (one newline per block execution).
This fixes the test `test-ob/org-babel-remove-result--results-wrap'
* testing/lisp/test-ob.el:
Uncomment test since it now passes.
Conflicts:
testing/lisp/test-ob.el
In Emacs 22 the `kill-buffer' argument is NOT optional. This change
reflects this and allows the macro `org-test-with-temp-text-in-file'
to work in Emacs 22 for org compatibility. This fixes the test
`test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export'
Thanks to Martyn Jago for the test case
* lisp/ob.el (org-babel-balanced-split): Explicit checking if list
before calling member.
* testing/lisp/test-ob.el (test-ob/org-babel-balanced-split): Testing
the new Emacs22-proof behavior.