Commit Graph

829 Commits

Author SHA1 Message Date
rasmus 4412fed850 test-ox.el: Fix test-error from 986037a.
* test-ox.el (test-org-export/expand-include): Updated tests.
2014-10-02 21:05:10 +02:00
Rasmus 986037a538 ox: Allow file-links with #+INCLUDE-keyword
* org.el (org-edit-special): Handle file-links for INCLUDE.
* ox.el (org-export--prepare-file-contents): Handle links and
add option no-heading.
* ox.el (org-export-expand-include-keyword): Resolve headline
links and add option :only-contents.
* orgguide.texi (Include files)
org.texi (Include files): Updated.
* testing/examples/include.org: New examples.
* test-ox.el (test-org-export/expand-include): New tests.
2014-10-02 18:51:37 +02:00
Achim Gratz 7585fe449b ob-ruby: clean up the session code some more and work around an I/O sync problem in comint
* lisp/ob-ruby.el (org-babel-ruby-evaluate): Clean up the session code
  and remove a superfluous `butlast'.  Work around a problem in comint
  where the first prompt in a session may be printed after the
  evaluation has already started, thus producing a spurious line in
  the output.

* testing/lisp/test-ob-ruby.el (test-ob-ruby/session-output-1,
  test-ob-ruby/session-output-2 test-ob-ruby/session-output-3): Test
  correct transfer of interpreter state across several session
  invocations.
2014-09-21 17:59:49 +02:00
Achim Gratz 4ef78e68c1 ob-ruby: fix a24775dc79 again
* lisp/ob-ruby.el (org-babel-ruby-evaluate): Temporarily disable the
  irb prompt to ensure that the output is properly recognized using
  the standard settings from inf-ruby and no extra settings in .irbrc
  or other configuration files from Ruby.  Remove superfluous
  `comint-send-input' that produced a spurious empty line in output.
* testing/lisp/test-ob-ruby.el (test-ob-ruby/session-output): Remove
  spurious emtpy line in expected output.
2014-09-21 12:57:49 +02:00
Achim Gratz 7070545599 Merge branch 'maint' 2014-09-20 21:55:09 +02:00
Achim Gratz 1113e3e027 test-ob-exp: fix failing test
* testing/lisp/test-ob-exp.el (ob-exp/export-from-a-temp-buffer):
  Check for the correct expected output so the test stops failing.
2014-09-20 21:54:21 +02:00
Nicolas Goaziou 0620fe98cb Merge branch 'maint' 2014-09-19 21:03:27 +02:00
Nicolas Goaziou 3f484a5277 Fix headline insertion after an empty headline
* lisp/org.el (org-N-empty-lines-before-current): Make sure to delete
  only empty lines, not trailing whitespaces.

* testing/lisp/test-org.el (test-org/insert-heading): Add test.

Thanks to Oleh for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/90876
2014-09-19 20:59:40 +02:00
Nicolas Goaziou 3432681fbe Parsing and exporting special blocks preserve case
* lisp/org-element.el (org-element-special-block-parser):
* lisp/ox-latex.el (org-latex-special-block):
* lisp/ox-html.el (org-html-special-block):
* lisp/ox-man.el (org-man-special-block):
* lisp/ox-odt.el (org-odt-special-block):
* lisp/ox-texinfo.el (org-texinfo-special-block):
* contrib/lisp/ox-groff.el (org-groff-special-block): Preserve case.

* testing/lisp/test-org-element.el (test-org-element/special-block-parser):
  Add test.
2014-09-17 20:52:54 +02:00
Nicolas Goaziou c8a7e474ec Fix `org-hide-block-toggle' return value
* lisp/org.el (org-hide-block-toggle-maybe): Do not return a non-nil
  value when toggling failed.
(org-hide-block-toggle): Update docstring.

* testing/lisp/test-org.el (test-org/hide-block-toggle-maybe): New
  test.
2014-09-16 09:29:28 +02:00
Michael Brand 739136e17f Table formula: Fix for Lisp return value nil
* lisp/org-table.el (org-table-eval-formula): Substitute `listp' with
`consp'.

* testing/lisp/test-org-table.el (test-org-table/lisp-return-value):
Fix test.
2014-09-14 10:44:28 +02:00
Michael Brand 551891e2ad Table formula: Add ERT for Lisp return values
* testing/lisp/test-org-table.el (test-org-table/lisp-return-value):
Add test with TODO.
2014-09-14 10:43:37 +02:00
Nicolas Goaziou 97ae50fab3 org-element: Fix planning parsing
* lisp/org-element.el (org-element-planning-parser): Remove useless
  check.
(org-element--next-mode): Change signature.
(org-element--parse-elements, org-element--parse-to): Apply signature
change.

* testing/lisp/test-org-element.el (test-org-element/planning-parser):
  Add test.
2014-09-13 22:31:06 +02:00
Nicolas Goaziou 9209aa3c9d org-table: Use "ox.el" internally for radio tables
* lisp/org-table.el (org-table-clean-before-export, orgtbl-get-fmt,
  orgtbl-apply-fmt, orgtbl-eval-str, orgtbl-format-line,
  orgtbl-format-section): Remove functions.
(org-table-clean-did-remove-column, *orgtbl-table*, *orgtbl-rtn*,
  *orgtbl-hline*, *orgtbl-sep*, *orgtbl-default-fmt*, *orgtbl-fmt*,
  *orgtbl-efmt*, *orgtbl-lfmt*, *orgtbl-llfmt*, *orgtbl-lstart*,
  *orgtbl-llstart*, *orgtbl-lend*, *orgtbl-llend*): Remove variables.

(org-table-export, orgtbl-send-table): Apply function removal.  Do not
set `org-table-last-alignment' and `org-table-last-column-widths'
anymore.
(org-table-to-lisp, orgtbl-send-replace-tbl): Small refactoring.

(org-table--to-generic-table, org-table--to-generic-row,
org-table--to-generic-cell): New functions.
(orgtbl-to-generic): Rewrite function.  Handle :skip and :skipcols
parameters.
(orgtbl-to-latex, orgtbl-to-html, orgtbl-to-texinfo, orgtbl-to-orgtbl,
orgtbl-to-unicode): Use new `orgtbl-to-generic' features.

* testing/lisp/test-org-table.el (test-org-table/to-generic,
  test-org-table/to-latex, test-org-table/to-texinfo,
  test-org-table/to-html, test-org-table/to-unicode,
  test-org-table/send-region): New tests.

* doc/org.texi (Radio tables, A @LaTeX{} example, Translator
  functions): Update documentation.

* etc/ORG-NEWS (argument): Document new features.
2014-09-13 15:10:26 +02:00
Nicolas Goaziou b5c9de618e Merge branch 'maint' 2014-09-08 12:10:28 +02:00
Nicolas Goaziou 7c48bdd7a8 Revert "ox: Implement predicate for export blocks"
This reverts commit 2160b3d242.
2014-09-08 12:09:52 +02:00
Nicolas Goaziou e3369c07f0 Revert "Merge export and special blocks within back-ends"
This reverts commit fbc7097ffa.

Conflicts:
	lisp/ox-texinfo.el
2014-09-08 11:57:27 +02:00
Nicolas Goaziou f51a72c95c Merge branch 'maint'
Conflicts:
	lisp/org.el
2014-09-02 12:34:47 +02:00
Nicolas Goaziou 2de0c1c3da Fix 37bf05
* lisp/org.el (org-re-property): Fix regexp.  Improve docstring.
* testing/lisp/test-org-element.el (test-org-element/node-property):
  Update test.

Thanks to Daimrod for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/90383
2014-09-02 12:33:35 +02:00
Nicolas Goaziou 539eac9211 org-element: Recognize planning info only right after a headline
* lisp/org.el (org-planning-line-re): New variable.  Renamed from
  `org-planning-or-clock-line-re'.

* lisp/org-element.el (org-element-paragraph-separate,
  org-element-headline-parser, org-element-inlinetask-parser, ,
  org-element--current-element): Use new variable.
(org-element-planning-parser): Check previous line before parsing
planning info.  When right after a headline, fallback to paragraph
parsing.

* testing/lisp/test-org-element.el (test-org-element/planning-parser):
  Add a test.  Update others.
(test-org-element/timestamp): Remove a test.
* testing/lisp/test-ox.el (test-org-export/handle-options): Update
  test.
2014-08-31 15:39:35 +02:00
Nicolas Goaziou d2643be6d8 Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2014-08-31 11:43:27 +02:00
Nicolas Goaziou 37bf0576f2 org-element: Make properties parsing more robust
* lisp/org-element.el (org-element-property-drawer-parser,
  org-element-node-property-parser): Ignore lines that are not node
  properties.
(org-element-node-property-interpreter): Allow nil properties.

* lisp/org.el (org-re-property): Fix regexp to match properties with
  empty values.

* testing/lisp/test-org-element.el (test-org-element/node-property):
  Add tests.

Thanks to Eike for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/90293
2014-08-31 11:10:56 +02:00
Nicolas Goaziou 3b4745d32a Merge branch 'maint'
Conflicts:
	lisp/org-element.el
2014-08-28 11:10:15 +02:00
Nicolas Goaziou 2e5b3dede1 org-element: Interpret headlines according to `org-odd-levels-only'
* lisp/org-element.el (org-element-headline-interpreter): Take into
  consideration `org-odd-levels-only' value.  Small refactoring.

* testing/lisp/test-org-element.el (test-org-element/headline-interpreter):
  Add test.
2014-08-28 11:07:24 +02:00
Nicolas Goaziou d47f66d6d0 ox: Implement `org-export-table-row-in-header-p'
* lisp/ox.el (org-export-table-row-in-header-p): New function.
(org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p): Use new function.

* testing/lisp/test-ox.el (test-org-export/table-row-in-header-p): New
  test.
2014-08-26 15:05:52 +02:00
Nicolas Goaziou 81906c52ae ox: Extend first and last sibling predicates to all elements
* lisp/ox.el (org-export-first-sibling-p, org-export-first-sibling-p):
  Extend to all elements and objects.

* testing/lisp/test-ox.el (test-org-export/first-sibling-p,
  test-org-export/last-sibling-p): Add tests.

* etc/ORG-NEWS: Document change.
2014-08-26 14:48:05 +02:00
Nicolas Berthier 6f0843d8a3 ob-core: Preserve inline-ness of source blocks when inserting results
* lisp/ob-core.el (org-babel-insert-result): Preserve inline-ness of
source blocks.

* testing/lisp/test-ob-exp.el: Update newly passing tests.
2014-08-22 14:39:39 +02:00
Nicolas Berthier 795c004396 ob: Support for exporting inline source code
* lisp/ob-exp.el (org-babel-exp-inline-code-template): New
customizable variable to export inline source code (similar to
`org-babel-exp-code-template').
(org-babel-exp-code): New `type' argument to differentiate between
inline and standard code blocks.

* lisp/ob-core.el (org-babel-inline-src-block-regexp): Allow empty set
of switches and header arguments as in "src_sh[]{echo foo;}".  Also
permit spaces before them.

* testint/lisp/test-org-element.el
(test-org-element/inline-src-block-parser): Test extended syntax for
inline source code.

* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): New
function for testing inline source code handling.  Also add three new
failing tests exhibiting unexpected results with ":results code"
switches.

* testing/lisp/test-ob.el
(test-org-babel/org-babel-get-inline-src-block-matches): Test for
inline source blocks with empty header arguments.

* testing/examples/babel.org: New sections for testing (i) exported
inline source code (used by `ob-exp/exports-inline-code'); (ii)
parsing inline source blocks with empty header arguments (used by
`test-org-babel/org-babel-get-inline-src-block-matches').

Until now pieces of inline source code were handled as standard code
blocks during export.  These changes enable them to be exported.
2014-08-22 14:39:38 +02:00
Achim Gratz 64821bd967 ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
  org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
  org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
  org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
  org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
  org-babel-lilypond-determine-ly-path,
  org-babel-lilypond-determine-pdf-path,
  org-babel-lilypond-determine-midi-path): Remove.
  (org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
  org-babel-lilypond-pdf-command): Replacement for removed variables
  and functions.  Adapt all calls to the removed functions to use
  these variables instead.
  (org-babel-lilypond-commands): New defcustom for setting up
  the *-command variables.  Keep different defaults for different
  systems as the original code did to avoid tripping up unsuspecting
  users.
  (org-babel-lilypond-execute-tangled-ly,
  org-babel-lilypond-check-for-compile-error): Revert conditions to
  avoid superfluous forms.  Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
  replace removed function calls with the appropriate variable
  content.  Exercise the new defcustom thoroughly.
2014-08-20 22:24:01 +02:00
Achim Gratz b03ce7fc8d Merge branch 'maint' 2014-08-20 21:12:23 +02:00
Achim Gratz b8bd2147cb ob-lilypond: change prefix to org-babel-lilypond
* lisp/ob-lilypond.el, testing/lisp/test-ob-lilypond.el: Change prefix
  from `ly-' to `org-babel-lilypond-' throughout.
2014-08-20 21:10:00 +02:00
Nicolas Goaziou 88101ef434 Merge branch 'maint' 2014-08-15 21:52:17 +02:00
Nicolas Goaziou c1bc685500 org-list: Fix failing test
* testing/lisp/test-org-list.el (test-org-list/to-texinfo): Fix
  failing test.
2014-08-15 21:51:42 +02:00
Nicolas Goaziou 60851f4fc7 org-element: Fix common indentation removal in verse block
* lisp/org-element.el (org-element-normalize-contents): Fix
  indentation removal when there is an empty line within a verse block.
* testing/lisp/test-org-element.el (test-org-element/normalize-contents):
  Add test.
2014-08-15 21:46:46 +02:00
Nicolas Goaziou f197737a53 org-list: Fix failing test
* testing/lisp/test-org-list.el (test-org-list/to-texinfo): Fix test.
2014-08-08 22:57:50 +02:00
Nicolas Goaziou 879010160e org-element: Accept missing final newlines in block values
* lisp/org-element.el (org-element-comment-block-interpreter,
  org-element-example-block-interpreter,
  org-element-src-block-interpreter): Handle values with missing final
  newline, e.g., when built by the user.

* testing/lisp/test-org-element.el (test-org-element/comment-block-interpreter,
  test-org-element/example-block-interpreter,
  test-org-element/src-block-interpreter): Add tests

Thanks to Thorsten Jolitz for suggesting the idea.
http://permalink.gmane.org/gmane.emacs.orgmode/89602
2014-08-07 14:55:48 +02:00
Nicolas Goaziou 604b93892c ox: Title fallbacks to nil instead of file name
* lisp/ox.el (org-export--get-inbuffer-options):
(org-export-as): Remove title default value handling.
(org-export--get-buffer-attributes): Remove unnecessary property.

* doc/org.texi (Document title):
(Export settings):
* doc/orgguide.texi (Export options): Update documentation.

* testing/lisp/test-ox.el (test-org-export/set-title): Update tests
  according to new specifications.
2014-08-02 21:14:22 +02:00
Nicolas Goaziou cdb85242d6 Fix block hiding
* lisp/org.el (org-hide-block-toggle): Correctly find boundaries of
  the block at point.  Fix `off' argument behavior.  Allow to hide
  a block when at any affiliated keyword.

* testing/lisp/test-org.el (test-org/hide-block-toggle): New test.

Thanks to Andrea Rossetti for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/89324
2014-08-01 10:50:36 +02:00
Achim Gratz 547f6ee541 Fix 1f3fefcba5
* testing/lisp/test-org.el: The title of the Emacs manual is "The Emacs Editor".
2014-07-29 21:55:47 +02:00
Bastien Guerry 1f3fefcba5 test-org.el: Test info link using Emacs info documentation
* test-org.el (test-org/open-at-point-in-property)
(test-org/open-at-point-in-comment)
(test-org/open-at-point/info): Test info link using Emacs info
documentation.
2014-07-27 15:42:28 +02:00
Nicolas Goaziou bc43228e6d Remove `export-block' syntax type
* lisp/org-element.el (org-element-all-elements): Remove
  `export-block' type.
(org-element-block-name-alist): Make it a defconst since it is not
meant to be changed anymore.
(org-element-export-block-parser,
org-element-export-block-interpreter): Remove functions.

* lisp/ox.el (org-export-filters-alist): Remove export block filter.
(org-export-register-backend): Do not alter
`org-export-block-name-alist' anymore.
(org-export-define-backend, org-export-define-derived-backend): Update
docstring.
(org-export-filter-export-block-functions): Remove variable.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser,
  test-org-element/export-block-interpreter): Remove tests.

* testing/lisp/test-ox.el (test-org-export/define-backend): Update test.
2014-07-27 14:29:21 +02:00
Nicolas Goaziou b77a026a24 Merge branch 'maint' 2014-07-27 14:28:53 +02:00
Nicolas Goaziou 2160b3d242 ox: Implement predicate for export blocks
* lisp/ox.el (org-export-raw-special-block-p): New function.

* testing/lisp/test-ox.el (test-org-export/raw-special-block-p): New
  test.

This patch is a forward-compatibility measure since the function is
mandatory for export back-ends in Org 8.3. It makes it easier for
back-end maintainers to provide a back-end compatible with both Org
8.2 and 8.3.
2014-07-27 14:25:44 +02:00
Rasmus 46a4590524 testing/README: Changes to "Interactive testing"
* testing/README: Changes in "Interactive testing" instructions.
2014-07-27 14:14:28 +02:00
Nicolas Goaziou 30db07e427 test-org-element: Fix indentation
* testing/lisp/test-org-element.el (test-org-element/link-parser): Fix
  indentation.
2014-07-26 15:11:38 +02:00
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