Commit Graph

530 Commits

Author SHA1 Message Date
Nicolas Goaziou 7736c2d7fb ox: Handle BIND keywords in SETUPFILE files
* lisp/ox.el (org-export-get-environment): Update comment.
(org-export--install-letbind-maybe): Go into SETUPFILE files and
handle BIND keywords there.
* testing/examples/setupfile.org: Update test file.
* testing/lisp/test-ox.el: Add tests.
2013-03-29 21:51:57 +01:00
Nicolas Goaziou a6d9fd82ea ox: White spaces after export snippets are never ignored
* lisp/ox.el (org-export-data): White spaces after export snippets are
  never ignored.
* testing/lisp/test-ox.el: Add test.

Back-end developers should pay attention to the fact that white spaces
before and after an ignored export snippet now are accumulated in the
output.
2013-03-25 20:29:31 +01:00
Bastien Guerry 78959943e2 Merge branch 'master-group-tags2' 2013-03-25 06:59:23 +01:00
Nicolas Goaziou 42e1a6351d org-element: Allow to escape escaping character before a comma
* 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")
2013-03-23 20:42:34 +01:00
Bastien Guerry 2922c1365d testing/lisp/: Use non-obsolete variable names (see previous commit)
* test-org-list.el (test-org-list/cycle-bullet)
(test-org-list/move-item-down, test-org-list/move-item-up)
(test-org-list/insert-item): Use non-obsolete variable names.

* test-org-element.el (test-org-element/at-point): Use
`org-list-empty-line-terminates-plain-lists'.
2013-03-23 17:45:26 +01:00
Bastien Guerry ae85aa0d32 test-ox.el (test-org-export/define-derived-backend, test-org-export/derived-backend-p): Uncomment
* test-ox.el (test-org-export/define-derived-backend)
(test-org-export/derived-backend-p): Uncomment.
2013-03-19 19:39:35 +01:00
Achim Gratz 63c5bc4425 fix test fail introduced by change of default in e8742b78e0
* testing/lisp/test-org-list.el (test-org-list/to-html): Bind
  `org-html-indent´ to nil for testing.
2013-03-18 08:07:26 +01:00
Samuel Loury 0c82deb421 Test the org-open-at-point function.
* testing/examples/open-at-point.org: new file.
* testing/lisp/test-org-open-at-point.el: new file.

This tests only the function when inside or before bracket links
and plain links.
2013-03-16 20:27:00 +01:00
Nicolas Goaziou c66641e1ea Add test related to a5a676e609
* testing/lisp/test-org-element.el: Add test.
2013-03-14 23:11:26 +01:00
Bastien Guerry c5490f0ef0 testing/lisp/text-ox.el: Comment two tests out
These tests fail when run in batch mode:

`test-org-export/define-derived-backend'
`test-org-export/derived-backend-p'

They don't fail when run interactively.
Let's comment them out until we understand
what's wrong with these tests.
2013-03-13 12:55:29 +01:00
Bastien Guerry 9f17654913 testing/: Merge org-test-ob-consts.el into org-test.el 2013-03-13 11:23:56 +01:00
Nicolas Goaziou 59cb22d638 ox: Simplify syntax for attributes
* lisp/ox.el (org-export-read-attribute): Do not use `read' to read
  attributes.  Instead, extract keywords and values from it, which
  means each value will be a string when non-nil.
* contrib/lisp/ox-groff.el (org-groff-link--inline-image): Use new
  attribute syntax.  Small refactoring.
* lisp/ox-ascii.el (org-ascii-horizontal-rule): Use new attribute
  syntax.
* lisp/ox-beamer.el (org-beamer-plain-list): Use new attribute syntax.
* lisp/ox-html.el (org-html--textarea-block): Use new attribute
  syntax.
* lisp/ox-latex.el (org-latex--inline-image, org-latex--org-table,
  org-latex--math-table): Use new attribute syntax.
* lisp/ox-man.el (org-man-table--org-table): Use new attribute syntax.
  Small refactoring.
* lisp/ox-odt.el (org-odt-link--inline-image, org-odt-table-cell): Use
  new attribute syntax.
* testing/lisp/test-ox.el: Add tests.

This patch introduces two changes.  To begin with, it removes the need
for quoting and escaping characters.  Also, all non-nil values are
stored as strings.  As an exception "nil" is stored as nil.
2013-03-11 08:33:10 +01:00
Achim Gratz 37d47a33d9 fix test failure introduced by moving library-of-babel.org in 321f806faf
* testing/lisp/test-ob-lob.el: The file library-of-babel.org has been
  moved from contrib/babel to doc, change the code to track that move.
2013-03-06 21:27:13 +01:00
Nicolas Goaziou 40fc9e869f org-list: Use export back-ends to transform radio lists
* lisp/org-list.el (org-list-send-list): Do not rely on
  `org-list-parse-list'.
(org-list-to-latex, org-list-to-html, org-list-to-texinfo): Use
appropriate export back-end instead of using `org-list-to-generic'.
* testing/lisp/test-org-list.el: Add tests.
2013-03-04 12:33:04 +01:00
Nicolas Goaziou 8f40d7f7a1 ox: Fix export of empty src blocks
* lisp/ox.el (org-export-format-code-default): Handle empty source
  blocks more gracefully.
* lisp/ox-ascii.el (org-ascii-src-block): Handle empty blocks more
  gracefully.
* testing/lisp/test-ox.el: Add tests.
2013-03-03 19:13:43 +01:00
Achim Gratz 2d3addeccf test-ob-perl: add a few perl babel tests
* testing/lisp/test-ob-perl.el: New file with a few tests of the perl
  babel integration.
2013-03-02 22:49:46 +01:00
Achim Gratz 6bc6a361b0 Ensure that new exporter gets tested in batch mode
* testing/org-test.el: Require ox so that these tests will be run
  during batch test.
2013-03-02 18:28:18 +01:00
Nicolas Goaziou 5a0239b9fc ox: Ignore inlinetasks with a :noexport: tag
* lisp/ox.el (org-export--selected-trees): Also mark inlinetasks with
  a select tag.
(org-export--skip-p): Skip inlinetasks with a :noexport: tag.
* testing/lisp/test-ox.el: Add tests.
2013-03-02 15:03:28 +01:00
Nicolas Goaziou 86563e0119 org-element: OPTIONAL_TITLE becomes ALT_TITLE property
* lisp/org-element.el (org-element-headline-parser):
  Rename :optional-title into :alt-title.
* lisp/ox.el (org-export-get-alt-title): Renamed from
  `org-export-get-optional-title'.
* lisp/ox-ascii.el (org-ascii--build-title): Apply name change.
* lisp/ox-html.el (org-html--format-toc-headline): Apply name change.
* lisp/ox-latex.el (org-latex-headline): Apply name change.
* lisp/ox-texinfo.el (org-texinfo--get-node,
  org-texinfo--generate-menu-items): Apply name change.
* testing/lisp/test-ox.el: Update tests.
* doc/org.texi (Table of contents): Update documentation.
2013-02-27 00:03:59 +01:00
Nicolas Goaziou 677433d9b4 ox: Fix bug where properties read from setupfile overwrite previous properties
* lisp/ox.el (org-export--get-inbuffer-options): Remove an optional
  argument.  Rewrite function.  Properties read from a setupfile do
  not overwrite anymore previously computed properties.
(org-export-get-environment): Apply changes to previous function.
* lisp/org.el (org-create-formula--latex-header): Apply arity change
  from `org-export--get-inbuffer-options'.
* testing/lisp/test-ox.el: Add test.
* testing/examples/setupfile.org: New file.
2013-02-26 23:35:36 +01:00
Nicolas Goaziou 367e680582 ox: Change order of retured elements in `org-export-get-previous-element'
* lisp/ox.el (org-export-get-previous-element): Change order of
  retured elements in `org-export-get-previous-element'.
* testing/lisp/test-ox.el: Update test.
2013-02-25 23:17:42 +01:00
Nicolas Goaziou 7cd6fdcd34 org-element: Only allow plain links in links
* 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.
2013-02-25 22:16:01 +01:00
Nicolas Goaziou 11033a97dc sub/superscript character has to follow a non-blank character
* 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.
2013-02-25 21:53:14 +01:00
Nicolas Goaziou 8838585a42 Do not move point when filling a table
* lisp/org.el (org-fill-paragraph): Do not move point when filling
  a table.
* testing/lisp/test-org.el: Add test.
2013-02-25 10:06:58 +01:00
Nicolas Goaziou ca060f7be7 Require 2 blank lines to separate footnote definition
* 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.
2013-02-24 14:44:07 +01:00
Nicolas Goaziou a15a657bfb ox: Better return value for `org-export-get-optional-title'
* lisp/ox.el (org-export-get-optional-title): Return regular title
  when no optional title is found.
* lisp/ox-ascii.el (org-ascii--build-title): Apply change to
  `org-export-get-optional-title'.
* lisp/ox-html.el (org-html--format-toc-headline): Apply change to
  `org-export-get-optional-title'.
* lisp/ox-latex.el (org-latex-headline): Apply change to
  `org-export-get-optional-title'.
* testing/lisp/test-ox.el: Add tests.
2013-02-24 09:20:35 +01:00
Nicolas Goaziou e0e740b289 ox: Add test for :minlevel parameter in INCLUDE keywords
* testing/lisp/test-ox.el (test-org-export/expand-include): Add test.
2013-02-18 20:49:43 +01:00
Nicolas Goaziou a385c6e0e4 org-element: Fix docstring, add tests
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser): Fix docstring.
* testing/lisp/test-org-element.el: Add tests.

This follows ae5932282d.
2013-02-18 08:58:59 +01:00
Nicolas Goaziou 324a2cb3f9 export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
  org-beamer--format-section, org-beamer--format-frame,
  org-beamer--format-block, org-beamer-headline): Apply changes to
  properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
  org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
  org-icalendar-blocked-headline-p, org-icalendar-entry,
  org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
  properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
  org-texinfo--generate-menu-items, org-texinfo-template,
  org-texinfo-headline, org-texinfo-link): Apply changes to
  properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
  Apply changes to properties.
  (org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-18 00:12:57 +01:00
Nicolas Goaziou 48da6a46e0 Move macro expansion code into its own library
* lisp/org-macro.el: New file.
* lisp/org.el: Remove macro code.
* lisp/ox.el: Require new library
* testing/lisp/test-org-macro.el: New file.
* testing/lisp/test-org.el: Remove macro test.
2013-02-16 15:55:30 +01:00
Nicolas Goaziou f33d90fb28 ox: Fuzzy link matching ignores statistics cookies
* lisp/ox.el (org-export-resolve-fuzzy-link): Ignore statistics
  cookies when matching an headline.
* testing/lisp/test-ox.el: Add test.
2013-02-16 15:05:45 +01:00
Nicolas Goaziou 2df6ded853 ox: Fix radio link resolution
* lisp/ox.el (org-export-resolve-radio-link): Radio targets are
  case-insensitive.
* testing/lisp/test-ox.el: Add test.
2013-02-15 23:03:29 +01:00
Nicolas Goaziou 78a652716e ox: Whitespaces are not significant when matching a fuzzy link
* 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.
2013-02-15 18:08:03 +01:00
Nicolas Goaziou a8e48bd3a8 Prevent export to file from overwriting current file
* lisp/ox.el (org-export-output-file-name): Add a protection when
  output file name is the same as the original org.
* testing/lisp/test-ox.el: Add tests.
2013-02-15 15:06:01 +01:00
Nicolas Goaziou 39ed70495c ox: Correctly handle footnote section
* lisp/ox.el (org-export--collect-headline-numbering): Remove footnote
  section from TOC.
(org-export-collect-headlines): Do not count footnote section when
numbering a headline.
* testing/lisp/test-ox.el: Add tests.
2013-02-13 16:00:27 +01:00
Nicolas Goaziou 9f8f32c360 org-element: Fix parsing of links with filled path
* lisp/org-element.el (org-element-link-parser): Remove all newline
  characters in path property.
* testing/lisp/test-org-element.el: Add test.
2013-02-13 08:41:43 +01:00
Nicolas Goaziou 1f8c8dc6d6 ox: Implement `inner-template' transcoder
* lisp/ox.el (org-export-as): Call `inner-template' function, if
  available.
* lisp/ox-html.el (org-html-inner-template): New function.
(org-html-template): Move all parts that should be inserted even in
a body-only export into `org-html-inner-template'.
* testing/lisp/test-ox.el: Add tests.
2013-02-11 22:26:52 +01:00
Nicolas Goaziou 94bcc7e282 org-element: Fix parsing of orphaned keyword at the end of an element
* 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.
2013-02-11 21:12:43 +01:00
Bastien Guerry 4b0ceee39a test-org.el (test-org/forward-element, test-org/backward-element): Use `regexp-quote'
* test-org.el (test-org/forward-element)
(test-org/backward-element): Use `regexp-quote'.
2013-02-11 17:09:53 +01:00
Nicolas Goaziou 1cac3127c2 Fix tests related to export
* lisp/ob-exp.el (org-babel-exp-process-buffer): Renamed from
  `org-export-blocks-preprocess'.
* lisp/ox.el (org-export-execute-babel-code): Apply previous renaming.
* testing/org-test.el (org-test-at-id): Make sure the function returns
  the value of the last form in its body.
* testing/lisp/test-ob-exp.el: Fix tests.
* testing/lisp/test-ob-lob.el: Fix tests.
2013-02-06 23:06:31 +01:00
Nicolas Goaziou 03a9191dd3 Move previous export framework into contrib
* contrib/lisp/org-ascii.el: New file.
* contrib/lisp/org-beamer.el: New file.
* contrib/lisp/org-docbook.el: New file.
* contrib/lisp/org-exp-blocks.el: New file.
* contrib/lisp/org-exp.el: New file.
* contrib/lisp/org-freemind.el: New file.
* contrib/lisp/org-html.el: New file.
* contrib/lisp/org-icalendar.el: New file.
* contrib/lisp/org-jsinfo.el: New file.
* contrib/lisp/org-latex.el: New file.
* contrib/lisp/org-lparse.el: New file.
* contrib/lisp/org-odt.el: New file.
* contrib/lisp/org-publish.el: New file.
* contrib/lisp/org-special-blocks.el: New file.
* contrib/lisp/org-taskjuggler.el: New file.
* contrib/lisp/org-xoxo.el: New file.
* lisp/org-ascii.el: Removed file.
* lisp/org-beamer.el: Removed file.
* lisp/org-docbook.el: Removed file.
* lisp/org-exp-blocks.el: Removed file.
* lisp/org-exp.el: Removed file.
* lisp/org-freemind.el: Removed file.
* lisp/org-html.el: Removed file.
* lisp/org-icalendar.el: Removed file.
* lisp/org-jsinfo.el: Removed file.
* lisp/org-latex.el: Removed file.
* lisp/org-lparse.el: Removed file.
* lisp/org-odt.el: Removed file.
* lisp/org-publish.el: Removed file.
* lisp/org-special-blocks.el: Removed file.
* lisp/org-taskjuggler.el: Removed file.
* lisp/org-xoxo.el: Removed file.
* testing/lisp/test-org-exp.el: Removed file.
* testing/lisp/test-org-html.el: Removed file.
2013-02-06 23:06:30 +01:00
Nicolas Goaziou 8dd2bfc291 Move new export framework files into core
* contrib/README: Remove references to new export framework.
* contrib/lisp/org-e-ascii.el: Removed file.
* contrib/lisp/org-e-beamer.el: Removed file.
* contrib/lisp/org-e-confluence.el: Removed file.
* contrib/lisp/org-e-groff.el: Removed file.
* contrib/lisp/org-e-html.el: Removed file.
* contrib/lisp/org-e-icalendar.el: Removed file.
* contrib/lisp/org-e-latex.el: Removed file.
* contrib/lisp/org-e-man.el: Removed file.
* contrib/lisp/org-e-odt.el: Removed file.
* contrib/lisp/org-e-publish.el: Removed file.
* contrib/lisp/org-e-texinfo.el: Removed file.
* contrib/lisp/org-export.el: Removed file.
* contrib/lisp/org-koma-letter.el: Removed file.
* contrib/lisp/org-md.el: Removed file.
* contrib/lisp/ox-confluence.el: New file.
* contrib/lisp/ox-groff.el: New file.
* contrib/lisp/ox-koma-letter.el: New file.
* lisp/ox-ascii.el: New file.
* lisp/ox-beamer.el: New file.
* lisp/ox-html.el: New file.
* lisp/ox-icalendar.el: New file.
* lisp/ox-jsinfo.el: New file.
* lisp/ox-latex.el: New file.
* lisp/ox-man.el: New file.
* lisp/ox-md.el: New file.
* lisp/ox-odt.el: New file.
* lisp/ox-publish.el: New file.
* lisp/ox-texinfo.el: New file.
* lisp/ox.el: New file.
* mk/org-fixup.el (org-make-org-loaddefs): Install new export
  framework and back-end files.
* testing/lisp/test-org-export.el: Removed file.
* testing/lisp/test-ox.el: New file.
2013-02-06 23:06:30 +01:00
Nicolas Goaziou 787a07421c Merge branch 'maint' 2013-01-31 22:16:23 +01:00
Nicolas Goaziou 592dc2ee7e org-element: Fix macro parsing with protected commas
* 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.
2013-01-31 22:15:39 +01:00
Nicolas Goaziou ed516e65dc org-export: Fix failing test
* testing/lisp/test-org-export.el: Fix failing test.
2013-01-30 21:32:50 +01:00
Yasushi SHOJI 8e8f40ce2f testing/README: Fix instructions
TINYCHANGE
2013-01-30 17:35:09 +01:00
Nicolas Goaziou 423756dd11 org-export: Generalize fallback footnote definition to all exporters
* contrib/lisp/org-export.el (org-export-get-footnote-definition):
  Provide a fallback definition when none can be found.
* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference): Revert
  change made in 30ef385ee0 since it is
  now handled at the export framework level.
* testing/lisp/test-org-export.el: Add test.
2013-01-30 14:22:35 +01:00
Nicolas Goaziou bb40d29b45 org-export: Fix subtree export when parent section is empty
* contrib/lisp/org-export.el (org-export--get-subtree-options): When
  point is at an headline and subtree export is called, make sure
  export properties are extracted from parent headline.
* testing/lisp/test-org-export.el: Add test.
2013-01-26 18:05:56 +01:00
Nicolas Goaziou 0cf7179430 Revert "org-element: Change return value for element at point in some corner cases"
This reverts commit 13e49a6385.

Conflicts:
	lisp/org-element.el
2013-01-21 21:51:39 +01:00
Nicolas Goaziou 13e49a6385 org-element: Change return value for element at point in some corner cases
* 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.
2013-01-19 23:34:59 +01:00