Commit Graph

307 Commits

Author SHA1 Message Date
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
Eric Schulte 2b2e853b1b fixed bug in org-babel-balanced-split when run on Emacs22
Thanks to Martyn Jago for the test case

* lisp/ob.el (org-babel-balanced-split): Explicit checking if list
  before calling member.
* testing/lisp/test-ob.el (test-ob/org-babel-balanced-split): Testing
  the new Emacs22-proof behavior.
2012-02-19 08:01:26 -07:00
Eric Schulte 47eb35bb89 tests of fixed subtree property accumulated behavior 2012-02-15 08:12:35 -07:00
Eric Schulte 571d26e5ca marking test as expected to fail given that it relies on the new export engine
* testing/lisp/test-ob-exp.el (ob-exp/export-from-a-temp-buffer):
  Marking test as expected to fail given that it relies on the new
  export engine
2012-02-03 09:43:43 -07:00
Eric Schulte 72fe32f17b test org-current-export-file->buffer behavior
Conflicts:

	testing/lisp/test-ob-exp.el: Resolving conflicts.
2012-02-03 09:38:28 -07:00
Eric Schulte a3e5f97ee7 New strip-export noweb header argument value
* lisp/ob-exp.el (org-babel-exp-src-block): Strip noweb references on
  export when "strip-export".
* lisp/ob.el (org-babel-common-header-args-w-values): New noweb
  header value.
  (org-babel-merge-params): New noweb header value.
  (org-babel-noweb-p): New noweb header value.
* testing/examples/babel.org (an): Testing new noweb header value.
* testing/lisp/test-ob-exp.el (ob-exp/noweb-strip-export-ensure-strips):
  Testing new noweb header value.
* doc/org.texi (noweb): Document new noweb header value.
2012-02-01 08:19:29 -07:00
Eric Schulte d03b013e2c Merge branch 'origin-maint'
Conflicts:
	testing/lisp/test-ob.el
2012-01-30 09:02:51 -07:00
Eric Schulte eb02808f97 splitting large tests up into smaller units
This make it easier to track down the cause of failing tests.
2012-01-30 08:54:25 -07:00
Eric Schulte 660e30b39c inline src block tests by Martyn Jago
* testing/lisp/test-ob.el (test-org-babel/inline-src_blk-preceded-punct):
  Inline src block tests by Martyn Jago.
2012-01-30 08:51:17 -07:00
Eric Schulte 9fb3e136d8 adding a "troubleshooting" section to the testing README 2012-01-28 15:51:57 -07:00
Eric Schulte 106e1b6477 renamed the testing README 2012-01-28 15:38:19 -07:00
Eric Schulte e1d0311dd4 greatly simplified the testing README 2012-01-28 15:38:03 -07:00
Eric Schulte 85974ce727 killing all of the test buffers 2012-01-24 09:41:21 -07:00
Martyn Jago c82ca2f19a 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.
2012-01-24 09:36:40 -07:00
Eric Schulte b0eebd1ae1 be a little nicer about burying buffers used in running tests 2012-01-24 09:35:40 -07:00
Eric Schulte 2395c3eff1 Merge branch 'origin-maint' 2012-01-24 00:02:52 -07:00
Eric Schulte a706f42403 update tests 2012-01-24 00:02:33 -07:00
Eric Schulte 527e6844cc optionally export additional information with call lines
* lisp/ob-exp.el (org-babel-exp-call-line-template): Control export of
  additional call line information.
  (org-babel-exp-non-block-elements): Fancier call line export.
* testing/examples/babel.org (an): Example data to test new call line
  export.
* testing/lisp/test-ob-exp.el (ob-exp/export-call-line-information):
  Test new call line export.
2012-01-23 12:53:15 -07:00
Eric Schulte d3538624e7 Merge branch 'origin-maint'
Conflicts:
	lisp/ob-exp.el
	testing/examples/babel.org
2012-01-23 10:46:03 -07:00
Eric Schulte 43abeaa488 evaluate all executables in buffer order on export
* lisp/ob-exp.el (org-babel-exp-non-block-elements): Map over both
  inline src blocks and call lines on export.
2012-01-23 10:39:38 -07:00
Eric Schulte 10f26fb805 Merge branch 'origin-maint' 2012-01-20 12:00:31 -07:00
Litvinov Sergey f92facd890 Map "screen" to shell-script-mode 2012-01-20 11:47:13 -07:00
Eric Schulte 94f10ddfd7 don't always replace <<noweb>> references when :exports both
* lisp/ob-exp.el (org-babel-exp-results): Alter a copy of info.
* testing/examples/babel.org (an): Example data for test behavior.
* testing/lisp/test-ob-exp.el (ob-exp/noweb-no-export-and-exports-both):
  Confirm proper behavior.
2012-01-16 20:39:12 -07:00
Eric Schulte 4ce9b8044c test for customizable code block export 2012-01-14 12:41:40 -07:00