Commit Graph

834 Commits

Author SHA1 Message Date
Nicolas Goaziou 451e20d982 Merge branch 'maint'
Conflicts:
	testing/lisp/test-org-element.el
2014-07-26 15:10:22 +02:00
Nicolas Goaziou 38ff96ecc3 org-element: Fix parsing multi-line links
* lisp/org-element.el (org-element-link-parser): Properly handle
  multi-line links according to RFC 3986 when enclosed within square
  brackets.

* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.
2014-07-26 15:08:23 +02:00
Nicolas Goaziou 214ef7d461 Merge branch 'maint' 2014-07-25 15:24:45 +02:00
Nicolas Goaziou 0e01e3eb13 org-element: Fix object parsing in captions
* lisp/org-element.el (org-element-parse-secondary-string): Clone all
  local variables from current buffer before parsing a secondary
  string.  Small refactoring.
(org-element-object-variables): Remove variable.

* testing/lisp/test-org-element.el (test-org-element/secondary-string-parsing):
  Add test.

Thanks to Thomas S. Dye for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88850
2014-07-25 15:11:10 +02:00
Rasmus 0be96db56e org-element.el: Allow one-line LaTeX environments
* org-element.el (org-element--latex-begin-environment,
org-element--latex-end-environment): New format strings to identify
beginning and ending of LaTeX environments.
(org-element-latex-environment-parser, org-element-paragraph-parser,
org-element--current-element): Use `org-element--latex-begin-environment'
and `org-element--latex-end-environment'.

* test-org-element.el (test-org-element/latex-environment-parser):
Add tests.
2014-07-23 10:24:10 +02:00
Nicolas Goaziou 05be573e92 org-element: Fix re-parenting during cache synchronization
* lisp/org-element.el (org-element--cache-process-request): Correctly
  re-parent elements in cache in some corner cases.
* testing/lisp/test-org-element.el (test-org-element/cache): Add tests.
2014-07-17 18:12:59 +02:00
Nicolas Goaziou ca6ecf9e49 org-element: Remove :inline-definition from inline footnotes
* lisp/org-element.el (org-element-recursive-objects): Add
  `footnote-reference'.
(org-element-secondary-value-alist): Remove reference to
`footnote-reference'.
(org-element-footnote-reference-parser): Definition for inline
references is stored as the contents of the reference, not in
a secondary string.
(org-element-footnote-reference-interpreter): Apply changes from
parser.

* lisp/ox.el (org-export-get-footnote-definition,
  org-export-get-environment): Apply changes from parser.

* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
  Update test.
(test-org-element/context): Add test.

Storing definition in a secondary string was a poor design choice as
there is no "primary" string anyway.  This also prevents
`org-element-context' from finding objects within the inline
definition.
2014-07-06 11:24:12 +02:00
Nicolas Goaziou 49f3c6e558 org-element: Fix inlinetask parsing
* lisp/org-element.el (org-element-inlinetask-parser): Do not infloop
  when parsing property drawer in an inlinetask.

* testing/lisp/test-org-element.el (test-org-element/headline-properties):
  Add test.

Thanks to Aaron Ecay for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88133
2014-06-29 15:23:22 +02:00
Nicolas Goaziou c9eaea360a Fix `org-drag-element-backward'
* lisp/org.el (org-drag-element-backward): Correcly drag elements in
  a drawer or a block.
* testing/lisp/test-org.el (test-org/drag-element-backward): Add test.
2014-06-25 10:49:52 +02:00
Nicolas Goaziou ab145f0df5 org-element: Properly parse headline properties
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser): First find appropriate property
  drawer in order to read properties.

* testing/lisp/test-org-element.el (test-org-element/headline-properties):
  Add tests.

Thanks to Sébastien Vauban for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/87701
2014-06-18 23:28:19 +02:00
Nicolas Goaziou 5cca90edf8 Merge branch 'maint'
Conflicts:
	lisp/org.el
	testing/lisp/test-org.el
2014-06-09 18:11:19 +02:00
Nicolas Goaziou 8cc4e09950 Fix `org-insert-heading' before first headline
* lisp/org.el (org-insert-heading): Fix error when inserting
  a headline before first headline, with point not at bol.  Remove
  source block check for consistency with behavior after first
  headline.  Tiny fix to docstring.

* testing/lisp/test-org.el (test-org/meta-return): Remove unnecessary
  test (not testing specifications).
(test-org/insert-heading): New test.
2014-06-09 18:07:07 +02:00
Thierry Banel 54ab0e1c60 Babel C, C++, D support for non-homogeneous input tables
* ob-C.el: handling of non-homogeneous tables,
        support for table header,
        support for iterating over table cells.
        (org-babel-expand-body:C++): uncomment
        (org-babel-C-execute): cosmetic changes
        (org-babel-C-expand-C): add support for table columns names,
        add support for table dimensions,
        add standard includes
        (org-babel-C-val-to-C-type): rewrite to support non-homogeneous
        tables cells
        (org-babel-C-table-sizes-to-C): new function to gain access
        to the table dimensions
        (org-babel-C-utility-header-to-C):
        (org-babel-C-header-to-C): new functions to generate
        support for table header.

        * ob-C-test.org: added D sibling tests similar to C++,
        added non-homogeneous table example for C++ and D

        * test-ob-C.el: new tests for D and non-homogeneous tables
        (ob-C/simple-program):
        (ob-C/simple-program):
        (ob-D/simple-program):
        (ob-C/integer-var):
        (ob-D/integer-var):
        (ob-C/two-integer-var):
        (ob-D/two-integer-var):
        (ob-C/string-var):
        (ob-D/string-var):
        (ob-C/preprocessor):
        (ob-C/table):
        (ob-D/table):
        (ob-C/list-var):
        (ob-D/list-var):
        (ob-C/vector-var):
        (ob-D/vector-var):
        (ob-C/list-list-var):
        (ob-D/list-list-var):
        (ob-C/inhomogeneous_table):
        (ob-D/inhomogeneous_table): add compiler availability check
        (ob-D/simple-program):
        (ob-D/integer-var):
        (ob-D/two-integer-var):
        (ob-D/string-var):
        (ob-D/table):
        (ob-D/list-var):
        (ob-D/vector-var):
        (ob-D/list-list-var):
        (ob-D/inhomogeneous_table): add D unit tests
        (ob-C/inhomogeneous_table):
        (ob-D/inhomogeneous_table): add non-homogeneous table
        unit tests
2014-06-08 19:20:16 -04:00
Achim Gratz 4ed554196b ox: implement additional #+INCLUDE markup
* lisp/ox.el (org-export-expand-include-keyword): Change parsing so
  that arbitrary blocks around the included content can be used.
  Content is not code-escaped unless it is a literal block, this
  applies to "src" and "example".
* doc/org.texi (Include files): Document the additional markup.
* testing/lisp/test-ox.el (test-org-export/expand-include): Add test
  for an #+INCLUDE with "html" and "center" markup.
* testing/examples/include.html: New file, used for testing
  "#+INCLUDE html".
2014-06-07 18:02:52 +02:00
Eric Schulte c3e497f394 awk code blocks handle tabular input
Protected by a new unit test.

* lisp/ob-awk.el (org-babel-execute:awk): Use the
  `org-babel-awk-var-to-awk' function instead of a simple format
  string.
2014-06-07 11:16:55 -04:00
Eric Schulte 6fb033c791 fix a bug in new ob-awk code
thank you test suite

* lisp/ob-awk.el (org-babel-execute:awk): Don't need to apply the
  append, just need to append.

* testing/lisp/test-ob-awk.el (ob-awk/input-src-block-1): Renamed to
  avoid name duplication and over-definition.
  (ob-awk/input-src-block-2): Renamed to avoid name duplication and
  over-definition.
2014-06-06 13:11:46 -04:00
Bastien Guerry ad567e877b testing/lisp/test-org.el: Update tests
* testing/lisp/test-org.el
(test-org/open-at-point-in-property): Rename from
`test-org/open-at-point'.  Only test whether
`org-open-at-point' does not throw an error.
(test-org/open-at-point-in-comment)
(test-org/open-at-point/info): New tests.
2014-06-02 22:33:28 +02:00
Achim Gratz 8e72c8fcfa testing/lisp/test-org: actually check that org-open-at-point did the right thing
* testing/lisp/test-org.el (test-org/open-at-point): The test should
  leave the cursor one line above "Org Mode Manual" in the "*info*"
  buffer.  Try to switch to that buffer and check that point is where
  it should be, then kill the buffer.
2014-06-02 21:05:46 +02:00
Nicolas Goaziou 7dadf85716 Move test into appropriate file
* testing/lisp/test-org-element.el (test-org-element/org-open-at-point):
Remove test.
* testing/lisp/test-org.el (test-org/open-at-point): Add test.
2014-06-01 13:37:11 +02:00
York Zhao b366525077 test-org-element.el (test-org-element/org-open-at-point): Add test
* test-org-element.el (test-org-element/org-open-at-point):
Add test.

TINYCHANGE
2014-06-01 10:53:19 +02:00
Nicolas Goaziou f58201b1e1 Fix indentation in source blocks
* lisp/org.el (org-indent-line): Indent source block contents
  according to line above when `org-src-tab-acts-natively' is nil.

* testing/lisp/test-org.el (test-org/indent-line): Update test.
2014-05-19 13:33:28 +02:00
Nicolas Goaziou 3702dce1db Fix previous patch
* lisp/org.el (org-update-radio-target-regexp): Fix previous patch.

* testing/lisp/test-org.el (test-org/update-radio-target-regexp): Add test.
2014-05-17 11:14:27 +02:00
Nicolas Goaziou f8b7eb4e20 Fix radio target update
* lisp/org.el (org-update-radio-target-regexp): Properly update cache
  when refreshing regexp.

* testing/lisp/test-org.el (test-org/update-radio-target-regexp): Fix
  test.
2014-05-17 11:03:29 +02:00
Nicolas Goaziou 49ef55bd65 test-org: Fix test name
* testing/lisp/test-org.el (test-org/toggle-fixed-width): Fix test
  name.
2014-05-16 22:14:59 +02:00
Aaron Ecay 08e2596718 ob-core.el: allow the auto-generation of output file names for src blocks.
* lisp/ob-core.el (org-babel-generate-file-param): New function.
(org-babel-get-src-block-info): Use it.
(org-babel-merge-params): Handle :file-ext.
(org-babel-graphical-output-file): error if no :file or :file-ext.
* testing/lisp/test-ob.el (test-org-babel/file-ext-and-output-dir):
New test.
* doc/org.texi (Specific header arguments): Add doc for :file-ext and
:output-dir header args.
* lisp/ob-R.el (org-babel-expand-body:R): Don’t calculate
graphics-file.
(org-babel-execute:R): Only look for a graphics-file if needed.
2014-05-11 16:33:22 -04:00
Nicolas Goaziou fe129fb352 Rewrite `org-indent-region'
* lisp/org.el (org-indent-region): Update function according to recent
  `org-indent-line' change.  Optimize it.

* testing/lisp/test-org.el (test-org/indent-region): New test.
2014-05-07 17:39:52 +02:00
Nicolas Goaziou 51ffcd02dd Rewrite `org-indent-line'
* lisp/org.el (org--get-expected-indentation,
  org--align-node-property): New functions.
(org-indent-line): Use new function.  Also merge functionalities with
`org-src-native-tab-command-maybe'.

* lisp/org-src.el (org-src-native-tab-command-maybe): Remove function.

* testing/lisp/test-org.el (test-org/indent-line): New test.
2014-05-07 17:39:52 +02:00
Nicolas Goaziou 86a129c597 Fix `org-flag-drawer'
* lisp/org.el (org-flag-drawer): Do not flag drawer when point is on
  an empty line after it.  When hiding the drawer away, make sure
  point always stays in a visible part of the buffer.

* testing/lisp/test-org.el (test-org/flag-drawer): Add tests.
2014-04-28 19:41:08 +02:00
Bastien Guerry 69700e1c44 Merge branch 'maint' 2014-04-22 12:09:01 +02:00
Bastien Guerry 099b6f0fb5 test-org.el: Fix test
* test-org.el (test-org/insert-todo-heading-respect-content):
Fix test.
2014-04-22 12:08:15 +02:00
Nicolas Goaziou 55e46fc260 test-org-element: Add tests for links
* testing/lisp/test-org-element.el (test-org-element/link-parser): add
  tests.
2014-04-19 21:34:29 +02:00
Nicolas Goaziou 82cc4f43ec test-org: Tiny clean-up
* testing/lisp/test-org.el (test-org/update-radio-target-regexp): Tiny
  clean-up.
2014-04-19 20:27:21 +02:00
Nicolas Goaziou 6eb940a8dc Fix cache update when radio targets are being refreshed
* lisp/org-element.el (org-element-cache-refresh): New function.
* lisp/org.el (org-update-radio-target-regexp): Make it standalone.
  Also refresh fontification only when necessary.
(org-all-targets, org-make-target-link-regexp): Remove functions.

* testing/lisp/test-org.el (test-org/update-radio-target-regexp): New
  test
(test-org/all-targets): Remove test.

We need to manually reset cache on radio links as re-fontification
doesn't trigger a buffer change, and, as a consequence, a cache reset.
2014-04-19 18:36:58 +02:00
Nicolas Goaziou 2b2b2c5c99 org-element: Fix infloop at the end of an incomplete table row
* lisp/org-element.el (org-element-context): Fix infloop.  Be more
  cautious when point is at the end of buffer.

* testing/lisp/test-org-element.el (test-org-element/context): Add
  test.
2014-04-17 21:37:07 +02:00
Nicolas Goaziou fffd055ac5 Merge branch 'maint'
Conflicts:
	lisp/org-element.el
	lisp/ox-html.el
2014-04-17 11:34:54 +02:00
Nicolas Goaziou 1ca819e398 Revert "Make Org links compatible with URI syntax"
This reverts commit 3589f64e42.
2014-04-17 11:30:15 +02:00
Pascal Fleury 3c7e75ab0b ob-shell.el: export vars as arrays for 'sh' code blocks
* lisp/ob-shell.el: added support to serialize vars as arrays or associative arrays as appropriate if it is using bash.
* testing/examples/ob-shell-test.org: a file containing a few code blocks both illustrating the use of arrays as well as serving as test for the new export functionality.
* testing/lisp/test-ob-shell.el: added a few unit tests that verify that this new logic only triggers for bash and no other shell at this time.

When variables are defined in a 'sh' code block, they are exported as strings. when the variable itself is an array or a table, then we simply get a shell variable that contains the list of all values in a non-structured form.
When calling the code block with bash, however, it will now export the list as an array, the table as an associative array. A scalar is exported the same way as before.

Signed-off-by: Pascal Fleury <fleury@google.com>
2014-04-14 21:24:00 -06:00
Nicolas Goaziou d5484ae3f5 test-ox: Tiny refactoring
* testing/lisp/test-ox.el (test-org-export/expand-include): Tiny
  refactoring.
2014-04-12 16:17:13 +02:00
Nicolas Goaziou b8781c4c85 ox: Make footnotes file specific when including Org files
* lisp/ox.el (org-export-expand-include-keyword,
  org-export--prepare-file-contents): Make footnotes file specific
  when including Org files.

* doc/org.texi (Include files): Add documentation.

* testing/lisp/test-ox.el (test-org-export/expand-include): Add tests.

http://permalink.gmane.org/gmane.emacs.orgmode/83606
2014-04-12 15:07:42 +02:00
Nicolas Goaziou 7c82e6ac19 No alphanumeric characters around radio links
* lisp/org.el (org-make-target-link-regexp): Change regexp so
  alphanumeric characters cannot be found next to a radio link.
(org-activate-target-links): Apply changes to radio link regexp.

* lisp/org-element.el (org-element--object-lex,
  org-element-link-parser): Apply changes to radio link regexp.

* testing/lisp/test-org-element.el (test-org-element/link-parser):
  Update test.

Patch suggested by Daniel Clemente.
http://permalink.gmane.org/gmane.emacs.orgmode/84461
2014-04-11 21:30:15 +02:00
Nicolas Goaziou 37e3c112dd Merge branch 'maint' 2014-04-10 23:01:20 +02:00
Nicolas Goaziou 3589f64e42 Make Org links compatible with URI syntax
* lisp/org.el (org-make-link-regexps): Allow optional double slashes
  after type.  Small refactoring.

* testing/lisp/test-org-element.el (test-org-element/link-parser):
  Update test.

This patch allows to write both [[file:/file.org]] and [[file:///file.org]].
See bug#16751.
2014-04-10 22:57:05 +02:00
Nicolas Goaziou fea23d3da2 Fix COMMENT keyword when stacked with a regular keyword
* lisp/org.el (org-set-font-lock-defaults): Fix headline fontification
  when keywords are stacked.
(org-toggle-comment): Properly toggle COMMENT keyword when a regular
keyword is already present.
(org-todo, org-agenda-prepare-buffers): Correctly match a commented
heading.
* lisp/org-colview.el (org-columns-capture-view): Correctly match
  a commented heading.

* testing/lisp/test-org.el (test-org/toggle-comment): New test.
2014-04-10 22:51:16 +02:00
Nicolas Goaziou af41c071ed Merge branch 'maint' 2014-04-10 11:56:13 +02:00
Nicolas Goaziou 7fe1da1f8c org-test: Small code clean-up
* testing/org-test.el (org-test-with-temp-text): Clean-up code.
2014-04-10 11:53:27 +02:00
York Zhao d01d22b74f org-test: Fix <point> feature
* testing/org-test.el (org-test-with-temp-text): Fix point position.

According to the docstring, if the string "<point>" appears in TEXT
then the string "<point>" is removed and point is placed there. The
problem was that after string "<point>" was removed, the point
was *not* placed at the position of the removed text, rather, it was
placed one character before that position which is wrong. The reason
is that Emacs buffer position is a number started from 1, instead of
0, in other words, the value of `(point-min)' is 1 not 0. The problem
is addressed by adding 1 to the calculated position.

TINYCHANGE
2014-04-10 11:52:44 +02:00
Nicolas Goaziou dfcfca8219 Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2014-04-08 18:59:06 +02:00
Nicolas Goaziou 728661309e org-element: Fix table parsing with missing final bar
* lisp/org-element.el (org-element-table-cell-parser,
  org-element-table-cell-successor): Recognize cell even when last
  vertical bar is missing.

* testing/lisp/test-org-element.el (test-org-element/table-cell-parser):
  Add test.

Thanks to Thorsten Jolitz for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84713
2014-04-08 18:56:51 +02:00
Nicolas Goaziou 23e62f7527 Radio targets cannot beging or end with whitespace
* lisp/org.el (org-radio-target-regexp): Radio targets cannot begin or
  end with whitespace.
(org-target-regexp): Update syntax according to previous rule.
(org-any-target-regexp): Fix fontification bug.

* testing/lisp/test-org-element.el (test-org-element/radio-target-parser):
  Add test.

Variables are turned into defconst to emphasize the fact that they are
not subject to change.

Thanks to Daniel Clemente for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84461
2014-04-02 14:54:37 +02:00
Nicolas Goaziou a7e12d2af5 ox: Fix multiple deactivated subscripts export
* lisp/ox.el (org-export--remove-uninterpreted-data-1): Fix multiple
  deactivated subscripts export.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.

Thanks to Xavier Garrido for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84403
2014-03-29 22:47:01 +01:00
Achim Gratz c6e0157095 org-test: fix macro definitions so that eager macro expansion doesn't fail
* testing/org-test.el (org-test-with-temp-text,
  org-test-with-temp-text-in-file): Correct quoting of macro
  expansion.

Macro arguments must not be used during macro expansion since they are
not available at that time; conversely, bindings established during
macro expansion generally can not be used at macro execution
time (unless un-quoted during expansion).
2014-03-25 19:11:01 +01:00
Nicolas Goaziou 1c1936fbb1 Allow radio links after an apostrophe and mid-word
* lisp/org.el (org-make-target-link-regexp): Allow radio links after
  an apostrophe and mid-word.  Small refactoring.

* testing/lisp/test-ox.el (test-org-export/resolve-radio-link): Add
  test.

See http://permalink.gmane.org/gmane.emacs.orgmode/84108.
2014-03-25 10:21:26 +01:00
Nicolas Goaziou 6d1d61f667 Rename `org-babel-under-commented-heading-p'
* lisp/org.el (org-in-commented-heading-p): New function.
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Remove
  function.
(org-babel-tangle-collect-blocks): Use new function.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use new function.

* testing/lisp/test-org.el (test-org/in-commented-heading-p): New
  test.
2014-03-24 13:29:42 -04:00
Nicolas Goaziou 230d09aeb0 Merge branch 'maint' 2014-03-24 14:20:23 +01:00
Nicolas Goaziou 8212776cfc Fix radio target parsing
* lisp/org-element.el (org-element-all-successors,
  org-element-object-restrictions): Prioritize `link' over other
  successors in order to find radio links starting with another syntax
  object (e.g., an entity).  Also allow text markup within radio
  targets.
(org-element-link-parser): Add contents to radio targets.

* lisp/org.el (org-make-target-link-regexp): Fix regexp so it can
  match targets starting with an Org object (e.g., an entity).
(org-ctrl-c-ctrl-c): Fix function when applied on an object contained
within a radio target.

* testing/lisp/test-org-element.el (test-org-element/radio-target-parser): Add test.
* testing/lisp/test-ox.el (test-org-export/resolve-radio-link): Add test.
2014-03-24 14:13:24 +01:00
Nicolas Goaziou d6d1f25429 Fix `org-open-at-point'
* lisp/org.el (org-open-at-point): Correctly open fuzzy links when
  path is hexified.
* testing/lisp/test-org.el (test-org/coderef): New test.
(test-org/fuzzy-links): Add test.
2014-03-21 14:51:34 +01:00
Nicolas Goaziou df10309489 ob-ref: Properly resolve references in ":post" arguments
* lisp/ob-core.el (org-babel-exp-reference-buffer): New variable, as
  a replacement for `org-current-export-file'.
(org-babel-check-confirm-evaluate): Use new variable.
* lisp/ob-exp.el (org-babel-exp-in-export-file): Use new variable.
(org-babel-exp-get-export-buffer): Remove function.
(org-babel-exp-process-buffer): Change signature.
* lisp/ob-ref.el (org-babel-ref-resolve): Use new variable during
  export in order to properly resolve references.
* lisp/ox.el (org-export-execute-babel-code): Use new variable.

* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
  Remove a cond branch as it is always
  false (`org-current-export-file' couldn't be a string).

* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines): Update
  test.
* testing/lisp/test-ob.el (test-ob/eval-header-argument): Update test.
* testing/lisp/test-ob-exp.el (ob-export/reference-in-post-header):
  New test.

During export, Babel executes sequentially all blocks in the buffer
being exported.  This can lead to modifications preventing some
references from being resolved.  As a workaround, Babel stores
a pristine copy of the buffer in a variable so it can always find
needed references.

Before this patch, the variable storing this copy was
`org-current-export-file' and was dynamically bound in "ox.el".  It
was used to resolve noweb references (`org-babel-expand-noweb-references')
but not regular references (`org-babel-ref-resolve').

Now, the variable is `org-babel-exp-reference-buffer' and it is bound
from `org-babel-exp-process-buffer'.  It is used to resolve all
references.  In particular, this allows to use references in :post
header.

Thanks to Jarmo Hurri for reporting it.
2014-03-19 21:34:56 +01:00
Nicolas Goaziou 05f69e5bf8 ob-exp: During export ignore Babel code under commented headlines
* lisp/ob-exp.el (org-babel-exp-process-buffer): Skip code under
  a commented headline.
* testing/lisp/test-ob-exp.el (ob-export/export-under-commented-headline):
  New test.
2014-03-15 19:40:13 -06:00
Nicolas Goaziou 2f60dfc1b3 Merge branch 'maint' 2014-03-12 09:08:37 +01:00
Nicolas Goaziou cb22a0355f org-element: Fix parsing of bold objects at the beginning of a headline
* lisp/org-element.el (org-element-context): Fix parsing of bold
  objects at the beginning of a headline.
* testing/lisp/test-org-element.el (test-org-element/context): Add
  test.
2014-03-12 09:05:50 +01:00
Nicolas Goaziou d75fa9febc `org-open-at-point' right after an object still open it
* lisp/org.el (org-open-at-point): White spaces after an object are
  usually ignored by the function.  Though, when point is right after
  the object, still activate it.
* testing/lisp/test-org.el (test-org/custom-id): Fix test.
2014-03-02 10:32:51 +01:00
Nicolas Goaziou 8b2d3645ac Ignore `org-open-at-point' when point is on white spaces
* lisp/org.el (org-open-at-point): Do not do anything when point is on
  white spaces after an object.
* testing/lisp/test-org.el (test-org/custom-id): Modify test.
2014-02-27 18:38:39 +01:00
Nicolas Goaziou 3960ed07e6 Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2014-02-25 20:54:48 +01:00
Nicolas Goaziou 7f8c1226e8 org-element: Fix timestamps parsing in planning lines
* lisp/org-element.el (org-element-context): Fix timestamps parsing.
* testing/lisp/test-org-element.el (test-org-element/context): Add
  test.
2014-02-25 20:51:32 +01:00
Nicolas Goaziou fc9ce86cfc Rewrite `org-open-at-point' using Elements
* lisp/org.el (org-open-at-point): Rewrite function using Element
  parser.
(org-link-types): Add "help" type.
* testing/lisp/test-org-open-at-point.el: Remove file.  Two tests are
  not supported anymore (namely bracket-link-before and
  plain-link-before) and the other tests are wrong (mixing id and
  custom-id links).
* testing/examples/open-at-point.org: Remove file.
* testing/lisp/test-org.el (test-org/custom-id): Add test.

Unlike to the previous implementation, this one will only open links
under point or just before point, not links on the same line but
before point.
2014-02-23 14:26:18 +01:00
Nicolas Goaziou 13691bde32 org-element: Fix `org-element-context' at eob
* lisp/org-element.el (org-element-context): If function is called at
  the end of buffer, return any object that ends there.
* testing/lisp/test-org-element.el (test-org-element/context): Add
  test.
2014-02-23 13:49:41 +01:00
Michael Brand 89c1668945 Add ERT with org-lookup-all for GROUP BY and ranking
* testing/lisp/test-org-table.el (test-org-table/org-lookup-all): Add
new test.
2014-02-22 21:18:28 +01:00
Nicolas Goaziou eed0500913 org-element: Implement lazy cache synchronization
* lisp/org-element.el (org-element-cache-sync-idle-time): Change
  default value.
(org-element-cache-sync-duration, org-element-cache-sync-break,
org-element--cache-sync-requests, org-element--cache-sync-timer,
org-element--cache-sync-keys, org-element--cache-default-key,
org-element--cache-change-warning): New variables.
(org-element-cache-merge-changes-threshold,
org-element--cache-status): Removed variables.
(org-element--cache-key, org-element--cache-generate-key,
org-element--cache-key-less-p, org-element--cache-find,
org-element--cache-set-timer, org-element--cache-process-request,
org-element--cache-submit-request, org-element--parse-to,
org-element--cache-interrupt-p, org-element--cache-put,
org-element--cache-active-p): New functions.
(org-element--cache-compare): Adapt to new keys in AVL tree.
(org-element--cache-pending-changes-p,
org-element--cache-cancel-changes, org-element--cache-mapc,
org-element-cache-get, org-element-cache-put): Removed functions.
(org-element--cache-before-change): Use new variables.
(org-element--cache-after-change): Renamed from
`org-element--cache-record-change'.
(org-element-cache-get): Change signature.
(org-element-cache-put): Rewrite function.  Use new tools.
(org-element-cache-reset): Adapt to new variables.
(org-element--cache-sync): Rewrite function.

* lisp/ox.el (org-export--generate-copy-script): Do not copy through
  new cache-related variables.
(org-export-ignored-local-variables): New variable.

* testing/lisp/test-org-element.el (test-org-element/cache): New test.

Now only the part of the cache that needs to be accessed is updated
synchronously.  Otherwise, it happens on idle time.
2014-02-20 22:18:17 +01:00
Michael Brand fb3ecad851 Simplify ERT for TBLFM with sub-total
* testing/lisp/test-org-table.el (test-org-table/sub-total): Simplify
condition in "if".
2014-02-20 08:51:19 +01:00
Michael Brand 54e3009d73 Fix escaping of more links in HTML export
* lisp/org.el (org-link-escape-chars): Extend docstring.
(org-link-escape-chars-browser): Mention in docstring that it will
become a candidate for removal.
(org-link-escape-browser): Mention in docstring that it will become a
candidate for removal.
(org-open-at-point): Move `url-encode-url' and comments into
`org-link-escape-browser'.

* lisp/ox-html.el (org-html-link): Make use of
`org-link-escape-browser' like `org-open-at-point'.

* testing/lisp/test-org.el (test-org/org-link-escape-chars-browser):
Mention in docstring that it will become a candidate for removal.
2014-02-19 20:49:21 +01:00
Nicolas Goaziou 03514a6a78 Merge branch 'maint' 2014-02-17 23:01:40 +01:00
Nicolas Goaziou c5d88fb606 org-element: Fix inlinetask parsing
* lisp/org-element.el (org-element-inlinetask-parser): Fix parsing
  when regular and degenerate inlinetasks are mixed in the section.
* testing/lisp/test-org-element.el (test-org-element/inlinetask-parser):
  Add tests.

Thanks to Anders Johansson for reporting it.
2014-02-17 22:59:25 +01:00
Michael Brand ea4eb4f10f Add ERT for TBLFM with sub-total
* testing/lisp/test-org-table.el (test-org-table/sub-total): Add a use
case of grouped rows with sub-total.
2014-02-16 10:04:46 +01:00
Nicolas Goaziou def5cd8ca5 Merge branch 'maint' 2014-02-07 20:08:29 +01:00
Nicolas Goaziou 7f287d1b62 org-element: Fix indentation normalization
* lisp/org-element.el (org-element-normalize-contents): Do not ignore
  empty lines when an object follows.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
  Add test.
2014-02-07 20:06:00 +01:00
Nicolas Goaziou b8665a0190 New function to toggle fixe-width areas
* lisp/org.el (org-toggle-fixed-width): New function.
* testing/lisp/test-org.el (test-org/toggle-fixed-with): New test.

This replaces the old implementation removed in commit
6a00c96541.
2014-02-06 18:55:14 +01:00
Nicolas Richard 5f0ca0ee92 Renaming of ob-sh to ob-shell: various fixes
* lisp/org.el (org-babel-load-languages):
* testing/org-test.el:
* testing/README: change 'sh' to 'shell'

* testing/lisp/test-ob-sh.el: re-rename test file (fixes 80754a8)
2014-02-02 00:08:56 -07:00
Nicolas Goaziou 8f91f657e1 Merge branch 'maint' 2014-02-01 21:54:03 +01:00
Nicolas Goaziou ac2f516edf ob-exp: Do not ignore `org-src-preserve-indentation'
* lisp/ob-exp.el (org-babel-exp-process-buffer): Also check
  `org-src-preserve-indentation' to know when to preserve indentation.
* testing/lisp/test-ob-exp.el (ob-export/export-and-indentation): New
  test.

Thanks to John Hendy for reporting it.
2014-02-01 21:52:43 +01:00
Nicolas Goaziou 98eed5baf9 Merge branch 'maint' 2014-01-29 09:05:44 +01:00
Nicolas Goaziou 63a2a403a9 ob-exp: Fix switches handling upon exporting
* lisp/ob-exp.el (org-babel-exp-code-template): Include switches in
  template.
(org-babel-exp-code): Provide %switches placeholder.
* testing/lisp/test-ob-exp.el (ob-export/export-src-block-with-switches):
  New test.
(ob-export/export-src-block-with-flags): Fix indentation.

This fixes dde6af3a62.  The confusion
came from the fact that "flags" placeholder had two meanings:
the :flags value and the block's switches (e.g., "-n").  This patch
separates these two meanings.
2014-01-29 09:01:43 +01:00
Nicolas Goaziou 6a00c96541 Remove left over references to QUOTE blocks
* lisp/org.el (org-quote-string): Remove variable.
(org-enable-fixed-width-editor, org-context): Update docstring.
(org-toggle-fixed-width-section): Remove function and binding.
(org-set-font-lock-defaults): Remove reference to `org-quote-string'.

* lisp/org-element.el (org-element-headline-parser,
  org-element-headline-interpreter): Remove references to
  `org-quote-string'.

* testing/lisp/test-org-element.el (test-org-element/headline-quote-keyword):
  Remove test.
(test-org-element/headline-interpreter): Remove a test.
2014-01-28 21:36:54 +01:00
Nicolas Goaziou 8a265e2915 org-element: Remove quote sections
* lisp/org-element.el (org-element-quote-section-parser,
  org-element-quote-section-interpreter): Remove functions.
  (org-element--current-element, org-element--parse-elements): Do not
  handle quote sections at all.
* testing/lisp/test-org-element.el (test-org-element/quote-section-parser):
  Remove test.
2014-01-27 21:14:20 +01:00
Nicolas Goaziou 363fd7e8f3 Merge branch 'maint' 2014-01-20 17:26:12 +01:00
Nicolas Goaziou b79462ba98 ob-exp: Fix a failing test
* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
  Fix a test
2014-01-20 17:25:34 +01:00
Nicolas Goaziou e5617b88cb Merge branch 'maint' 2014-01-20 17:16:32 +01:00
Nicolas Goaziou dde6af3a62 ob-exp: Fix export of src blocks with flags
* lisp/ob-exp.el (org-babel-exp-code): Fix export of src blocks with
  flags.
* testing/lisp/test-ob-exp.el (ob-export/export-src-block-with-flags):
  New test.

Thanks to Giuseppe Lipari for reporting it.
2014-01-20 14:20:06 +01:00
Eric Schulte cd3bc12a29 named and caching call lines working
* lisp/ob-core.el (org-babel-current-result-hash): Additional info
  argument so that named call line results may be found.
  (org-babel-set-current-result-hash): Additional info argument so
  that named call line results may be found.
* lisp/ob-lob.el (org-babel-lob-execute): Passing info to hash finding
  functions so that named results may be found.
2014-01-18 13:40:57 -07:00
Eric Schulte 93d272b449 failing test of named caching call line 2014-01-18 13:40:57 -07:00
Eric Schulte 48c952f23c test of caching call line behavior 2014-01-18 13:40:57 -07:00
Eric Schulte 80754a8591 updated names in test-ob-shell 2014-01-18 13:40:57 -07:00
Eric Schulte 2ebae7bed9 renamed test file for shell code blocks 2014-01-18 13:40:57 -07:00
Nicolas Goaziou c25c80e3f3 Merge branch 'maint' 2014-01-18 15:40:43 +01:00
Nicolas Goaziou 3f9a6916aa ob-exp: Fix code execution in some corner cases
* lisp/ob-exp.el (org-babel-exp-process-buffer): Make processing more
  robust when results are inserted before source block or when source
  block is followed by multiple blank lines.
* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
  Add test.
2014-01-18 15:32:41 +01:00
Michael Brand bc1d54b84b TBLFM remote ref: Add indirection of name or ID
* doc/org.texi (References): Add description for indirection of
NAME-OR-ID.

* lisp/org-table.el (org-table-eval-formula): Make use of
`org-table-remote-reference-indirection'.
(org-table-remote-reference-indirection): New function.

* testing/lisp/test-org-table.el
(test-org-table/remote-reference-indirect): Change to use remote
reference indirection.
2014-01-12 10:53:06 +01:00
Michael Brand 3ab9b6b37d TBLFM remote ref: Add ERT for summary table
* testing/lisp/test-org-table.el
(test-org-table/remote-reference-indirect): Add a use case of
summarizing two tables with a sum into one table for the total; as a
preparation for remote reference indirection.
2014-01-12 10:51:34 +01:00
Bastien Guerry f8e1745440 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-07 14:19:03 +01:00
Bastien Guerry 7d9a883b50 Update copyright years again.
Hint: copyright years are all updated in Emacs.
2014-01-07 14:18:17 +01:00
Nicolas Goaziou d361f465e9 ox: Change meaning of `org-export-with-\(table\|fixed-width\)
* lisp/ox.el (org-export-with-fixed-width, org-export-with-tables):
  Change docstring to reflect new meaning.
(org-export--skip-p): Completely ignore tables and fixed-width areas
if appropriate option is nil.
* testing/lisp/test-ox.el (test-org-export/handle-options): Add tests.
2014-01-05 23:07:13 +01:00
Bastien Guerry c41f5075ac Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-05 06:36:11 +01:00