Commit Graph

530 Commits

Author SHA1 Message Date
Nicolas Goaziou d88344d291 org-element: Properly remove COMMENT and QUOTE keywords from title in parser
* lisp/org-element.el: Properly remove COMMENT and QUOTE keywords from
  title in parser.
* testing/lisp/test-org-element.el: Add tests.
2012-09-29 10:15:59 +02:00
Achim Gratz f020f21a38 Partially revert "test-ob.el: Fix test. Delete trailing whitespaces"
This reverts the last part of commit 22c3080830.

* testing/lisp/test-ob.el (test-ob/results-do-not-replace-code-blocks):
  These two whitespace errors are intentional.  Do not remove them.
2012-09-29 10:02:36 +02:00
Bastien Guerry 33ab30ca2a Merge branch 'maint' 2012-09-29 09:39:22 +02:00
Bastien Guerry 2a04d90d20 Merge branch 'maint' of orgmode.org:org-mode into maint 2012-09-29 09:38:34 +02:00
Bastien Guerry 22c3080830 test-ob.el: Fix test. Delete trailing whitespaces
* test-ob.el (test-ob/org-babel-remove-result--results-org):
Fix test.  Delete trailing whitespaces.
2012-09-29 09:38:19 +02:00
Nicolas Goaziou 9c92312d92 org-element: Fix parsing for headlines with only a COMMENT or QUOTE keyword
* 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.
2012-09-29 08:54:46 +02:00
Achim Gratz fa8d7f3d31 Merge branch 'maint' 2012-09-26 21:36:14 +02:00
Achim Gratz 1653759c25 fix test: BEGIN_ORG / END_ORG has been replaced by BEGIN_SRC org / END_SRC
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-org):
  BEGIN_ORG / END_ORG has been replaced by BEGIN_SRC org / END_SRC.
  Change test comparison template accordingly.

* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-*):
  These tests had duplicate definitions, removed the first one of each.
2012-09-26 21:35:34 +02:00
Nicolas Goaziou 66fe322120 org-export: New function to return a node property, even inherited
* contrib/lisp/org-export.el (org-export-get-node-property): New
  function.
* testing/lisp/test-org-export.el: Add tests.
2012-09-23 19:37:21 +02:00
Nicolas Goaziou b60445cfd4 org-element: Define a new element: node-property
* 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.
2012-09-23 19:10:27 +02:00
Achim Gratz cdf094aca7 Merge branch 'maint' 2012-09-23 11:08:30 +02:00
Achim Gratz b20ef32b9a do not set variables belonging to ESS
* lisp/ob-R.el (org-babel-R-initiate-session): Protect against use of
  unbound variable `ess-ask-for-ess-directory´. The default for this
  variable is true, so act accordingly if it is found unbound.

* lisp/ob-R.el: Remove initialization with `nil´ from
 `ess-ask-for-ess-directory´ and `ess-local-process-name´.  Remove
 second declaration for `ess-local-process-name´.

* testing/lisp/test-ob-R.el (test-ob-R/simple-session): Bind
  `ess-ask-for-ess-directory´ to nil to facilitate batch testing.
2012-09-23 11:07:18 +02:00
Nicolas Goaziou 393acf0df8 org-element: Fix for affiliated keywords parsing
* lisp/org-element.el (org-element--collect-affiliated-keywords): Fix
  return value.
* testing/lisp/test-org-element.el: Add test.
2012-09-23 09:49:32 +02:00
Nicolas Goaziou baed7dc7db org-element: Optimize affiliated keywords parsing
* lisp/org-element.el (org-element-center-block-parser,
  org-element-drawer-parser, org-element-dynamic-block-parser,
  org-element-footnote-definition-parser,
  org-element-plain-list-parser, org-element-quote-block-parser,
  org-element-special-block-parser, org-element-babel-call-parser,
  org-element-comment-parser, org-element-comment-block-parser,
  org-element-example-block-parser, org-element-export-block-parser,
  org-element-fixed-width-parser, org-element-horizontal-rule-parser,
  org-element-keyword-parser, org-element-latex-environment-parser,
  org-element-paragraph-parser, org-element-property-drawer-parser,
  org-element-src-block-parser, org-element-table-parser,
  org-element-verse-block-parser): Change signature. Now use an
  additional argument: affiliated.
(org-element--current-element): Skip affiliated keywords and pass them
  as an argument to parsers.  It prevents to walk through these
  keywords twice: the first time to get to the first line of the
  element, and a second time to collect the affiliated keywords.
* contrib/lisp/org-export.el (org-export-get-caption): Update function
  since multiple affiliated keywords are now reversed.
* testing/lisp/test-org-element.el: Update tests.
2012-09-20 20:08:16 +02:00
Nicolas Goaziou 7c40e0c6ba Merge branch 'maint' 2012-09-20 19:14:43 +02:00
Nicolas Goaziou fd5cc62ca5 org-element: Fix inline-src-block parsing at the beginning of an item
* lisp/org-element.el (org-element-inline-src-block-successor): Fix
  inline-src-block parsing at the beginning of an item.
* testing/lisp/test-org-element.el: Add test.
2012-09-20 19:13:40 +02:00
Eric Schulte f68da4f5ab testing export of inline src blocks
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline): Testing export of
  inline src blocks.
2012-09-15 10:19:55 -06:00
Nicolas Goaziou fe140488aa org-element: Allow multiple caption keywords
* lisp/org-element.el (org-element-multiple-keywords): Allow multiple
  caption keywords.
* contrib/lisp/org-export.el (org-export-get-caption): New function.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-org-export.el: Add tests.
2012-09-13 17:33:46 +02:00
Nicolas Goaziou 0b13ec8c1b Merge branch 'maint' 2012-09-13 13:17:17 +02:00
Nicolas Goaziou 4a7c99134c org-element: Fix caption parsing
* lisp/org-element.el (org-element--collect-affiliated-keywords): Fix
  caption parsing.
* testing/lisp/test-org-element.el: Add tests.
2012-09-13 13:15:39 +02:00
Bastien Guerry aac2e8b93f Merge branch 'maint' 2012-09-12 15:50:25 +02:00
Nicolas Goaziou f969e24a43 org-element: Fix parsing for items/footnote definitions starting with special syntax
* lisp/org-element.el (org-element--current-element): At the very
  beginning of a footnote definition or an item, next element is
  always a paragraph.
* testing/lisp/test-org-element.el: Add tests.

This patch fixes parsing for following cases:

 - - text

or

[fn:1] # Some text
2012-09-12 15:45:10 +02:00
Nicolas Goaziou 90aae1e2e8 Merge branch 'maint' 2012-09-01 22:57:19 +02:00
Nicolas Goaziou 8d09d1aaa9 org-element: Fix section parsing
* lisp/org-element.el (org-element-section-parser): Make sure section
  cannot contain an headline.
(org-element--current-element): Fix bug requiring to parse a quote
section even when point is at an headline.
* testing/lisp/test-org-element.el: Add test.
2012-09-01 22:55:31 +02:00
Nicolas Goaziou 7ce732b294 org-export: Make BIND keywords case insensitive
* contrib/lisp/org-export.el (org-export--install-letbind-maybe): Make
  BIND keywords case insensitive.
* testing/lisp/test-org-export.el: Add test.
2012-09-01 14:21:09 +02:00
Nicolas Goaziou 61ad50d758 org-export: Fix #+BIND: keywords evaluation
* contrib/lisp/org-export.el (org-export--install-letbind-maybe): If
  a variable is bound two times in the buffer, be sure to set its
  value to the last bound. Use correct function to confirm binding.
  Allow keyword to start on any column.
* testing/lisp/test-org-export.el: Add tests.
2012-09-01 12:59:57 +02:00
Nicolas Goaziou ea77b2ccb2 org-export: Use new API for macro expansion
* contrib/lisp/org-export.el (org-export-define-backend): Update
  docstring.
(org-export-special-keywords): Remove "MACRO".
(org-export--get-inbuffer-options, org-export--get-buffer-attributes):
Remove internal macro handling.
(org-export-as): Use external tool instead.
(org-export-expand-macro): Remove function.
* contrib/lisp/org-e-ascii.el (org-e-ascii-macro): Remove function.
* contrib/lisp/org-e-groff.el (org-e-groff-macro): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-macro): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-macro): Remove function.
* contrib/lisp/org-e-man.el (org-e-man-macro): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-macro): Remove function.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-macro): Remove
  function.
* testing/lisp/test-org-export.el: Remove tests.

Since macros are now expanded before parsing (and produce Org syntax),
back-ends will never see them (unless NO-EXPAND argument from
`org-export-as' is non-nil, which isn't the case for any back-end so
far).
2012-09-01 10:56:00 +02:00
Nicolas Goaziou 4a2f3c2093 Implement a basic API around macros
* lisp/org.el (org-mode): Initialize macros templates.
(org-macro-templates): New variable.
(org-macro-expand, org-macro-replace-all,
org-macro-initialize-templates): New functions.
* testing/lisp/test-org.el: Add tests.
2012-09-01 10:56:00 +02:00
Nicolas Goaziou caf2432c52 org-export: Add an option to toggle export of stat cookies
* contrib/lisp/org-export.el (org-export-with-statistics-cookies): New
  variable.
(org-export-options-alist): Use new variable.
(org-export--skip-p): Handle new option.
* testing/lisp/test-org-export.el: Add test.
2012-08-27 15:27:02 +02:00
Nicolas Goaziou f29660fe7a Merge branch 'maint' 2012-08-26 23:45:32 +02:00
Nicolas Goaziou 664132667b Fix org-backward-element with point on first element in section
* lisp/org.el (org-backward-element): When called at the beginning of
  first element in section, the function shouldn't return an error but
  move point to headline or point-min instead.
* testing/lisp/test-org.el: Add test.
2012-08-26 23:44:51 +02:00
Nicolas Goaziou 1f3d1f55fe Merge branch 'maint' 2012-08-25 15:28:40 +02:00
Nicolas Goaziou b4604d2833 org-element: Fix filling bug in a list with affiliated keyword
* lisp/org-element.el (org-element-paragraph-parser): Fix parsing of
   paragraph at the beginning of an item.
* testing/lisp/test-org-element.el: Add test.
2012-08-25 15:27:01 +02:00
Nicolas Goaziou d86f09a854 org-element: Extract search option and application in "file"-type links
* lisp/org-element.el (org-element-link-type-is-file): New variable.
(org-element-link-parser): Extract search option and application in
"file"-type links.
* contrib/lisp/org-e-html.el (org-e-html-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-e-odt.el: Remove components extraction since this
  in now done in `org-element-link-parser'.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-link): Remove
  components extraction since this in now done in
  `org-element-link-parser'.
* contrib/lisp/org-e-latex.el (org-e-latex-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-e-man.el (org-e-man-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-e-groff.el (org-e-groff-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-md.el (org-md-link): Remove components extraction
  since this in now done in `org-element-link-parser'.
* testing/lisp/test-org-element.el: Add tests.
2012-08-25 10:38:25 +02:00
Nicolas Goaziou 53334042b5 Fix bug in comment-dwin when at a keyword
* lisp/org.el (org-mode): Set back comment-start-skip so comment-dwin
  can tell a keyword from a comment.
* testing/lisp/test-org.el: Add test.
2012-08-24 21:58:48 +02:00
Nicolas Goaziou 302fdfd2b0 Fix bug in comment-dwin when at a keyword
* lisp/org.el (org-mode): Set back comment-start-skip so comment-dwin
  can tell a keyword from a comment.
* testing/lisp/test-org.el: Add test.
2012-08-24 21:15:00 +02:00
Nicolas Goaziou 8a97c601a1 Do not fill verse blocks contents
* lisp/org.el (org-fill-context-prefix, org-fill-paragraph): Do not
  fill verse blocks contents.  Verse blocks can be used to format
  free-form poetry, so filling has to be done manually.
* testing/lisp/test-org.el: Remove unnecessary tests.
2012-08-24 12:58:43 +02:00
Nicolas Goaziou cced6735a7 org-export: Run export hook with current back-end as argument
* contrib/lisp/org-export.el (org-export-as): Run export hook with
  current back-end as argument.
* testing/lisp/test-org-export.el: Update test.
2012-08-24 10:10:44 +02:00
Bastien Guerry 00e5c278fd testing/: Update two tests
The current Emacs trunk bumped to version >24.2.50 because a new
release Emacs 24.2 has been decided.  `cl-map' is not an alias for
`map' in Emacs < 24.2.50 -- so take this into account in some tests.
2012-08-20 14:24:14 +02:00
Nicolas Goaziou a3c4e10ac1 Fix filling in in a narrowed buffer
* lisp/org.el (org-fill-paragraph): Fix filling in a narrowed buffer.
(org-fill-context-prefix): Fill prefix doesn't depend on current
narrowing.
* testing/lisp/test-org.el: Add test.
2012-08-19 13:44:00 +02:00
Nicolas Goaziou ad94a9433b Addendum to 50a434bb9f
* lisp/org-element.el (org-element-item-parser): Do not remove tag
  from body if list isn't descriptive.
* lisp/org-list.el (org-insert-item): Only ask about a term for
  descriptive lists.
(org-list-struct, org-list-insert-item): Do not recognize a tag in an
ordered list.
* testing/lisp/test-org-element.el: Add test.
2012-08-18 13:13:31 +02:00
Nicolas Goaziou 3f57803fb4 org-element: Generalize `org-element-adopt-element' into `org-element-adopt-elements'
* lisp/org-element.el (org-element-set-element): Rewrite function.
(org-element-adopt-elements): New function.
(org-element-adopt-element): Removed function.
(org-element--parse-elements, org-element--parse-objects): Use new function.
* testing/lisp/test-org-element.el: Update tests.
2012-08-18 10:13:35 +02:00
Nicolas Goaziou 50a434bb9f org-list: Fix list type with mixed constructs
* lisp/org-list.el (org-list-automatic-rules): Remove `bullet' rule,
  which is now hard-coded.
(org-cycle-list-bullet): Hard code `bullet' rule.
(org-list-get-list-type): Make sure a list with numbered bullets
cannot have `descriptive' type.
* testing/lisp/test-org-list.el: Add tests.
2012-08-18 09:30:33 +02:00
Nicolas Goaziou 8ab1d76529 org-element: Fix previous patch
* lisp/org-element.el (org-element-paragraph-parser): Fix previous patch.
* testing/lisp/test-org-element.el: Add tests.
2012-08-17 17:40:32 +02:00
Nicolas Goaziou b1ed817e38 org-element: Use strict comment syntax (no "#+" allowed)
* lisp/org.el (org-fill-paragraph): No need to use
  `org-element-paragraph-separate' in a verse block since blank lines
  only can end a "paragraph".
* lisp/org-element.el (org-element-paragraph-separate): Apply changes
  to comments.
(org-element-paragraph-parser): Correctly find end of paragraphs.
(org-element--current-element): Require colons for Babel calls.
(org-element-center-block-parser, org-element-dynamic-block-parser,
org-element-quote-block-parser, org-element-special-block-parser,
org-element-comment-block-parser, org-element-example-block-parser,
org-element-export-block-parser, org-element-src-block-parser,
org-element-verse-block-parser): Fall-back to paragraph parsing when
incomplete or ill-formed.
* testing/lisp/test-org-element.el: Update tests.
2012-08-17 16:58:26 +02:00
Nicolas Goaziou 952d722dcd org-export: Allow to toggle inlinetasks inclusion in export output
* contrib/lisp/org-export.el (org-export-options-alist,
  org-export--skip-p): Allow to toggle inlinetask inclusion in export.
(org-export-headline-levels, org-export-with-priority): Fix docstring.
(org-export-with-inlinetasks): New variable.
* testing/lisp/test-org-export.el: Add tests.
2012-08-16 12:46:49 +02:00
Nicolas Goaziou 8fc893a036 org-element: Fix small bug
* lisp/org-element.el (org-element-at-point): Return consistent value
  when function is called on a blank line within a plain list.
* testing/lisp/test-org-element.el: Add test.
2012-08-12 00:48:09 +02:00
Eric Schulte 16b2af9fdb passing all tests 2012-08-10 10:56:14 -06:00
Nicolas Goaziou b523a3edf5 Fix tests
* lisp/org-element.el: Update code commets.
* testing/lisp/test-org-element.el: Remove tests for renamed
  navigation and manipulation fuctions.
* testing/lisp/test-org.el: Add tests for renamed navigation and
  manipulation functions.
2012-08-08 13:58:14 +02:00
Nicolas Goaziou 694a858506 Fix bug when marking subtree with point on an inlinetask
* lisp/org.el (org-mark-subtree): Fix bug when marking subtree with
  point on an inlinetask.  Refactor code.
* testing/lisp/test-org.el: Add test.
2012-08-08 11:50:09 +02:00
Nicolas Goaziou 0a04169769 org-element: Fix `org-element-at-point' in some corner cases
* lisp/org-element.el (org-element-item-parser,
  org-element-plain-list-parser): Make sure that the element ends at
  the beginning of a line if possible.
(org-element-at-point): Return expected element when point is at an
element's end or at its contents' end.
* testing/lisp/test-org-element.el: Add test.
* testing/lisp/test-org.el: Add test.
2012-08-08 09:56:28 +02:00
Nicolas Goaziou d70f965486 Do not make a special case for inlinetasks when marking a subtree
* lisp/org.el (org-mark-subtree): Do not make a special case for
  inlinetasks when marking a subtree. These are handled by
  `org-element-mark-element'.
* testing/lisp/test-org.el: Add test.
2012-08-07 13:38:32 +02:00
Eric Schulte 7c4ac55364 Don't load test-ob-sh when no "sh" executable
* testing/lisp/test-ob-sh.el ("sh"): Test for an "sh" executable.
2012-08-03 13:34:10 -06:00
Nicolas Goaziou eb2eacf91d org-element: Fix parsing when a keyword follows the commented line
* lisp/org-element.el (org-element-comment-parser): Fix parsing when
  a keyword follows the commented line.
* testing/lisp/test-org-element.el: Add test.
2012-08-02 19:47:14 +02:00
Nicolas Goaziou a8e00ff0dc Inlined comment syntax is reduced to "#"
* lisp/org.el (org-mode): Define new comment syntax.
(org-fontify-meta-lines-and-blocks-1, org-strip-protective-commas,
org-fill-context-prefix, org-insert-comment,
org-comment-or-uncomment-region): Use new comment syntax.
* lisp/org-element.el (org-element-comment-parser,
  org-element-comment-interpreter, org-element--current-element): Use
  new comment syntax.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org.el: Update tests.
2012-08-01 10:47:47 +02:00
Nicolas Goaziou 783fd91e66 When at an item or a footnote definition, fill first paragraph instead
* lisp/org.el (org-fill-paragraph): When at an item or a footnote
  definition, fill first paragraph instead.
* testing/lisp/test-org.el:
2012-07-31 20:49:11 +02:00
Nicolas Goaziou 97c7e9c88a org-element: Add test 2012-07-31 16:34:09 +02:00
Eric Schulte d0665bb322 a test exercising org-babel-comint-with-output
* testing/lisp/test-ob-sh.el (test-ob-sh/session): Shell session
  execution uses this function which was not previously tested.
2012-07-31 08:18:50 -06:00
Nicolas Goaziou fcca4ab8e4 Fix filling when point is at the very end of a paragraph
* lisp/org.el (org-fill-paragraph): Fix filling when point is at the
  very end of a paragraph.
* testing/lisp/test-org.el: Add test.
2012-07-31 15:42:30 +02:00
Nicolas Goaziou 4d00c5bf4d Complete handling of comment syntax
* lisp/org.el (org-mode): Set comments related variables.
(org-insert-comment, org-comment-or-uncomment-region): New functions.
* testing/lisp/test-org.el: Add test.
2012-07-31 13:55:44 +02:00
Nicolas Goaziou 5cb9beea9b Add tests about filling and auto-filling
* lisp/org.el (org-fill-context-prefix): Small refactoring.
(org-fill-paragraph): Add code comments.
* testing/lisp/test-org.el: Add tests
2012-07-30 15:25:13 +02:00
Nicolas Goaziou 7cf9e5afb5 org-element: Modify output from `org-element-at-point' and `org-element-context'
* lisp/org-element.el (org-element-at-point): Add :parent property to
  output.
(org-element-context): Add :parent property to output.  Also return
a single element or object instead of a list of parents.
(org-element-forward, org-element-up): Apply changes.
* testing/lisp/test-org-element.el: Add tests.
2012-07-30 00:40:21 +02:00
Nicolas Goaziou e7397fda3f org-element: Refactor code
* lisp/org-element.el (org-element-center-block-parser,
  org-element-dynamic-block-parser,
  org-element-footnote-definition-parser,
  org-element-headline-parser, org-element-inlinetask-parser,
  org-element-quote-block-parser, org-element-special-block-parser,
  org-element-plain-list-parser): Refactor code.
 (org-element-drawer-parser): Fall-back to paragraph parser when
  drawer is incomplete.
* testing/lisp/test-org-export.el: Update test.
2012-07-29 00:08:18 +02:00
Nicolas Goaziou 2227a17691 org-element: Fix paragraph parsing
* lisp/org-element.el (org-element-paragraph-separate): Refactor.
(org-element-paragraph-parser): Fix paragraph parsing.
* testing/lisp/test-org-element.el: Add test.
2012-07-28 14:35:35 +02:00
Nicolas Goaziou b04f9e3268 `org-fill-paragraph' is backed up by Org Element
* lisp/org.el (org-fill-paragraph): Rewrite function using
  `org-element-at-point'.
* lisp/org-element.el (org-element-fill-paragraph): Remove function.
* testing/lisp/test-org-element.el: Remove test.
* testing/lisp/test-org.el: Add test.
2012-07-28 11:47:58 +02:00
Nicolas Goaziou 5057ae0fc2 org-export: Require info argument in some topology functions
* contrib/lisp/org-export.el (org-export-first-sibling-p,
  org-export-last-sibling-p, org-export-get-previous-element,
  org-export-get-next-element): Add INFO argument.  This is necessary
  to ignore non-exportable elements or objects.
(org-export--skip-p): Apply signature change.
* testing/lisp/test-org-export.el: Add tests.
* contrib/lisp/org-e-odt.el (org-e-odt-footnote-reference): Apply
  signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference,
  org-e-latex-headline, org-e-latex-table-cell): Apply signature
  change.
* contrib/lisp/org-e-html.el (org-e-html-footnote-reference,
  org-e-html-headline): Apply signature change.
* contrib/lisp/org-e-beamer.el (org-e-beamer-export-snippet,
  org-e-beamer--format-block): Apply signature change.
2012-07-27 16:16:04 +02:00
Nicolas Goaziou 3df18bef9f org-export: Add test
* testing/lisp/test-org-export.el: Add test for subtree options.
2012-07-25 12:25:58 +02:00
Nicolas Goaziou dbea7e658f org-export: Rename some internal functions
* contrib/lisp/org-export.el (org-export-get-environment,
  org-export-collect-tree-properties, org-export-data,
  org-export-expand-include-keyword): Use new names.
(org-export--parse-option-keyword): Renamed from
`org-export-parse-option-keyword'.
(org-export--get-subtree-options): Renamed from
`org-export-get-subtree-options'.
(org-export--get-inbuffer-options): Renamed from
`org-export-get-inbuffer-options'.
(org-export--get-buffer-attributes): Renamed from
`org-export-get-buffer-attributes'.
(org-export--get-global-options): Renamed from
`org-export-get-global-options'.
(org-export--allow-BIND-local): Renamed from
`org-export-allow-BIND-local'.
(org-export--confirm-letbind): Renamed from
`org-export-confirm-letbind'.
(org-export--install-letbind-maybe): Renamed from
`org-export-install-letbind-maybe'.
(org-export--get-min-level): Renamed from `org-export-get-min-level'.
(org-export--collect-headline-numbering): Renamed from
`org-export-collect-headline-numbering'.
(org-export--populate-ignore-list): Renamed from
`org-export-populate-ignore-list'.
(org-export--interpret-p): Renamed from `org-export--interpret-p'.
(org-export--prepare-file-contents): Renamed from
`org-export-prepare-file-contents'.
* contrib/lisp/org-e-publish.el (org-e-publish-find-date): Use new
  names.
* testing/lisp/test-org-export.el: Update tests.
2012-07-24 22:52:29 +02:00
Nicolas Goaziou 6ea9d8c827 org-export: `org-export-define-backend': the standard way to create a back-end
* contrib/lisp/org-export.el (org-export-define-backend): New macro.
* contrib/lisp/org-e-ascii.el: Use new macro.
* contrib/lisp/org-e-html.el: Use new macro.
* contrib/lisp/org-e-latex.el: Use new macro.
* contrib/lisp/org-e-odt.el: Use new macro.
* contrib/lisp/org-element.el (org-element-block-name-alist): Remove
  hard-coded export block names from variable, since they are added
  automatically by `org-export-define-backend'.
* testing/lisp/test-org-element.el: Update test.
2012-07-23 14:12:14 +02:00
Nicolas Goaziou 070e03011d org-element: Rename a few internal functions
* contrib/lisp/org-element.el (org-element--parse-elements): Renamed
  from `org-element-parse-elements'.
(org-element--parse-objects): Renamed from `org-element-parse-objects'.
(org-element--get-next-object-candidates): Renamed from
`org-element-get-next-object-candidates'.
(org-element--interpret-affiliated-keywords): Renamed from
`org-element-interpret--affiliated-keywords'.
(org-element--current-element): Renamed from
`org-element-current-element'.
(org-element--collect-affiliated-keywords): Renamed from
`org-element-collect-affiliated-keywords'.
(org-element-center-block-parser, org-element-drawer-parser,
org-element-dynamic-block-parser,
org-element-footnote-definition-parser, org-element-inlinetask-parser,
org-element-plain-list-parser, org-element-quote-block-parser,
org-element-special-block-parser, org-element-comment-parser,
org-element-comment-block-parser, org-element-example-block-parser,
org-element-export-block-parser, org-element-fixed-width-parser,
org-element-horizontal-rule-parser,
org-element-latex-environment-parser, org-element-paragraph-parser,
org-element-src-block-parser, org-element-table-parser,
org-element-verse-block-parser, org-element-fill-paragraph,
org-element-context, org-element-at-point, org-element-interpret-data,
org-element-parse-secondary-string, org-element-parse-buffer): Apply
name change.
* contrib/lisp/org-export.el (org-export-get-buffer-attributes): Apply
  name change.
* testing/lisp/test-org-element.el: Update tests accordingly.
* testing/lisp/test-org-export.el: Update tests accordingly.
2012-07-19 11:23:43 +02:00
Nicolas Goaziou 8769f9d014 org-element: Fix tests
* testing/lisp/test-org-element.el: Fix tests.  Some were failing with
  emacs 23.
2012-07-18 11:25:29 +02:00
Nicolas Goaziou a1634b4489 org-element: Store parsed timestamps without the bracket markers
* contrib/lisp/org-element.el (org-element-planning-parser): Store
  parsed timestamps without the bracket markers.
(org-element-timestamp-interpreter): Store parsed timestamps without
  the bracket markers.  Also provide a new property: `:range-end'.
(org-element-planning-interpreter, org-element-timestamp-interpreter):
Apply changes to parsers.
* testing/lisp/test-org-element.el: Add test.
2012-07-17 16:51:19 +02:00
Nicolas Goaziou 5a3617c6be org-export: Allow anonymous functions in translate alists
* contrib/lisp/org-export.el (org-export-transcoder, org-export-data):
  Allow anonymous functions in translate alists.
* testing/lisp/test-org-export.el: Update tests.
2012-07-15 21:29:38 +02:00
Nicolas Goaziou fd92868c13 org-export: Fix tests
* testing/lisp/test-org-export.el: Fix tests.
2012-07-12 23:36:01 +02:00
Nicolas Goaziou c75120aa71 org-element: Refactoring 2012-07-11 14:17:02 +02:00
Nicolas Goaziou d5f5c77fcd org-export: Small refactoring
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Small refactoring.
* testing/lisp/test-org-export.el: Add tests.
2012-07-10 19:22:04 +02:00
Nicolas Goaziou bb9a26389c org-element: Rename `org-export-set-element' into `org-element-set-element'
* contrib/lisp/org-element.el (org-element-set-element): New function.
* contrib/lisp/org-export.el (org-export-set-element): Removed function.
* testing/lisp/test-org-element.el: Add test.
* testing/lisp/test-org-export.el: Remove test.
2012-07-10 17:29:13 +02:00
Nicolas Goaziou d9f975cf7b org-element: Add setters to modify parse tree
* contrib/lisp/org-element.el (org-element-put-property,
  org-element-set-contents, org-element-adopt-element): New
  functions.
* testing/lisp/test-org-element.el: Add tests.
2012-07-10 17:23:33 +02:00
Nicolas Goaziou 3a70c90667 org-element: Implement a function to find object at point
* contrib/lisp/org-element.el (org-element-context): New function.
* testing/lisp/test-org-element.el: Add tests.
2012-07-07 00:49:13 +02:00
Nicolas Goaziou 73951db845 org-export: Add a subtree property for each export option
* contrib/lisp/org-export.el (org-export-get-subtree-options): Add
  a subtree property for each export option.
* testing/lisp/test-org-export.el: Add tests.

Properties names are obtained by adding "EXPORT_" prefix to buffer
keywords.
2012-07-05 13:44:26 +02:00
Nicolas Goaziou 9d3502e499 org-export: Add tests
* testing/lisp/test-org-export.el: Add tests.
2012-07-04 18:32:57 +02:00
Nicolas Goaziou ab82a9dcfe Update tests and comments for new snippet syntax
* contrib/lisp/org-export.el (org-export-snippet-translation-alist):
  Fix docstring.
(org-export-as): Fix code comment.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-export.el: Update tests.
2012-06-30 10:01:28 +02:00
Nicolas Goaziou bafe0fb295 org-export: Fix bug with default DATE value
* contrib/lisp/org-export.el (org-export-get-global-options): Parse
  default value from parsed keywords, too.
* testing/lisp/test-org-export.el: Change test accordingly.
2012-06-22 15:07:07 +02:00
Nicolas Goaziou 04ad4ab417 org-export: Follow EXPORT_TITLE property when exporting subtree
* contrib/lisp/org-export.el (org-export-get-subtree-options): Make
  sure point is at an headline and buffer isn't narrowed before
  looking for EXPORT_TITLE property.
* testing/lisp/test-org-export.el: Add test.
2012-06-18 01:34:57 +02:00
Nicolas Goaziou f2bfa3a6b2 org-element: Fix item interpreter when item doesn't start with a paragraph
* contrib/lisp/org-element.el (org-element-item-interpreter): Fix item
  interpreter when item doesn't start with a paragraph.
* testing/lisp/test-org-element.el: Add test.
2012-06-12 14:29:53 +02:00
Nicolas Goaziou 68a595ce9d org-export: Add `org-export-read-attribute' for normalized attr lines
* contrib/lisp/org-export.el (org-export-read-attribute): New function.
* testing/lisp/test-org-export.el: Add test.
2012-06-12 10:25:00 +02:00
Nicolas Goaziou e23f506d98 org-export: Add function to change elements in parse tree
* contrib/lisp/org-export.el (org-export-get-buffer-attributes):
  Ensure initial accumulator in non-nil.
(org-export-set-element): New function.
* testing/lisp/test-org-export.el: Add test.
2012-06-09 00:17:40 +02:00
Nicolas Goaziou af285d6c8c org-element: Add `:parent' property to elements/objects in parse tree
* contrib/lisp/org-element.el (org-element-parse-buffer): Correctly
  set original parent.
(org-element-parse-elements, org-element-parse-objects): Set `:parent'
property of each element/object.
* testing/lisp/test-org-element.el: Add tests.
2012-06-08 23:29:21 +02:00
Nicolas Goaziou bb63c7792a test-org-element: Fix src-block-interpreter test 2012-06-07 21:41:59 +02:00
Nicolas Goaziou 451191bc41 org-export: Correctly resolve fuzzy links whose path starts with *
* contrib/lisp/org-export.el (org-export-resolve-fuzzy-link):
  Correctly resolve fuzzy links whose path starts with *
* testing/lisp/test-org-export.el: Add tests.
2012-06-07 00:06:19 +02:00
Nicolas Goaziou ad235400a6 org-export: Support for external id links
* contrib/lisp/org-export.el (org-export-get-buffer-attributes):
  Retrieve footnote definitions and id in buffer.
(org-export-store-footnote-definitions): Removed function.
(org-export-collect-tree-properties): Update docstring.
(org-export-as): Do not call `org-export-store-footnote-definitions'.
(org-export-resolve-id-link): Return external file name when there's
no match for id in current parse tree.
* contrib/lisp/org-e-latex.el (org-e-latex-link): Handle external id
  links.
* testing/lisp/test-org-export.el: Add tests.
2012-06-06 23:39:04 +02:00
Nicolas Goaziou 09164e5c72 org-export: Hide select tags
* contrib/lisp/org-export.el (org-export-get-tags): New function.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title): Use new function.
* contrib/lisp/org-e-html.el (org-e-html-format-headline--wrap,
  org-e-html-headline): Use new function.
* contrib/lisp/org-e-latex.el (org-e-latex-headline,
  org-e-latex-inlinetask): Use new function.
* contrib/lisp/org-e-odt.el (org-e-odt-format-headline--wrap): Use new
  function.
* testing/lisp/test-org-export.el: Add tests.
2012-05-26 13:52:03 +02:00
Nicolas Goaziou 68744bf19f org-export: Fix selective export when a select tag is present
* contrib/lisp/org-export.el (org-export-populate-ignore-list): Fix
  docstring.
(org-export--selected-trees): Correctly search for headlines with
a select tag.
(org-export--skip-p): Fix selective export when a select tag is
present in the buffer.
* testing/lisp/test-org-export.el: Update tests.
2012-05-26 13:51:55 +02:00
Nicolas Goaziou 42f7ba0d02 org-element: Fix ill-defined keywords parsing
* contrib/lisp/org-element.el (org-element-comment-parser):
  Ill-defined keywords (without the colons) are treated as comments.
(org-element-comment-interpreter): Apply changes to lexer.
* testing/lisp/test-org-element.el: Add test.
2012-05-20 17:33:36 +02:00
Nicolas Goaziou c91bcb368f org-export: Fix macro expansion when back-end protects dollar signs
* contrib/lisp/org-export.el (org-export-get-inbuffer-options): Return
  an "eval" macro as a regular secondary string instead of a plain
  string.
(org-export-expand-macro): Replace arguments before exporting
them (and possibly protecting dollar signs).  Refactor code.
* testing/lisp/test-org-export.el: Add tests.
2012-05-20 12:18:16 +02:00
Nicolas Goaziou 51472b4d33 org-export: Implement `org-export-resolve-radio-link'
* contrib/lisp/org-export.el (org-export-resolve-coderef): New function.
* contrib/lisp/org-e-ascii.el (org-e-ascii-link): Use new function.
* contrib/lisp/org-e-html.el (org-e-html-link): Use new function.
* contrib/lisp/org-e-latex.el (org-e-latex-link): Use new function.
* contrib/lisp/org-e-odt.el (org-e-odt-link): Use new function.
* testing/lisp/test-org-export.el: Add tests.
2012-05-18 11:42:16 +02:00
Nicolas Goaziou 7421e96536 org-export: Remove naming convening for back-ends
* contrib/lisp/org-e-ascii.el (org-e-ascii-translate-alist): New variable.
* contrib/lisp/org-e-html.el (org-e-html-translate-alist): New
  variable.
(org-e-html-filters-alist): Move variable into an appropriate section.
* contrib/lisp/org-e-latex.el (org-e-latex-translate-alist): New variable.
* contrib/lisp/org-e-odt.el (org-e-odt-translate-alist): New variable.
(org-e-odt-option-alist): Move variable into an appropriate section.
* contrib/lisp/org-export.el (org-export-transcoder): Retrieve
  translators from `org-BACKEND-translate-alist' instead of applying
  a naming convention to each of them.
* testing/lisp/test-org-export.el: Update tests.
2012-05-18 11:42:15 +02:00
Nicolas Goaziou 5750f0869c org-element: Preserve visibility when moving elements
* contrib/lisp/org-element.el (org-element-swap-A-B): Preserve
  visibility when moving elements.
* testing/lisp/test-org-element.el: Add tests.
2012-05-11 16:07:11 +02:00
Nicolas Goaziou d71464c0d3 org-element: Handle multiple TBLFM keywords
* contrib/lisp/org-element.el (org-element-table-parser,
  org-element-table-interpreter): Handle multiple TBLFM keywords.
(org-element-collect-affiliated-keywords): Minor changes to
docstring.
* testing/lisp/test-org-element.el: Add test.
2012-05-11 15:17:14 +02:00
Nicolas Goaziou d308ea3172 org-element: Fix latex environment parsing
* contrib/lisp/org-element.el (org-element-latex-environment-parser):
  Grab value until closing of main environment block.
(org-element-current-element): Check if main block is properly closed.
* testing/lisp/test-org-element.el: Add test.
2012-05-10 23:05:42 +02:00
Nicolas Goaziou 56520a6936 Merge branch 'maint' 2012-05-09 23:34:05 +02:00
Nicolas Goaziou 0ebeb77a1a org-list: Add visibility tests
* testing/lisp/test-org-list.el: Add tests.
2012-05-09 23:33:17 +02:00
Nicolas Goaziou c2aac5f195 org-element: Add tests
* testing/lisp/test-org-element.el: Add tests.
2012-05-06 12:15:39 +02:00
Nicolas Goaziou e4c2540b68 org-element: Add a function to fill an element
* contrib/lisp/org-element.el (org-element-fill-paragraph): New function.
* testing/lisp/test-org-element.el: Add tests.
2012-05-05 17:43:42 +02:00
Nicolas Goaziou 88032eed64 org-element: `org-element-map' applies to strings and secondary strings
* contrib/lisp/org-element.el (org-element-map): `org-element-map' now
  applies to strings and secondary strings.
* testing/lisp/test-org-element.el: Add tests.
2012-05-05 17:43:42 +02:00
Nicolas Goaziou ed9a748057 org-element: Refactor navigation tools
* contrib/lisp/org-element.el (org-element-at-point,
  org-element-backward, org-element-up, org-element-down,
  org-element-drag-backward): Refactor.
(org-element-swap-A-B): Handle the case of the first paragraph in an
item.
(org-element-transpose): New function.
(org-transpose-elements): Removed function.
(org-element-unindent-buffer): Correctly un-indent contents of
headlines.
* testing/lisp/test-org-element.el: Add tests.
2012-05-05 09:15:33 +02:00
Nicolas Goaziou b137cdb296 org-element: Fix to footnote-definition parsing
* contrib/lisp/org-element.el (org-element-footnote-definition-parser):
Fix bug when parsing a footnote definition at end of buffer.
* testing/lisp/test-org-element.el: Add test.
2012-05-05 09:15:33 +02:00
Nicolas Goaziou d83ab52626 org-element: Refactor code, add tests
* contrib/lisp/org-element.el (org-element-babel-call-parser): Be sure
  to match "#+CALL:".
(org-element-block-name-alist): New variable.
(org-element-non-recursive-block-alist): Removed variable.
(org-element-current-element): Refactor.
* testing/lisp/test-org-element.el: Add tests.
2012-05-05 09:15:33 +02:00
Nicolas Goaziou 01d83dc1f4 org-export: Fix table export bug with cells made of only one object
* contrib/lisp/org-export.el (org-export-table-row-is-special-p,
  org-export-table-cell-width, org-export-table-cell-alignment):
  Ensure cell only contains a string before trying to match width
  cookie.
* testing/lisp/test-org-export.el: Modify tests accordingly.

Thanks to Eric Fraga for discovering and investigating about this.
2012-05-03 14:29:30 +02:00
Nicolas Goaziou f4791557e2 org-element: Store fixed-with and comment contents without markers
* contrib/lisp/org-element.el (org-element-comment-parser): Store
  comments without leading hash and maybe plus sign.
(org-element-fixed-width-parser): Store fixed-width contents without
leading colons.
(org-element-comment-interpreter,
org-element-fixed-width-interpreter): Apply changes.
* contrib/lisp/org-e-odt.el (org-e-odt-fixed-width): Apply changes to
  fixed-width `:value' property.
* contrib/lisp/org-e-latex.el (org-e-latex-fixed-width): Apply changes
  to fixed-width `:value' property.
* contrib/lisp/org-e-html.el (org-e-html-fixed-width): Apply changes
  to fixed-width `:value' property.
* contrib/lisp/org-e-ascii.el (org-e-ascii-fixed-width): Apply changes
  to fixed-width `:value' property.
* testing/lisp/test-org-element.el: Add tests.
2012-05-02 17:25:30 +02:00
Nicolas Goaziou 172d7a6f5e org-element: Apply `org-translate-link' when parsing a link
* contrib/lisp/org-element.el (org-element-link-parser): Apply
  `org-translate-link' when parsing a link.
* testing/lisp/test-org-element.el: Add test.
2012-05-01 15:47:14 +02:00
Nicolas Goaziou 32a5920e69 org-element: Internally store headline/inlinetask's tags as a list of strings
* contrib/lisp/org-element.el (org-element-headline-parser,
  org-element-headline-interpreter, org-element-inlinetask-parser,
  org-element-inlinetask-interpreter): Store headline/inlinetask's
  tags as a list of strings.
* contrib/lisp/org-export.el (org-export--selected-trees,
  org-export--skip-p): Use new tag representation.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
  org-e-ascii-format-inlinetask-function, org-e-ascii-inlinetask): Use
  new tag representation.
* contrib/lisp/org-e-html.el (org-e-html-format-headline-function,
  org-e-html-format-inlinetask-function, org-e-html--tags): Use new
  tag representation.
* contrib/lisp/org-e-latex.el (org-e-latex-format-headline-function,
  org-e-latex-format-inlinetask-function, org-e-latex-headline,
  org-e-latex-inlinetask): Use new tag representation.
* contrib/lisp/org-e-odt.el (org-e-odt-format-org-tags): Use new tag
  representation.
* testing/lisp/test-org-element.el: Update test.
2012-05-01 14:29:40 +02:00
Nicolas Goaziou 2ab6367daf org-element: Interpret correctly switches in example blocks
* contrib/lisp/org-element.el (org-element-example-block-interpreter):
  Interpret correctly switches in example blocks.
* testing/lisp/test-org-element.el: Add test.
2012-04-30 23:44:30 +02:00
Nicolas Goaziou 15315c5cc6 org-element: Fix src-block switches parsing
* contrib/lisp/org-element.el (org-element-src-block-parser): Fix
  switches parsing.
* testing/lisp/test-org-element.el: Add test.
2012-04-30 18:21:35 +02:00
Nicolas Goaziou 99a5d6bea8 org-element: Small fix to previous commit
* contrib/lisp/org-element.el (org-element-export-snippet-parser):
  Small fix.
* testing/lisp/test-org-export.el: Fix test.
2012-04-30 17:49:55 +02:00
Nicolas Goaziou 803d76825a org-element: Change to export-snippet syntax
* contrib/lisp/org-element.el (org-element-export-snippet-parser):
  Change syntax from @back-end{contents} to <back-end@contents>.
(org-element-export-snippet-successor): Use new syntax
* testing/lisp/test-org-element.el: Add test.

This change is required as curly braces conflict with LaTeX syntax
when trying to break a command in two parts.  On the other hand, HTML
tags can be broken easily in two.  More explicitely, both the
following constructs are possible now:

  <latex@\textsc{>Name<latex@}> and <html@<b>>
2012-04-30 17:34:01 +02:00
Nicolas Goaziou bea597be96 org-export: Add `active' and `inactive' alternatives to `org-export-with-timestamps'
* contrib/lisp/org-export.el (org-export-with-timestamps): Allow to
  keep only active timestamps or inactive ones with respectively
  `active' and `inactive' values.
(org-export--skip-p): Update tests to determine if a timestamp should
be ignored.
* testing/lisp/test-org-export.el: Add tests.
* contrib/lisp/org-element.el: Fix some comments.
2012-04-29 22:55:37 +02:00
Nicolas Goaziou 941f90a649 org-export: Export `clock' and `planning' elements
* contrib/lisp/org-export.el (org-export-option-alist): Add new
  filters.
(org-export-with-clocks, org-export-with-planning,
org-export-filter-clock-functions,
org-export-filter-planning-functions): New variables.
(org-export--skip-p): Skip `clock' and `planning' types depending on
export options.
* contrib/lisp/org-e-ascii.el (org-e-ascii-clock,
  org-e-ascii-planning): New functions.
(org-e-ascii-time-stamp): Update function.  Use `org-translate-time'.
* contrib/lisp/org-e-html.el (org-e-html-clock, org-e-html-planning):
  New functions.
(org-e-html-time-stamp): Update function.
* contrib/lisp/org-e-latex.el (org-e-latex-clock,
  org-e-latex-planning): New functions.
(org-e-latex-time-stamp): Update function.  Use `org-translate-time'.
* contrib/lisp/org-e-odt.el (org-e-odt-clock, org-e-odt-planning): New
  functions.
(org-e-odt-time-stamp): Update function.  Use `org-translate-time'.
* testing/lisp/test-org-export.el: Add tests.
2012-04-29 02:26:33 +02:00
Nicolas Goaziou 5cd9c01757 org-element: Add `clock' and `planning' element types
* contrib/lisp/org-element.el (org-element-babel-call-parser): Fix
  property name.
(org-element-babel-call-interpreter, org-element--element-block-re):
Fix docstring.
(org-element-clock-parser, org-element-clock-interpreter,
org-element-planning-parser, org-element-planning-interpreter): New
functions.
(org-element-time-stamp-parser): Move planning keywords out of the
object: no more `:appt-type' property
(org-element-time-stamp-interpreter,
org-element-time-stamp-successor): Apply changes to previous function.
(org-element-paragraph-separate): Time keywords also end paragraphs.
(org-element-all-elements): Register new elements types.
(org-element-current-element): Recognize new elements.
(org-element-parse-elements): Fix comments.
* testing/lisp/test-org-element.el: Add tests.
2012-04-29 02:26:33 +02:00
Nicolas Goaziou fd5f561a3e org-element: Fix block parsing
* contrib/lisp/org-element.el (org-element-current-element): Fix
  regexp for block boundaries.
* testing/lisp/test-org-element.el (test-org-element/block-switches):
  Fix test.
2012-04-28 21:12:30 +02:00
Nicolas Goaziou b21b6ead24 org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
  renamed from `org-e-html-emphasis-alist'.  Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
  Variable renamed from `org-e-latex-emphasis-alist'.  Change value
  type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
  org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
  New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
  for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 18:00:50 +02:00
Nicolas Goaziou 312e225685 org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
  org-e-ascii--build-caption, org-e-ascii--list-listings,
  org-e-ascii--list-tables, org-e-ascii--describe-links,
  org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
  org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
  org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
  provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
  org-e-html-footnote-section, org-e-html-template,
  org-e-html-dynamic-block, org-e-html-format-headline--wrap,
  org-e-html-headline, org-e-html-item, org-e-html-link,
  org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
  org-e-latex-template, org-e-latex-dynamic-block,
  org-e-latex-footnote-reference, org-e-latex-headline,
  org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
  org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
  org-e-odt-format-label, org-e-odt-write-manifest-file,
  org-e-odt--caption/label-string, org-e-odt-dynamic-block,
  org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
  org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
  org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
  back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.

Back-end can be found in communication channel with (plist-get
info :back-end).  Hence back-ends do not have to hard-code their name
in any transcoder.  It will allow to derive a back-end from another
one.
2012-04-28 11:41:15 +02:00
Nicolas Goaziou b3e8a8d437 org-export: Run a hook before parsing
* contrib/lisp/org-export.el (org-export-before-parsing-hook): New
  variable.
(org-export-as): Run `org-export-before-parsing-hook'.
* testing/lisp/test-org-export.el: Add test.
2012-04-28 09:35:12 +02:00
Nicolas Goaziou 41b2a2e766 org-element: Add tests 2012-04-27 19:02:02 +02:00
Nicolas Goaziou c6dc6e3d32 org-element: Verse blocks now contain objects
* contrib/lisp/org-element.el (org-element-verse-block-parser): Verse
  blocks now contain objects.
(org-element-verse-block-interpreter, org-element-current-element):
Apply changes to verse blocks.
(org-element-secondary-value-alist): Remove verse blocks from elements
with a secondary string.
* contrib/lisp/org-e-odt.el (org-e-odt-verse-block): Apply changes to
  verse blocks.
* contrib/lisp/org-e-latex.el (org-e-latex-verse-block): Apply changes
  to verse blocks.
* contrib/lisp/org-e-html.el (org-e-html-verse-block): Apply changes
  to verse blocks.
* contrib/lisp/org-e-ascii.el (org-e-ascii-verse-block): Apply changes
  to verse blocks.
* testing/lisp/test-org-element.el: Add tests.
2012-04-26 14:49:29 +02:00
Nicolas Goaziou 206ce6e0b5 org-element: Ignore blank lines when removing element indentation
* contrib/lisp/org-element.el (org-element-normalize-contents): Ignore
  blank and empty lines when removing element indentation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-26 14:49:29 +02:00
Nicolas Goaziou 172ae310a8 org-export: Define tools for tables, table rows and table cells
* contrib/lisp/org-export.el (org-export-table-cell-width,
  org-export-table-cell-alignment, org-export-table-cell-borders,
  org-export-table-row-group, org-export-table-has-special-column-p,
  org-export-table-row-is-special-p, org-export-get-parent-table,
  org-export-table-dimensions, org-export-table-cell-address,
  org-export-get-table-cell-at, org-export-table-has-header-p,
  org-export-table-cell-starts-colgroup-p,
  org-export-table-cell-ends-colgroup-p,
  org-export-table-row-starts-rowgroup-p,
  org-export-table-row-ends-rowgroup-p,
  org-export-table-row-starts-header-p,
  org-export-table-row-ends-header-p): New functions.
(org-export-table-format-info, org-export-clean-table): Removed
functions.
(org-export-filter-table-cell-functions,
org-export-filter-table-row-functions): New variables.
(org-export-filters-alist): Install new filters.
(org-export-collect-tree-properties, org-export--skip-p): Mark special
rows and cells as ignored.
* testing/lisp/test-org-export.el: Add tests.
2012-04-22 19:41:45 +05:30
Nicolas Goaziou eeeee5f1da org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
  into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
  org-element-inlinetask-parser, org-element-item-parser,
  org-element-verse-block-parser,
  org-element-footnote-reference-parser,
  org-element-collect-affiliated-keywords, org-element-parse-objects):
  Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-22 19:41:28 +05:30
Nicolas Goaziou 97b0696212 org-list: Fix bugs relative to item indentation
* lisp/org-list.el (org-list-struct-indent): Follow
  `org-list-demote-modify-bullet' specifications for ordered bullets.
(org-list-indent-item-generic, org-indent-item-tree,
org-outdent-item-tree): Fix bug when operating on a region.
(org-outdent-item, org-indent-item): Allow to operate on a region.
* lisp/org.el (org-shiftmetaleft, org-shiftmetaright): Allow to
  operate on a region.
* testing/lisp/test-org-list.el: Add tests.
2012-04-21 12:13:49 +02:00
Bastien Guerry b857974f7d Small reformatting of testing/README. 2012-04-21 00:59:14 +02:00
Nicolas Goaziou dbc6fd1ebf Merge branch 'hotfix' 2012-04-18 13:02:09 +02:00
Nicolas Goaziou 7d6309f132 org-list: Fix bugs relative to item indentation
* lisp/org-list.el (org-list-struct-indent): Follow
  `org-list-demote-modify-bullet' specifications for ordered bullets.
(org-list-indent-item-generic, org-indent-item-tree,
org-outdent-item-tree): Fix bug when operating on a region.
(org-outdent-item, org-indent-item): Allow to operate on a region.
* lisp/org.el (org-shiftmetaleft, org-shiftmetaright): Allow to
  operate on a region.
* testing/lisp/test-org-list.el: Add tests.
2012-04-18 13:01:44 +02:00
Eric Schulte 5e4cffbb06 code-block languages may specify their own headers and values
* lisp/ob-R.el (org-babel-header-args:R): Adding values.
* lisp/ob-clojure.el (org-babel-header-args:clojure): Adding values.
* lisp/ob-lisp.el (org-babel-header-args:lisp): Adding values.
* lisp/ob-sql.el (org-babel-header-args:sql): Adding values.
* lisp/ob-sqlite.el (org-babel-header-args:sqlite): Adding values.
* lisp/ob.el (org-babel-combine-header-arg-lists): Combine lists of
  arguments and values.
  (org-babel-insert-header-arg): Use new combined header argument
  lists.
  (org-babel-header-arg-expand): Add support for completing-read
  insertion of header arguments after ":"
  (org-babel-enter-header-arg-w-completion): Completing read insertion
  of header arguments
  (org-tab-first-hook): Adding header argument completion.
  (org-babel-params-from-properties): Combining header argument lists.
* testing/lisp/test-ob.el (ob-test/org-babel-combine-header-arg-lists):
  Test the new header argument combination functionality.
2012-04-13 08:43:16 -04:00
Nicolas Goaziou 36711b05ba org-export: Fix footnotes export outside parsing scope
* contrib/lisp/org-export.el (org-export-get-buffer-attributes):
  Function renamed from `org-export-initial-options'.
(org-export-store-footnote-definitions): New function.
(org-export-as): Store footnote definitions at the appropriate place.
It happens twice if buffer gets expanded.
* testing/lisp/test-org-export.el: Add test.
2012-04-13 15:47:13 +02:00
Nicolas Goaziou 97d2db4867 org-element: Fix interpretation of affiliated keywords
* contrib/lisp/org-element.el (org-element-interpret--affiliated-keywords):
  Fix interpretation of affiliated keywords.
(org-element-interpret-data): If no `:post-blank' property is
specified, assumed there is no blank line or whitespace after the
element or object.
* testing/lisp/test-org-element.el: Add a test.
2012-04-10 23:53:11 +02:00
Nicolas Goaziou d6faea24d4 org-footnote: Fix bug related to sorting and folded view
* lisp/org-footnote.el (org-footnote-delete-definitions): Remove blank
  lines before the footnote definition instead of removing those after
  it.
* testing/lisp/test-org-footnote.el: Adapt tests.
2012-04-08 12:01:57 +02:00
Nicolas Goaziou 8453ac1bf3 org-element: Remove dependency on org-footnote predicates
* contrib/lisp/org-element.el (org-element-footnote-definition-parser):
  Remove the need for `org-footnote-at-definition-p'.
  (org-element-footnote-reference-parser): Remove the need for
  `org-footnote-at-reference-p'.
(org-element-footnote-reference-successor): Do not use
`org-footnote-get-next-reference'.
* testing/lisp/test-org-element.el: Add test.
2012-04-06 23:50:00 +02:00
Nicolas Goaziou 4019559ee2 org-footnote: Don't grab trailing blank lines in a footnote definition
* lisp/org-footnote.el (org-footnote-at-definition-p): Don't grab
  trailing blank lines in a footnote definition.
(org-footnote-delete-definitions): Remove both footnote definition and
trailing blank lines.
* testing/lisp/test-org-export.el (test-org-export/fuzzy-links): Fix
  a docstring.
* contrib/lisp/org-element.el (org-element-footnote-definition-parser):
  Apply change to footnote definitions.
2012-04-06 19:14:51 +02:00
Eric Schulte 8d43aa2aa9 test the new file-desc header argument
* testing/lisp/test-ob.el (test-ob/file-desc-header-argument): Test
  the new file-desc header argument.
2012-03-31 15:00:35 -04:00
Ilya Shlyakhter 1977df99a4 Testing: Corrected the command to run batch tests given in README
testing/README (running batch tests): Added missing paths to the command.
   Make sure to load the org-mode code from the git checkout rather than
   whatever Org is installed in Emacs directories.

TINYCHANGE
2012-03-31 10:29:16 +02:00
Nicolas Goaziou 82281bcc94 org-element: Fix bug with `greater-element' granularity
* contrib/lisp/org-element.el (org-element-parse-elements): Enter
  section type elements even if granularity is set to
  `greater-element'.
(org-element-parse-buffer): Update doc-string.
* testing/lisp/test-org-element.el: Add test.
2012-03-28 17:29:14 +02:00
Nicolas Goaziou bb671936b5 org-element: Speed up parsing when granularity is bigger than default
* contrib/lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser, org-element-item-parser,
  org-element-verse-block-parser, org-element-current-element): New
  optional argument so parsing of secondary string is not mandatory.
(org-element-parse-elements): Remove duplicate part from doc-string.
(org-element-at-point): Improve speed of function since secondary
string are never parsed.
(org-element-secondary-value-alist): Simplify doc-string.
* testing/lisp/test-org-element.el: Add test.
2012-03-28 16:31:56 +02:00
Nicolas Goaziou 763991fbda org-element: Store keywords in upper cases
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-keyword): Apply keywords
  case change.
* EXPERIMENTAL/org-e-html.el (org-e-html-keyword): Apply keywords case
  change.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-keyword): Apply keywords
  case change.
* EXPERIMENTAL/org-e-odt.el (org-e-odt-keyword): Apply keywords case change.
* contrib/lisp/org-element.el (org-element-export-block-parser):
  Internally store type in upper cases.
(org-element-keyword-parser): Internally store keyword `:key' property
in upper cases.
(org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist, org-element-multiple-keywords,
org-element-parsed-keywords, org-element-dual-keywords):
Use uppercased keywords.
(org-element-current-element): Use uppercase for keywords.
(org-element-collect-affiliated-keywords): Store affiliated keywords
in upper cases.
* contrib/lisp/org-export.el (org-export-get-inbuffer-options,
  org-export-collect-tree-properties, org-export-resolve-fuzzy-link):
  Use upper cased keywords.
* testing/lisp/test-org-export.el: Update tests.
2012-03-28 14:27:15 +02:00
Eric Schulte a4efcc3a39 Merge branch 'origin-hotfix-7.8.06' 2012-03-27 07:12:17 -04:00
Eric Schulte dbe4bf805f fix bug in indented wrapped results insertion
* lisp/ob.el (org-babel-insert-result): Fix bug in indented wrapped
  results insertion.
* testing/lisp/test-ob.el (test-ob/org-babel-results-indented-wrap):
  Test correct indentation behavior.
2012-03-27 07:09:22 -04:00
Nicolas Goaziou 1581b16c78 org-element: Small refactoring
* contrib/lisp/org-element.el (org-element-swap-A-B,
  org-element-drag-backward, org-element-drag-forward): Small
  refactoring.
* testing/lisp/test-org-element.el: Add tests.
2012-03-22 19:32:09 +01:00
Nicolas Goaziou dd7aa8ece9 org-export: Fix export with Babel calls outside export scope
* contrib/lisp/org-export.el (org-export-as): Fix export with Babel
  calls outside export scope by providing buffer's name holding full
  data instead of the one holding its copy limited to scope.
* testing/lisp/test-org-export.el (test-org-export/export-scope): Add
  a test.
2012-03-22 16:49:19 +01:00
Bastien Guerry eb5a450686 test-ob-lilypond.el: Whitespace cleanup. 2012-03-21 15:27:23 +01:00
Bastien Guerry e19820b384 Merge branch 'hotfix-7.8.06'
Conflicts:
	lisp/ob-lilypond.el
	testing/lisp/test-ob-lilypond.el
2012-03-21 15:26:25 +01:00
Martyn Jago 988f742ccf Leave versioning to Org.
* lisp/ob-lilypond.el:
 Leave versioning to Org.

* testing/lisp/test-ob-lilypond.el:
 Leave versioning to Org.
2012-03-21 15:24:30 +01:00
Bastien Guerry 6c911234ac Remove files coming from maint. 2012-03-20 01:50:59 +01:00
Bastien Guerry df82832fb7 Merge maint fixup and finish master fixup 2012-03-20 00:35:55 +01:00
Bastien Guerry 4e5c24ea81 Delete files that sneaked in while fixing the master branch. 2012-03-19 23:48:07 +01:00
Bastien Guerry ecd0562c5f Fix the master branch.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.

This commit also bumps the version number to 7.8.06.

The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
2012-03-19 22:01:29 +01:00
Bastien Guerry c44e07a4fa Fix the maint branch.
Thanks to Achim Gratz for his precious help on this.
2012-03-19 20:27:28 +01:00
Bastien Guerry de42649f7b Manually revert maint to e85080.
e85080 is the last correct commit in the maint branch
before releasing 7.8.04.  The 7.8.05 release should be
done from this commit.
2012-03-17 16:28:46 +01:00
Bastien Guerry 73bb18ba37 Manually revert to the Release 7.8.04 tag. 2012-03-17 15:52:24 +01:00
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
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.
2012-03-17 14:34:01 +01:00
Eric Schulte 6cbcb80cce fix whitespace errors 2012-03-11 22:52:06 -06:00
Martyn Jago 2c623a0558 Make auditioning of midi and pdf generations asynchronous, and add easy pdf generation.
* 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.
2012-03-11 22:51:21 -06:00
Nicolas Goaziou beb024687b org-export: Remove useless INFO argument from `org-export-unravel-code'
* contrib/lisp/org-export.el (org-export-unravel-code): Remove INFO
  argument.  Fix a bug preventing code references to be properly
  recognized.
(org-export-format-code-default): Apply signature change.
(org-export-resolve-coderef): Fix a bug preventing code references to
be properly recognized.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-src-block): Apply signature
  change.
* testing/lisp/test-org-export.el: Add tests.
2012-03-10 20:25:32 +01:00
Nicolas Goaziou 06a1b8615d test-org-element: Fix a test about block switches 2012-03-10 13:46:35 +01:00
Nicolas Goaziou c7203b4142 org-export: Change source code handling API
* 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.
2012-03-10 13:42:46 +01:00
Nicolas Goaziou 86131a8b50 org-element: New `org-element-down' function
* contrib/lisp/org-element.el (org-element-down): New function.
* testing/lisp/test-org-element.el: Add test.
2012-03-09 19:47:50 +01:00
Nicolas Goaziou dbe69f26aa Merge branch 'maint' 2012-03-04 16:40:43 +01:00
Nicolas Goaziou b549c60065 test-org-footnote: Fix a broken test (part 2)
* testing/lisp/test-org-footnote.el: Fix
  `test-org-footnote/normalize-outside-org'.
2012-03-04 16:39:43 +01:00
Nicolas Goaziou 1b06c10e2c Merge branch 'maint' 2012-03-04 15:55:41 +01:00
Nicolas Goaziou f1a99ceddf test-org-footnote: Fix a broken test
* testing/lisp/test-org-footnote.el: Fix failing
  `test-org-footnote/normalize-outside-org'.
2012-03-04 15:53:55 +01:00
Nicolas Goaziou f18ea108aa test-org-export: Fix broken test
* testing/lisp/test-org-export.el (test-org-export/export-scope): In
  batch mode, `transient-mark-mode' must be turned on.
2012-03-04 14:38:57 +01:00
Nicolas Goaziou bf609d8844 org-export: Avoid duplicates in `org-export-collect-footnote-definitions'
* 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.
2012-03-04 11:57:16 +01:00
Eric Schulte 6fd14fe683 adding a test to protect the "results don't replace code block" functionality 2012-03-03 07:45:20 -07:00
Nicolas Goaziou baa7321d17 Merge branch 'maint' 2012-03-02 22:38:26 +01:00
Nicolas Goaziou 6b91eb9e65 org-footnote: Fix normalization of inline footnotes with no footnote section
* 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.
2012-03-02 22:37:12 +01:00
Nicolas Goaziou aa5db9dd65 test-org: Fix a broken test
* testing/lisp/test-org.el (test-org-export/fuzzy-links): Fix the "No
  link found" error.
2012-03-02 15:14:23 +01:00
Eric Schulte a3a48f698f ensure that test constants are loaded by org-test.el 2012-03-01 11:37:04 -07:00
Eric Schulte 618eb91e12 fully remove contrib/ from the test infrastucture 2012-03-01 11:28:46 -07:00
Nicolas Goaziou 933c0fa441 Implement numbered cross-references
* 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.
2012-03-01 14:49:53 +01:00
Nicolas Goaziou b2fb61cd56 Merge branch 'maint' 2012-02-29 21:04:52 +01:00
Nicolas Goaziou bdb66b4c61 org-list: Fix small bug
* lisp/org-list.el (org-list-struct): Fix small bug introduced by
  commit 8b7a3f2498.
* testing/lisp/test-org-list.el: Add test.
2012-02-29 21:04:15 +01:00
Nicolas Goaziou 73c5044963 org-export: Add `org-export-headline-numbered-p' predicate
* 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.
2012-02-29 19:05:45 +01:00
Nicolas Goaziou 8740f212d0 Move two test files into common test directory
* 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.
2012-02-29 18:39:32 +01:00
Eric Schulte 87fe06b313 removing trailing ")"s 2012-02-29 09:10:08 -07:00
Eric Schulte 3234811c49 cleaning headers of test files -- removing loads and requires 2012-02-29 09:10:08 -07:00
Nicolas Goaziou c166bfbb1a org-export: fix bug with nested footnotes in invisible definitions
* contrib/lisp/org-export.el (org-export-collect-footnote-definitions):
  Also collect footnotes in footnote definitions
(org-export-get-footnote-number): Remove unused check.
* testing/contrib/lisp/test-org-export.el: Add test.
2012-02-26 10:57:42 +01:00
Nicolas Goaziou 12c94310a2 org-export: Allow nested footnotes (part 2)
* 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.
2012-02-26 01:38:26 +01:00
Nicolas Goaziou 81cc6dff19 org-e-latex: Allow nested footnotes
* 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.
2012-02-25 14:56:37 +01:00
Nicolas Goaziou 5313dc9d09 org-export: Allow user to explicitely ignore parts of parse tree
* 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.
2012-02-25 14:55:21 +01:00
Nicolas Goaziou 752a531eb5 org-element: Refactor code 2012-02-24 22:33:16 +01:00
Nicolas Goaziou 404ede23fc org-element: Change algorithm for `org-element-at-point'
* contrib/lisp/org-element.el (org-element-at-point): Change
  algorithm.
(org-element-guess-type): Removed function.
(org-element--element-block-types): Removed variable.
(org-element-forward, org-element-backward, org-element-up): Rewrite
functions.
* testing/contrib/lisp/test-org-element.el: Add tests.
2012-02-24 17:52:43 +01:00
Nicolas Goaziou 94185eac92 org-export: Fix bug with recursive file inclusion and relative paths
* 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.
2012-02-23 21:28:15 +01:00
Nicolas Goaziou 0fa24209cf org-export: Export snippets are not skipped automatically: back-ends decide
* 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.
2012-02-23 18:21:29 +01:00
Nicolas Goaziou 8714fba308 org-element: COMMENT and QUOTE keywords, ARCHIVE tags are case sensitive
* 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.
2012-02-23 16:30:06 +01:00
Nicolas Goaziou 675713c539 org-export: Fix select-tag handling
* 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.
2012-02-23 14:57:16 +01:00
Nicolas Goaziou a87c463818 org-element: Move archived tree handling out of org-element-map
* 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.
2012-02-23 11:24:58 +01:00
Nicolas Goaziou a940e3d22c org-export: Fix some small bugs, include tests
* 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.
2012-02-23 00:58:55 +01:00
Eric Schulte deb6e7a61e fixed test case broken by merge 2012-02-19 09:42:29 -07:00
Eric Schulte 3de3c470d8 Merge branch 'origin-maint'
Conflicts:
	contrib/lisp/org-mac-link-grabber.el
	doc/org.texi
	lisp/org-odt.el
	testing/lisp/test-ob.el
2012-02-19 09:36:13 -07:00
Martyn Jago 2189b9ac47 Regression tests regarding code block results and result removal/replacement.
* testing/lisp/test-ob.el:

Regression tests regarding code block results and result removal/replacement

Conflicts:

	testing/lisp/test-ob.el
2012-02-19 09:07:03 -07:00
Martyn Jago 50a35c42db Fix `org-babel-result-end' command to provide consistent result removal where result is type `wrap'.
* 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
2012-02-19 08:27:56 -07:00
Martyn Jago 059bb972d1 Modify macro `org-test-with-temp-text-in-file' to work on emacs 22. * testing/org-test.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'
2012-02-19 08:19:14 -07:00