Commit Graph

636 Commits

Author SHA1 Message Date
Nicolas Goaziou ed516e65dc org-export: Fix failing test
* testing/lisp/test-org-export.el: Fix failing test.
2013-01-30 21:32:50 +01:00
Yasushi SHOJI 8e8f40ce2f testing/README: Fix instructions
TINYCHANGE
2013-01-30 17:35:09 +01:00
Nicolas Goaziou 423756dd11 org-export: Generalize fallback footnote definition to all exporters
* contrib/lisp/org-export.el (org-export-get-footnote-definition):
  Provide a fallback definition when none can be found.
* contrib/lisp/org-e-latex.el (org-e-latex-footnote-reference): Revert
  change made in 30ef385ee0 since it is
  now handled at the export framework level.
* testing/lisp/test-org-export.el: Add test.
2013-01-30 14:22:35 +01:00
Nicolas Goaziou bb40d29b45 org-export: Fix subtree export when parent section is empty
* contrib/lisp/org-export.el (org-export--get-subtree-options): When
  point is at an headline and subtree export is called, make sure
  export properties are extracted from parent headline.
* testing/lisp/test-org-export.el: Add test.
2013-01-26 18:05:56 +01:00
Nicolas Goaziou 0cf7179430 Revert "org-element: Change return value for element at point in some corner cases"
This reverts commit 13e49a6385.

Conflicts:
	lisp/org-element.el
2013-01-21 21:51:39 +01:00
Nicolas Goaziou 13e49a6385 org-element: Change return value for element at point in some corner cases
* lisp/org-element.el (org-element-at-point): When point is before any
  element, in the first blank lines of the buffer, return nil.  When
  point is within blank lines just after a headline, return that
  headline.
(org-element-context): Return nil when point is within the blank at
the beginning of the buffer.
* testing/lisp/test-org-element.el: Add tests.
2013-01-19 23:34:59 +01:00
Nicolas Goaziou 9d26797448 Move functions operating on timestamp objects into org.el
* contrib/lisp/org-export.el (org-export-timestamp-has-time-p,
  org-export-format-timestamp, org-export-split-timestamp-range,
  org-export-translate-timestamp): Removed functions.
* lisp/org.el (org-timestamp-has-time-p, org-timestamp-format,
  org-timestamp-split-range, org-timestamp-translate): New functions.
* contrib/lisp/org-e-ascii.el (org-e-ascii-timestamp): Apply move.
* contrib/lisp/org-e-groff.el (org-e-groff-timestamp): Apply move.
* contrib/lisp/org-e-html.el (org-e-html-timestamp): Apply move.
* contrib/lisp/org-e-latex.el (org-e-latex-timestamp): Apply move.
* contrib/lisp/org-e-odt.el (org-e-odt--format-timestamp,
  org-e-odt-timestamp): Apply move.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-timestamp): Apply move.
* testing/lisp/test-org-export.el: Remove tests.
* testing/lisp/test-org.el: Add tests.
2013-01-13 10:01:05 +01:00
Nicolas Goaziou b68103a344 org-element: Correctly interpret timestamps ranges with repeaters
* lisp/org-element.el (org-element-timestamp-interpreter): Interpret
  timestamps ranges with repeaters.
* testing/lisp/test-org-element.el: Add test.
2013-01-10 14:02:19 +01:00
Nicolas Goaziou 2fd88bfd56 org-element: Small optimization to `org-element-context'
* lisp/org-element.el (org-element-context): Add an optional argument
  so (org-element-context)
  and (org-element-context (org-element-at-point)) are equivalent.
* testing/lisp/test-org-element.el: Add test.
2013-01-09 15:33:29 +01:00
Bastien Guerry b54d6f5965 Merge branch 'maint'
Conflicts:
	lisp/org-agenda.el
	lisp/org.el
	testing/lisp/test-org-element.el
2013-01-07 16:19:37 +01:00
Bastien Guerry b27a020a83 `org-float' is now obsolete
* org-agenda.el (org-float): Don't alias `org-float'.

* org.texi (Timestamps, Deadlines and scheduling): Use
`diary-float' instead of the now obsolete alias `org-float'.

* test-org-element.el
(test-org-element/timestamp-interpreter): Ditto.
2013-01-07 13:01:36 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Bastien Guerry e1c491e72d org.el (org-parse-time-string): Parse <+1w> and friends
* org.el (org-parse-time-string): Allow strings supported by
tags/properties matcher (eg <now>, <yesterday>, <-7d>).

* test-org.el (test-org/org-parse-time-string): New test.

This is based on Ilya's commit 001bcb9.  This commit was
wrong because active timestamps were not parsed correctly
anymore.  This commit handles them correctly.

Thanks to Ivan Vilata i Balaguer for pushing this forward.
2012-12-30 10:27:02 +01:00
Michael Brand a77442b37b Use nan for empty fields in Calc formulas
* doc/org.texi (Formula syntax for Calc): Add explanation and example
for empty field.
* lisp/org-table.el (org-table-eval-formula): Use `keep-empty' in more
places.
(org-table-make-reference): Use nan (not a number) for empty fields in
Calc formulas.
* testing/lisp/test-org-table.el: Adapt expected for several
ert-deftest.
(test-org-table/empty-field): New examples dealing with empty fields.
(test-org-table/copy-field): New ert-deftest with examples dealing with
empty fields.

This makes it possible to write spreadsheet Calc formulas that check
for empty fields:  To sum the first two columns unless one or both
empty:
$3 = if("$1" = "nan" || "$2" = "nan", string(""), $1 + $2); E
2012-12-29 14:33:52 +01:00
Michael Brand 764315b3fc org-table.el: Fix range len bugs and inconsistencies
* lisp/org-table.el (org-table-eval-formula): Keep empty fields during
preprocessing.
(org-table-make-reference): A range with only empty fields should not
always return 0 but also empty string, consistent with field reference
of an empty field.  Use future design for nan but replicate current
behavior.
* testing/lisp/test-org-table.el: Adapt expected for several
ert-deftest.

The range len bugs may lead to wrong calculations for range references
with empty fields when the range len is relevant.  Affects typically
Calc vmean on simple range and without format specifier EN.  Also
Lisp with e. g. `length' on simple range or with L.
2012-12-29 14:33:52 +01:00
Michael Brand f5dd9a8a7a Add ERTs for basic spreadsheet functionality
* doc/org.texi (Formula syntax for Calc): Extend explanations of
format specifiers.
* testing/lisp/test-org-table.el: Various new ert-deftest, mark with
TODO what needs to be fixed.
2012-12-29 14:33:52 +01:00
Michael Brand 0ce406151f Extend org-table-number-regexp
* lisp/org-table.el (org-table-number-regexp): Extend 0x hex to
fixed-point number, add <radix>#<number>, add Calc infinite numbers
uinf, -inf and inf.
* testing/lisp/test-org-table.el (test-org-table/align): Adapt
alignment.
2012-12-29 14:33:52 +01:00
Michael Brand ce1a8465b5 Add ERT for table alignment within Org buffer
* testing/lisp/test-org-table.el (test-org-table/align): New
ert-deftest for table alignment within Org buffer.
* testing/org-test.el (org-test-table-target-expect): New defun.

The new function org-test-table-target-expect is to simplify writing
spreadsheet ERT by providing just a target table to apply the formula
to, the expected result table and the table formula with optionally
additional variants.  The variants typically are to check the same
result with a Lisp formula and a Calc formula.  test-org-table.el is
also a howto example collection as a user documentation.
2012-12-29 14:33:52 +01:00
Michael Brand 710f445768 testing/README: add howto run ERT partially
* testing/README (Interactive testing from within Emacs): Add a
description how to run a single ERT or all tests of a single test
file.
2012-12-29 14:33:52 +01:00
Bastien Guerry 3b9c1a0008 test-org-src.el (test-org-src/blank-line-block): Fix test
* test-org-src.el (test-org-src/blank-line-block): Fix test.
2012-12-21 09:36:20 +01:00
Bastien Guerry 72c2dc07a8 test-ob-exp.el (ob-exp/exports-inline): Fix test
* test-ob-exp.el (ob-exp/exports-inline): Fix test.
2012-12-21 08:55:14 +01:00
Bastien Guerry 24dea073bc Merge branch 'maint'
Conflicts:
	testing/lisp/test-ob-exp.el
2012-12-20 18:56:27 +01:00
Bastien Guerry 2824e1fd1d Update the tests wrt previous commit.
* test-org-exp.el (test-org-exp/stripping-commas): Update the
list of args for org-export-as-* functions.

* test-ob-lob.el (test-ob-lob/export-lob-lines): Ditto.

* test-ob-exp.el (ob-exp/noweb-on-export)
(ob-exp/noweb-on-export-with-exports-results)
(ob-exp/exports-both, ob-exp/mixed-blocks-with-exports-both)
(ob-exp/export-with-name)
(ob-exp/export-with-header-argument)
(ob-exp/evaluate-all-executables-in-order)
(ob-exp/noweb-strip-export-ensure-strips)
(ob-exp/export-from-a-temp-buffer): Ditto.
2012-12-20 18:54:57 +01:00
Bastien Guerry fcd269baa8 test-ob-exp.el (ob-exp/mixed-blocks-with-exports-both): Fix test
* test-ob-exp.el (ob-exp/mixed-blocks-with-exports-both): Fix test.

Thanks to Nick Dokos for reporting this.
2012-12-20 01:33:04 +01:00
Nicolas Goaziou 27f06c104e org-export: Implement function to locally override translation table
* contrib/lisp/org-export.el (org-export-data-with-translations,
  org-export-data-with-backend): New functions.
* testing/lisp/test-org-export.el: Add tests.
2012-12-19 17:48:51 +01:00
Nicolas Goaziou f1bb17549b org-element: Add tests
* testing/lisp/test-org-element.el: Add tests.
2012-12-18 22:16:01 +01:00
Nicolas Goaziou 442b2ad15d Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2012-12-16 00:49:22 +01:00
Nicolas Goaziou 20839ced71 org-element: Fix parsing of a list in a block in a list
* lisp/org-element.el (org-element--parse-elements,
  org-element-at-point): Fix parsing of a list in a block in a list.
* testing/lisp/test-org-element.el: Add test.
2012-12-16 00:45:17 +01:00
Bastien Guerry fa0e8feea8 org-test.el (org-test-with-temp-text-in-file): Wrap ,@body into (progn ...).
* org-test.el (org-test-with-temp-text-in-file): Wrap ,@body
into (progn ...) so that tests don't have to wrap it themselves.

Fix the testing suite to use this.
Also fix formatting and trailing whitespaces.
Fix test-org-src/blank-line-block so that it
checks editing of a code block with a whitespace
with point on the #+begin_src line.

Thanks to Michael Brand for spotting the (progn ...) problem.
2012-12-15 08:49:23 +01:00
Bastien Guerry c8452bfca0 Merge branch 'maint' 2012-12-15 08:05:02 +01:00
Bastien Guerry c0675b478e test-org-src.el: Fix a test.
* lisp/test-org-src.el (test-org-src/blank-line-block): Use
`org-test-with-temp-text-in-file' because `org-in-src-block-p'
checks against an Org mode text property.  Don't check for the
word at point.

Thanks to Nick Dokos for reporting this failed test.
2012-12-15 08:04:43 +01:00
Bastien Guerry 8f3b8ee44c testing/org-test.el: Fix `org-test-with-temp-text'.
* org-test.el (org-test-with-temp-text): No need to kill a
temporary buffer.  Don't use (prog1 ,@body ...), only expand
,@body.

Thanks to Nick Dokos for pointing this.
2012-12-15 08:00:30 +01:00
Bastien Guerry ac1b11753f Merge branch 'maint' 2012-12-13 17:24:31 +01:00
Bastien Guerry 70b0f422b4 Fix copyright notices for test files. 2012-12-13 17:24:19 +01:00
Le Wang a0cb4a3edc add tests for org-src-edit 2012-12-13 17:18:50 +01:00
Nicolas Goaziou b1f36921d7 org-export: Allow to retrieve all previous/next exportable objects
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Allow to retrieve all previous/next
  exportable objects by specifying a non-nil, non positive integer
  argument.
* testing/lisp/test-org-export.el: Add tests.
2012-12-10 08:54:52 +01:00
Nicolas Goaziou cbb96d69d3 org-export: Add an optional argument to previous an next elements getters
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Change signature.
* testing/lisp/test-org-export.el: Add tests.
2012-12-08 18:57:10 +01:00
Achim Gratz 29117be8b2 Fix new test for clocktables
* testing/lisp/test-org-clock.el (test-org-clock/clocktable): The last test
  for clocktables introduced in commit 6642177 did not work if the test was
  run before 15:00 due to the end time being specified as "<now>" (which
  includes the current time of day and not just the date).  The obvious
  "<today>" does also not work since it means 0:00 of the current day.  The
  correct specification to use is "<tomorrow>", which is 0:00 the following
  day or equivalently the end of today, 24:00.
2012-12-07 19:50:01 +01:00
Nicolas Goaziou 31052f1c91 Fix radio targets detection
* lisp/org.el (org-all-targets): Fix radio targets detection when
  object is directly followed by a non-whitespace character.

* testing/lisp/test-org.el: Add test.
2012-12-04 23:50:26 +01:00
Nicolas Goaziou 6642177dee org-clock: Add tests for clocktable relative times
* testing/lisp/test-org-clock.el: New file.
2012-11-30 16:28:00 +01:00
Nicolas Goaziou 09cfdb8260 Merge branch 'maint' 2012-11-28 16:52:27 +01:00
Nicolas Goaziou f3a2515205 test-org: Disambiguate tests for `org-end-of-line'. 2012-11-28 16:51:47 +01:00
Nicolas Goaziou 6859b352a4 Merge branch 'maint' 2012-11-28 14:05:39 +01:00
Nicolas Goaziou 97508e72dd test-org: Attempt to fix failing test on 24.3 pre-release 2012-11-28 14:04:21 +01:00
Nicolas Goaziou a51b8fa308 org-element: Fix timestamp interpreter
* lisp/org-element.el (org-element-timestamp-interpreter): Fix
  timestamp interpreter when raw value isn't available.
* testing/lisp/test-org-element.el: Update test.
2012-11-25 01:16:39 +01:00
Nicolas Goaziou ce8819f18d Merge branch 'maint' 2012-11-23 23:49:19 +01:00
Nicolas Goaziou 89b8a8ca6d org-element: Fix `org-element-context'
* lisp/org-element.el (org-element-context): When point is between two
  objects, be sure to return the second one.
* testing/lisp/test-org-element.el: Add test.
2012-11-23 23:46:52 +01:00
Nicolas Goaziou 0a142efdde org-export: Add tools for timestamps objects
* contrib/lisp/org-export.el (org-export-split-timestamp-range,
  org-export-translate-timestamp): New functions.
* testing/lisp/test-org-export.el: Add tests.
2012-11-23 18:41:58 +01:00
Nicolas Goaziou cb32494e24 org-element: Timestamp with time range has active/inactive-range type
* lisp/org-element.el (org-element-timestamp-parser): Timestamp with
  time range has active/inactive-range type.
* testing/lisp/test-org-element.el: Add test.

In order to know if starting date/time is really the same as ending
date/time, this patch permits to use the following:

  (memq (org-element-property :type timestamp) '(active inactive))
2012-11-22 22:32:48 +01:00
Nicolas Goaziou 1a0f8b5c8b org-export: Add tools for timestamps
* contrib/lisp/org-export.el (org-export-timestamp-has-time-p,
  org-export-format-timestamp): New functions.
* testing/lisp/test-org-export.el: Add tests.
2012-11-19 21:52:32 +01:00
Nicolas Goaziou 5107ca3c9b org-export: Fix subtree option with `split' behaviour
* contrib/lisp/org-export.el (org-export--get-subtree-options): Store
  value of options with `split' behaviour as a list of strings, not
  simply as a string.  Small refactoring.
* testing/lisp/test-org-export.el: Add tests.
2012-11-18 14:44:20 +01:00
Nicolas Goaziou 74faf5bd26 org-export: New `org-export-derived-backend-p' predicate
* contrib/lisp/org-export.el (org-export-define-derived-backend): Add
  `:parent' property to derived backend.
(org-export-derived-backend-p): New function.
* testing/lisp/test-org-export.el: Add tests.

This function can be useful in filters implemation. I.e.

  (defun my-filter (contents backend info)
    (when (memq backend '(e-latex e-beamer some-derived-backend-from-latex))
      ...))

can be replaced with:

  (defun my filter (contents backend info)
    (when (org-export-derived-backend-p backend 'e-latex)
      ...))
2012-11-17 13:33:38 +01:00
Nicolas Goaziou b46b5d1c44 org-element: Return nil for unspecified time values
* lisp/org-element.el (org-element-timestamp-parser): Return nil for
  unspecified :hour-end and :minute-end properties.
* testing/lisp/test-org-element.el: Add tests.
2012-11-15 21:02:26 +01:00
Nicolas Goaziou 3d56f56399 org-export: Internal changes to back-end definition
* contrib/lisp/org-export.el (org-export-registered-backends): New
  variable.
(org-export-define-backend, org-export-define-derived-backend): Use
new variable. Also redefine how sub-menus are defined.
(org-export-backend-filters, org-export-backend-menu,
org-export-backend-options, org-export-backend-translate-table): New
functions.
(org-export-get-environment, org-export--parse-option-keyword,
org-export--get-subtree-options, org-export--get-inbuffer-options,
org-export--get-global-options, org-export-install-filters,
org-export-with-backend): Access to data stored in new variable.
(org-export-dispatch-ui): Display sub-menus according to new
definition.
(org-export-dispatch-menu-entries): Removed variable.
* contrib/lisp/org-e-beamer.el: Use new sub-menu definition.
(org-e-beamer--format-section, org-e-beamer-item,
org-e-beamer-keyword): Use `org-export-with-backend' instead of
relying on removed variables.
* testing/lisp/test-org-export.el: Update tests.

This patch gets rid of "invisible" variables, that is variables
defvar'ed within a macro.
2012-11-13 23:25:08 +01:00
Nicolas Goaziou 0421be2cee Merge branch 'maint' 2012-11-13 15:46:33 +01:00
Nicolas Goaziou 5dbccdb432 org-list: Fix infloop when inserting an item
* lisp/org-list.el (org-list-separating-blank-lines-number): When
  computing number of blank lines separating items, also count those
  in unparsed blocks, like example blocks.
* testing/lisp/test-org-list.el: Add tests.

In the following situation, with `org-blank-before-new-entry' set to
`auto' for `plain-list-item, a blank line should be inserted when
inserting the following item:

- item1
  #+BEGIN_EXAMPLE

  contents

  #+END_EXAMPLE
2012-11-13 15:45:09 +01:00
Nicolas Goaziou 94605246e5 Merge branch 'maint' 2012-11-09 02:47:23 +01:00
Toby S. Cubitt 2aeb28d2af Bug fix in org-beginning-of-line visual line motion
* lisp/org.el (org-beginning-of-line): check `visual-line-mode'
instead of `line-visual-mode' to determine whether to move by visual
lines.

* lisp/org.el (org-kill-line): use of org-bound-and-true-p macro.

* testing/lisp/test-org.el: Add test
2012-11-09 02:46:21 +01:00
Nicolas Goaziou 5acffad561 Merge branch 'maint' 2012-11-05 00:58:34 +01:00
Nicolas Goaziou f48a8b7bf8 Fix end of line function called on an hidden block
* lisp/org.el (org-end-of-line): On a hidden block make sure to
  delegate motion to `end-of-line' instead of `move-end-of-line' in
  order to stay on the current line.
* testing/lisp/test-org.el: Update test.
2012-11-05 00:57:56 +01:00
Nicolas Goaziou 5d4243bccc org-export: Run a hook just before expanding include keywords and macros
* contrib/lisp/org-export.el (org-export-before-processing-hook): New
  variable.
(org-export-as): Run a hook just before expanding include keywords and
macros, and evaluating Babel blocks.
* testing/lisp/test-org-export.el: Add test.
2012-11-02 14:06:50 +01:00
Nicolas Goaziou 22ac03bee5 org-export: Add a function to retrieve category of an element or object
* contrib/lisp/org-export.el (org-export-get-category): New function.
* testing/lisp/test-org-export.el: Add tests.
2012-11-02 13:44:46 +01:00
Nicolas Goaziou 32c3456020 org-export: Fix previous/next element finding in secondary strings
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Correctly retrieve previous and next
  object, if any, in secondary strings.
* testing/lisp/test-org-export.el: Add tests.
2012-10-31 13:21:16 +01:00
Nicolas Goaziou 1a7610ed98 org-export: Add FILETAGS when retreiving tags with inheritance
* contrib/lisp/org-export.el (org-export-special-keywords): New
  "FILETAGS" keyword.
(org-export--get-inbuffer-options): Handle "FILETAGS" keywords.
(org-export-get-tags): Add FILETAGS when retreiving tags with
inheritance.
* testing/lisp/test-org-export.el: Add test.
2012-10-30 16:03:59 +01:00
Nicolas Goaziou 6290da183c Signal an error when a circular macro expansion happens
* lisp/org.el (org-macro-replace-all): Signal an error when a circular
  macro expansion happens.
(org-macro-initialize-templates): Fix docstring.
* testing/lisp/test-org.el: Add test.
2012-10-30 09:24:55 +01:00
Nicolas Goaziou 8fb5987e56 org-export: Fix smart quotes with isolated quotes
* contrib/lisp/org-export.el (org-export-activate-smart-quotes): Fix
  smart quotes in some corner-cases.  Refactor code.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 20:36:03 +01:00
Nicolas Goaziou 2e8591783f org-element: Fix org-element-context on parsed keywords
* lisp/org-element.el (org-element-context): Fix org-element-context
  on parsed keywords.
* testing/lisp/test-org-element.el: Update test.
2012-10-29 14:01:49 +01:00
Nicolas Goaziou a2120a9d73 org-export: Expand correctly {{{title}}} and such
* contrib/lisp/org-export.el (org-export-as): Expand correctly
  {{{title}}} and such when they already contain a regular macro.
  This is done by expanding macros in two steps: at first regular
  macros,  then document specific macros.
(org-export-expand-macro): Remove function.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 14:01:20 +01:00
Nicolas Goaziou a8c026cb26 org-export: Explicit error when using invalid syntax for INCLUDE keywords
* contrib/lisp/org-export.el (org-export-expand-include-keyword):
  Error out when file isn't specified within double quotes.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 11:31:19 +01:00
Nicolas Goaziou 99110c60a6 org-element: Find objects in document and parsed affiliated keywords
* lisp/org-element.el (org-element-context): Find objects in document
  and parsable affiliated keywords.
* testing/lisp/test-org-element.el: Add tests.
2012-10-29 11:09:41 +01:00
Nicolas Goaziou 98d5666bac org-element: Allow duals keywords with only secondary value
* lisp/org-element.el (org-element--collect-affiliated-keywords):
  Allow duals keywords with only secondary value.
* testing/lisp/test-org-element.el: Add test.

This patch allows to parse correctly the following:

    #+CAPTION[short caption]:
    #+CAPTION: Very long caption
    Some paragraph.
2012-10-28 22:45:34 +01:00
Nicolas Goaziou c1e3aaece3 org-element: Improve timestamps parsing
* lisp/org-element.el (org-element-timestamp-parser): Modify timestamp
  objects properties.
(org-element-headline-parser, org-element-inlinetask-parser): Remove
`:timestamp' and `:clock' property.  Add `:clockedp' property.  Also,
set `:closed', `:deadline' and `:scheduled' values to timestamp
objects, not strings.  Small refactoring.
(org-element-clock-parser): Rename `:time' property into `:duration'.
Also, set `:value' value as a timestamp object, not a string.
(org-element-planning-parser): Set `:closed', `:deadline' and
`:scheduled' values to timestamp objects, not strings.
(org-element-clock-interpreter, org-element-planning-interpreter)
(org-element-timestamp-interpreter): Update interpreters.
(org-element--current-element): Tiny refactoring.
* testing/lisp/test-org-element.el: Add tests.
2012-10-28 16:29:55 +01:00
Nicolas Goaziou 2f2a80fe06 ob: Fix block evaluation in a narrowed buffer
* lisp/ob.el (org-babel-where-is-src-block-result): Insert new results
  keyword in current narrowed part of buffer, if necessary. Small
  refactoring.
(org-babel-insert-result): Do not widen buffer when new results have
to be inserted.  Therefore, results inserted after the last block of
a narrowed buffer still belong to the narrowed part of the buffer.
* testing/lisp/test-ob.el: Add tests.
* testing/lisp/test-ob-exp.el: Move test to test-ob.el
2012-10-28 16:21:30 +01:00
Nicolas Goaziou ccc98ebc2d org-export: Fix expansion of babel calls in included files
* contrib/lisp/org-export.el (org-export-as):
  `org-current-export-file' should refer to current, temporary, buffer
  containing included contents, not to original buffer with include
  keywords.
(org-export-with-current-buffer-copy): Buffer copy must contain the
whole buffer, possibly narrowed to a proper part, not only the
narrowed part.
* testing/lisp/test-org-export.el: Tweak tests.
2012-10-28 16:21:30 +01:00
Nicolas Goaziou d81982ae9d org-element: Parse diary-sexp elements
* lisp/org-element.el (org-element-paragraph-separate): Diary-sexp
  elements can separate paragraphs.
(org-element-all-elements): Install new `diary-sexp' type.
(org-element--current-element): Recognize new `diary-sexp' elements.
(org-element-diary-sexp-parser, org-element-diary-sexp-interpreter):
New functions.
* testing/lisp/test-org-element.el: Add tests.
2012-10-27 14:43:30 +02:00
Nicolas Goaziou b2047a2565 org-export: Implement a generic smart quote module
* contrib/lisp/org-export.el (org-export-options-alist): Add an option
  item to toggle smart quotes during export.
(org-export-with-smart-quotes, org-export-smart-quotes-alist,
org-export-smart-quotes-regexps): New variables.
(org-export-activate-smart-quotes): New function.
(org-export-data): Remove residual text properties.
* testing/lisp/test-org-export.el: Add tests.
2012-10-27 11:42:31 +02:00
Nicolas Goaziou 95c305490e org-element: Add :parent text property to strings in parse tree
* lisp/org-element.el (org-element-property): Access to text
  properties when argument is a string.
(org-element-put-property): Correctly set property when target is
a string.
(org-element-adopt-elements): Also put :parent properties on strings.
* testing/lisp/test-org-element.el: Add test.
2012-10-27 11:42:30 +02:00
Nicolas Goaziou bef53d7f67 Merge branch 'maint' 2012-10-20 11:59:07 +02:00
Nicolas Goaziou 93040f4671 Fix auto filling in a paragraph directly following a comment
* lisp/org.el (org-auto-fill-function): Make sure `adaptive-fill-mode'
  mode is nil when pre-computed `fill-prefix' is the empty string.
  Otherwise filling functions from fill.el think it has to be computed
  again and overwrite it.
2012-10-20 11:58:16 +02:00
Nicolas Goaziou 94232ab5c6 Merge branch 'maint' 2012-10-16 21:12:21 +02:00
Nicolas Goaziou 8f96754932 Do not call `end-of-visual-line' when moving to the end of line
* lisp/org.el (org-end-of-line): Do not call `end-of-visual-line' when
  moving to the end of line.  Also improve behaviour on elements that
  can be hidden.
* testing/lisp/test-org.el: Add tests.
2012-10-16 21:11:06 +02:00
Nicolas Goaziou 0920e60c01 ob-exp: Fix removal of block results when exporting
* lisp/ob-exp.el (org-export-blocks-preprocess): Results of an
  evaluated code block can be inserted within the blank lines after
  the block.  Hence, if the block has to be removed, delete everything
  down to the first non-blank line after the end of block closing
  string, instead of removing everything down to the very end of the
  block.
* testing/lisp/test-ob-exp.el: Add test.
2012-10-15 22:29:30 +02:00
Nicolas Goaziou 23aa910259 Merge branch 'maint' 2012-10-14 21:51:59 +02:00
Nicolas Goaziou b7c5cf5d44 org-element: Fix parsing of objects of the same type in a single paragraph
* lisp/org-element.el (org-element--get-next-object-candidates): Fix
  parsing of objects of the same type in a single paragraph.
* testing/lisp/test-org-element.el: Add tests.
2012-10-14 21:49:41 +02:00
Nicolas Goaziou c65abd8577 org-element: Fix parsing of syntax at beginning of item
* lisp/org-element.el (org-element-sub/superscript-successor): Fix
  parsing of sub/superscript at beginning of item.
(org-element-latex-or-entity-successor): Fix parsing of latex
  fragments at beginning of item.
* testing/lisp/test-org-element.el: Add test.
2012-10-14 21:38:42 +02:00
Nicolas Goaziou c1c0c70c89 org-export: Add tag inheritance to `org-export-get-tags'
* contrib/lisp/org-export.el (org-export-get-tags): Add optional tag
  inheritance.
* testing/lisp/test-org-export.el: Add test.
2012-10-14 13:19:12 +02:00
Nicolas Goaziou 56470de26d Merge branch 'maint'
Conflicts:
	testing/lisp/test-org.el
2012-10-12 18:22:04 +02:00
Nicolas Goaziou 5212d4fa6b Fix analyzing european dates with time but without year
* lisp/org.el (org-read-date-analyze): Fix analyzing for dates like
  "29.03 16:40".
* testing/lisp/test-org.el: Add test.
2012-10-12 18:17:25 +02:00
Nicolas Goaziou 346c978939 Remove useless data in test file
* testing/examples/macro-templates.org: Remove time-stamp.
2012-10-10 22:46:50 +02:00
Nicolas Goaziou 89d6a26f8d org-export: Expand include keywords before macros
* contrib/lisp/org-export.el (org-export-as): Expand include keywords
  before macros.  This allows to specify macro templates in the
  included file.
* testing/examples/macro-templates.org: New file for testing purposes.
* testing/lisp/test-org-export.el: Add test.
2012-10-10 13:52:54 +02:00
Nicolas Goaziou bbdd81ad37 Be stricter when updating radio targets
* lisp/org.el (org-all-targets): Make sure the regexp really matched
  a radio target.
* testing/lisp/test-org.el: Add test.
2012-10-10 13:41:14 +02:00
Nicolas Goaziou 58b42debb1 org-export: Include title, author, date and email macros
* contrib/lisp/org-export.el (org-export-expand-macro): New function.
(org-export-as): Use new function.
* lisp/org.el (org-macro-expand, org-macro-replace-all): Change
  signature.  The function now accepts an alist of templates so it
  doesn't have to rely only on `org-macro-templates'.
(org-macro-initialize-templates): {{{date}}} is not anymore an alias
for {{{time}}}.  During export, it will provide the value stored in
DATE keyword instead.
* testing/lisp/test-org-export.el: Add tests.
* testing/lisp/test-org.el: Update tests.
2012-10-06 10:29:37 +02:00
Nicolas Goaziou 2c78ca4a56 Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2012-10-06 01:21:27 +02:00
Nicolas Goaziou ad99ea9147 org-element: Fix parsing with trailing spaces at eob
* lisp/org-element.el (org-element-center-block-parser,
  org-element-drawer-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-babel-call-parser, org-element-clock-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-planning-parser,
  org-element-property-drawer-parser, org-element-src-block-parser,
  org-element-table-parser,
  org-element-verse-block-parserorg-element-dynamic-block-parser):
  Make sure element never ends at the end of a blank non-empty line.
* testing/lisp/test-org-element.el: Add test.
2012-10-06 01:02:03 +02:00
Nicolas Goaziou 78d2bd7edc Merge branch 'maint' 2012-10-05 15:08:58 +02:00
Nicolas Goaziou daf8cf030c org-element: Fix `org-element-context' when in recursive objects
* lisp/org-element.el (org-element-context,
  org-element--get-next-object-candidates): Fix `org-element-context'.
  In particular, the restrictions for an object may be different from
  those of its container (i.e. table rows and table cells).
* testing/lisp/test-org-element.el: Add tests.
2012-10-05 15:02:55 +02:00
Nicolas Goaziou 2a95a47c5f Merge branch 'maint' 2012-10-01 21:37:48 +02:00
Nicolas Goaziou 3bd22fb045 org-element: Store value of example-blocks and src-blocks unescaped
* lisp/org-element.el (org-element-example-block-parser,
  org-element-src-block-parser): Store value of example-blocks and
  src-blocks unescaped.
(org-element-example-block-interpreter,
org-element-src-block-interpreter): Escape value again when storing
it.
* contrib/lisp/org-export.el (org-export-unravel-code): Don't clean
  commas from code since org-element already took care of it.
* testing/lisp/test-org-export.el: Update test.
* testing/lisp/test-org-element.el: Add tests.
2012-10-01 21:35:50 +02:00
Nicolas Goaziou fac86b03fe Normalize comma-escaping of src-blocks and example-blocks
* lisp/org-src.el (org-escape-code-in-string,
  org-unescape-code-in-string, org-escape-code-in-region,
  org-unescape-code-in-region): New functions.
(org-edit-src-code, org-edit-src-exit): Use new functions.
* lisp/org.el (org-strip-protective-commas): Removed function.
* lisp/org-exp.el (org-export-select-backend-specific-text): Use new
  function.
* lisp/ob.el (org-babel-parse-src-block-match,
  org-babel-parse-inline-src-block-match, org-babel-insert-result):
  Always escape produced blocks, independently on the language of the
  block, if any.  Use new functions.
* doc/org.texi: Update documentation.
* testing/lisp/test-ob.el: Update test.
2012-10-01 21:24:00 +02:00
Bastien Guerry 180fd62245 Merge branch 'maint' 2012-10-01 19:00:18 +02:00
Bastien Guerry 857a3921af testing/lisp/test-ob-lilypond.el: Use "w32" or "windows-nt" instead of "win32" 2012-10-01 19:00:14 +02:00
Nicolas Goaziou 3245619445 org-element: Allow to map over affiliated keywords
* lisp/org-element.el (org-element-map): Change signature.
* testing/lisp/test-org-element.el: Add test.
2012-09-30 23:57:45 +02:00
Nicolas Goaziou d6fb245590 Merge branch 'maint' 2012-09-30 13:13:21 +02:00
Nicolas Goaziou 1ad58a8230 org-element: Use stricter regexps for boundaries of elements
* lisp/org-element.el (org-element-center-block-parser):
(org-element-drawer-parser, org-element-dynamic-block-parser,
org-element-example-block-parser, org-element-export-block-parser,
org-element-latex-environment-parser, org-element-paragraph-parser,
org-element-property-drawer-parser, org-element-src-block-parser,
org-element-verse-block-parser): Use stricter regexps for boundaries
of elements.
* testing/lisp/test-org.el: Fix a test.
2012-09-30 13:09:54 +02:00
Bastien Guerry 4962980938 Merge branch 'maint' 2012-09-29 11:10:18 +02:00
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