Commit Graph

15762 Commits

Author SHA1 Message Date
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
Alan Schmitt de71f03d2a Org-expiry: make code and doc consistent
* contrib/lisp/org-expiry.el (org-expiry-expired-p): make code and doc
string consistent.
2014-04-14 14:03:45 +02:00
Nicolas Goaziou ee3cf87d40 Merge branch 'maint'
Conflicts:
	lisp/ox-html.el
2014-04-14 13:56:05 +02:00
Nicolas Goaziou f61cd6b7a1 Fix mailto links
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-odt.el (org-odt-link):
* contrib/lisp/ox-groff.el (org-groff-link): "mailto" URI do not have
  an authority part, we do not append "//".
2014-04-14 13:47:57 +02:00
Nicolas Goaziou d34fa17716 Merge branch 'maint'
Conflicts:
	lisp/ox-html.el
2014-04-14 12:41:38 +02:00
Nicolas Goaziou fc1f7d752f Fix link export
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-link): Append "//" after some link
  types.

* lisp/ox-md.el (org-md-link):
* contrib/lisp/ox-groff.el (org-groff-link): Ditto.  Also remove some
  unused code, as search options are already stripped out link's path.

Since 3589f64e42, Org ignores "//" in
a link type so it has to be re-introduced upon exporting.
2014-04-14 12:36:34 +02:00
Oleh Krehel 3a9bbb0ec3 ob-clojure.el: fix behavior for :results pp
* lisp/ob-clojure.el (org-babel-expand-body:clojure): Simplify the
  pretty printing.
  (org-babel-execute:clojure): Check for "pp" in the parameters.

http://permalink.gmane.org/gmane.emacs.orgmode/84876
2014-04-14 12:28:02 +02: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 e84c1d8442 org.texi: Update COMMENT keyword documentation
* doc/org.texi (Comment lines):
* doc/orgguide.texi (Comment lines): Update COMMENT keyword
  documentation.  Small tense changes.
2014-04-12 10:59:01 +02:00
Bastien Guerry e24f336cd3 Merge branch 'master' of orgmode.org:org-mode 2014-04-11 21:33:08 +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
Bastien Guerry b3987ed79e Add contrib/lisp/ox-gfm.el by Lars Tveito 2014-04-11 12:27:41 +02:00
Bastien Guerry eb0b98d91f Merge branch 'maint'
Conflicts:
	lisp/org.el
2014-04-11 12:22:48 +02:00
Markus Hauck faa1703b8f org.el (org-refile): Allow org-refile goto from everywhere
* lisp/org-agenda.el (org-refile): Flip logic to allow instead of
  prohibit the use of `org-refile' with the goto flat from non
  org-mode buffers.

In commit 49da67d the condition was changed from only
`(unless goto ...)` to `(unless (and goto (listp arg)) ...)`
where the `and` condition is only true for non-empty lists, so that
calling `(org-refile t)` complains about not being inside an org-mode
buffer.

With this patch org-refile can be used (again) from anywhere when
passed the goto flag to jump to the chosen task.

TINYCHANGE
2014-04-11 11:59:43 +02:00
Sacha Chua d6a38604e6 org.el (org-refresh-properties): Don't throw an error when reaching the end of the buffer
* org.el (org-refresh-properties): Don't throw an error when
reaching the end of the buffer.
2014-04-11 11:28:45 +02:00
Eric Schulte e8112c86ec only wrap R code graphics-file on execution
Move this out of the expand-body function so that it is *never*
  applied to tangled code.
2014-04-10 20:34:58 -06:00
Nicolas Goaziou dc71b742a9 ox-latex: Improve error report after compilation
* lisp/ox-latex.el (org-latex-known-warnings): New variable.
(org-latex-known-errors): Remove variable.
(org-latex-compile): Report correctly when pdf file was not produced.
Catch all errors from process.  Report some warnings.
(org-latex--collect-warnings): New function.
(org-latex--collect-errors): Remove function.

http://permalink.gmane.org/gmane.emacs.orgmode/77552
2014-04-10 23:08:04 +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
Oleh Krehel 11f8efcda1 ob-clojure.el: revert cl-case back to case
* lisp/ob-clojure.el (org-babel-execute:clojure): Revert cl-case back
  to case.
2014-04-10 12:51:31 +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
Oleh Krehel 645384a037 ob-clojure: adapt to new cider
* lisp/ob-clojure.el (org-babel-expand-body:clojure): Don't handle
  output here, since the result becomes double quoted with current
  cider. Move to `org-babel-execute:clojure' instead.

  (org-babel-execute:clojure): Use `nrepl-send-string-sync' instead
  of `cider-eval-sync', which was removed.
2014-04-10 10:30:23 +02:00
Nicolas Goaziou ce72d251f7 Merge branch 'maint' 2014-04-09 23:49:49 +02:00
Nicolas Goaziou a768cf045d org-element: Tiny refactoring
* lisp/org-element.el (org-element-headline-parser): Tiny refactoring.
2014-04-09 23:49:04 +02:00
Nicolas Goaziou 1b7d3ffcbf org-element: Tiny fix to headline parsing
* lisp/org-element.el (org-element-headline-parser): Correctly parse
  blank lines after a headline.

Thanks to Thorsten Jolitz for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84753
2014-04-09 23:44:15 +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 798bb8d42f Merge branch 'maint' 2014-04-06 19:59:13 +02:00
Michael Weylandt 0820d002cb ox-latex.el: Downcase language name in minted blocks
* lisp/ox-latex.el (org-latex-export-to-latex): Downcase the language
name when using minted highlighting for src block exports.

Minted, by convention, uses all lowercase names for languages.  This
will handle mappings like "R" to "r" or "Python" to "python"
automatically.  More complex renamings still need to be handled by
customizing `org-latex-minted-langs'.

Note that the `downcase' is only applied when using the "automatic"
name.  Names in `org-latex-minted-langs' still need to be lower-case.

TINYCHANGE
2014-04-06 19:58:06 +02:00
Greg Tucker-Kellogg c99fa2ab8a ox-latex.el: support sideways :float options for tables and figures
* lisp/ox-latex.el (org-latex--inline-image): support a 'sideways
option for the float, and add case to handle it with a \sideaysfigure
in the export.
(org-latex--org-table): support "sideways" instead of deprecated
"sidewaystable".  The latter is still handled for backward
compatibility.

* doc/org.texi (Tables in LaTeX export): Document use of :float
  sideways.
(Images in LaTeX export): Document use of :float sideways.

This patch provides consistent :float sideways support for LaTeX
export of both figures and tables.

http://permalink.gmane.org/gmane.emacs.orgmode/84618

TINYCHANGE
2014-04-06 14:19:55 +02:00
Nicolas Goaziou 081e6b4b3b Merge branch 'maint' 2014-04-06 14:08:16 +02:00
Nicolas Goaziou 2868f962a2 ox-md: Fix handling of switches in source blocks
* lisp/ox-md.el (org-md-example-block): handle switches and references
  in source blocks.
2014-04-06 14:06:08 +02:00
Nicolas Goaziou a36dde7c68 Merge branch 'maint' 2014-04-05 09:51:36 +02:00
Nicolas Goaziou 7de492a0c4 Update docstrings
* lisp/org.el (org-latex-packages-alist,
  org-latex-default-packages-alist): Update docstrings.
2014-04-05 09:50:20 +02:00
Nicolas Goaziou 957177cebc Merge branch 'maint' 2014-04-03 22:51:54 +02:00
Nicolas Goaziou a6485af3e4 ox-ascii: Ignore line breaks when removing duplicates links
* lisp/ox-ascii.el (org-ascii--unique-links): Ignore white spaces when
  uniquifying links in section.

Thanks to Mathias Bauer for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84548
2014-04-03 22:50:53 +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 8a43270e8e org-element: Small fix
* lisp/org-element.el (org-element--cache-process-request): Small fix.

This fixes 7fca554f43.
2014-04-01 08:10:41 +02:00
Nicolas Goaziou 7fca554f43 org-element: Slightly change object cache
* lisp/org-element.el (org-element--cache-objects):
(org-element-context): Simplify structure of object cache.

This change avoids relying on buffer positions and artificial keys.
2014-03-31 22:56:25 +02:00
Alan Schmitt f57b2d7141 ob-ocaml.el: Make sure a value was extracted before printing
* lisp/ob-ocaml.el (org-babel-execute:ocaml): Do not try to print
a value if either the type or the value could not be extracted from
the toplevel.
2014-03-31 14:24:22 +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
Alan Schmitt c6aa8340ba ob-ocaml.el: Clean up babel evaluation of ocaml blocks
* ob-ocaml.el (org-babel-execute:ocaml): Capture the output, type, and
value when evaluating ocaml blocks. Return the one requested by
`results'.

(org-babel-ocaml-parse-output): Change the signature to take a type
and a value. Make the parsing of the type more robust.
2014-03-29 19:51:03 +01:00
Nicolas Goaziou d25846b234 Merge branch 'maint' 2014-03-29 15:02:10 +01:00
Nicolas Goaziou 91175a31ee ox-odt: Ignore blank titles
* lisp/ox-odt.el (org-odt-template): Ignore blank titles.
2014-03-29 15:00:00 +01:00
Nicolas Goaziou f261833a26 Merge branch 'maint' 2014-03-29 14:42:08 +01:00
Nicolas Goaziou 3636783ca4 ox-publish: Fix (invalid-read-syntax "#") error
* lisp/ox-publish.el (org-publish-find-title):
  Fix (invalid-read-syntax "#").

Since 8e1386cead,
`org-element-interpret-data' no longer trims text properties attached
to strings.  We need to remove them before writing the title into the
cache, as text properties are not readable.
2014-03-29 14:41:27 +01:00