Commit graph

131 commits

Author SHA1 Message Date
Eric Schulte 99a07f1d4a org-babel-c: cleaning up header arguments 2010-04-10 15:43:31 -06:00
Eric Schulte 3386a702f8 org-babel: all languages now returning lists as pure emacs-lisp, not quoted emacs-lisp 2010-04-10 15:15:06 -06:00
Dan Davison f846663ce6 babel: Do not add indentation to perl code.
Thanks to Łukasz Stelmach.
2010-04-09 08:45:18 -04:00
Dan Davison 38d6bf3f6c babel: allow assigning of variables when preparing R session
This is already in place for other languages, but seems to have been
forgotten for R.
2010-04-08 15:26:08 -04:00
Eric Schulte caaf755192 babel: org-babel-latex adjusts to the new org latex setup 2010-04-07 22:43:37 -06:00
Dan Davison e48b8bf577 babel: return string results from matlab as strings
Thanks to Bob Jansen
2010-04-07 18:44:58 -04:00
Dan Davison f03c981fc0 babel: return string results from octave as strings
Thanks to Darlan Cavalcante
2010-04-07 15:51:04 -04:00
Dan Davison 40a8933ba6 babel: allow R to produce svg format output 2010-04-01 18:45:59 -04:00
Eric Schulte 2675848d37 babel: org-babel-c now responds to :cmdline header argument 2010-03-29 12:26:53 -06:00
Dan Davison 36351d26a9 Merge branch 'master' of git://repo.or.cz/org-mode 2010-03-27 16:18:27 -04:00
Dan Davison 47571965d4 babel: don't process emacs-lisp params twice 2010-03-27 15:59:53 -04:00
Eric Schulte 8ecc86d49e babel: better variable initialization for org-babel-c 2010-03-27 08:20:38 -06:00
Eric Schulte 22e4cd9b6d babel: org-babel-c more robust, better error messages and c++ support 2010-03-26 19:35:31 -06:00
Eric Schulte b61019489c babel: org-babel-C now displays compilation error messages 2010-03-26 17:12:43 -06:00
Eric Schulte 17790c7dad babel: limited initial support for C and similar languages 2010-03-26 16:28:23 -06:00
Dan Davison adb2f3f590 babel: Add octave and matlab support 2010-03-18 14:45:39 -04:00
Dan Davison f4ae431706 babel: Make code block params available when initiating session 2010-03-13 14:02:31 -05:00
Dan Davison ba4d698fa1 babel: Provide notification of errors during code execution
This deals with external process :results value mode for R, ruby,
python, perl and clojure: if the shell process has a non-zero exit
code, a buffer containing stderr is displayed.
2010-03-05 11:32:18 +00:00
Dan Davison 05986e95ea babel: Introduce org-babel copy of shell-command-on-region
At this commit, org-babel-shell-command-on-region is a direct copy of
shell-command-on-region. In addition to switching to use the org-babel
version, we change the argument passed so that they agree with the
docstring of s-c-o-r.

Despite the change in arguments, the same behaviour results because
s-c-o-r does not behave as documented in emacs23. Future commits will
be able to fix these bugs in the org-babel version, as necessary.
2010-03-05 11:32:04 +00:00
Dan Davison ed7b8bfcca babel: clojure: read results remotely when necessary 2010-03-03 22:00:08 +00:00
Dan Davison 54c7b04734 babel: clojure: use shell-command-on-region 2010-03-03 21:59:32 +00:00
Dan Davison a8c1a49b77 babel: Read perl results remotely when necessary. 2010-03-03 16:11:04 +00:00
Eric Schulte f0f511916a babel: org-babel-oz.el now uses unix-style newline characters 2010-03-01 08:31:05 -07:00
Dan Davison 322fe431c5 babel: Write R input data remotely when necessary. 2010-02-27 18:19:09 -05:00
Eric Schulte a705bf5925 babel: wrapped org-babel-make-remote-file-name' in conditional as org-babel-maybe-remote-file' 2010-02-27 18:18:37 -05:00
Dan Davison 24cdeea122 babel: read remote results from remote files
When using ':results value' in certain situations, results are written
to file by the foreign language process and subsequently read from
file by emacs into an elisp table structure. If the foreign language
process is running remotely, then the results are written
remotely. These changes ensure that in that case, an appropriate
remote file name is constructed to read the remote data.
2010-02-27 14:14:08 -05:00
Dan Davison b3d5a1eb39 babel: working directories and remote execution
This introduces a new header argument :dir. For the duration of source
block execution, default-directory is set to the value of this header
argument. Consequences include:

- external interpreter processes run in that directory
- new session processes run in that directory (but existing ones are unaffected)
- relative paths for file output are relative to that directory

The name of a directory on a remote machine may be specified with
tramp syntax (/user@host:path), in which case the interpreter
executable will be sought in tramp-remote-path, and if found will
execute on the remote machine in the specified remote directory.
2010-02-27 14:14:08 -05:00
Dan Davison 5f8a57ad48 babel: change implementation of external R process evaluation
Use shell-command-on-region, bringing R into line with ruby, python,
clojure, shell. In addition to consistency (and perhaps efficiency),
this will also be preferable in the case of a remote R process because
it means that transfer of the input to the remote process is dealt
with automatically by tramp.
2010-02-27 14:14:08 -05:00
Dan Davison cc7052540b babel: allow point to move to end of comint buffer 2010-02-27 14:14:07 -05:00
Dan Davison 5833fbd358 babel: Make colnames header arg expect use "yes" for true. 2010-02-25 17:58:46 -05:00
Dan Davison 4064c31fa7 babel: get rid of unused variable 2010-02-25 17:58:46 -05:00
Dan Davison fc693eb5e2 babel: treat python tuples as lists 2010-02-25 17:58:45 -05:00
Dan Davison a95c05773e babel: Fix unquoting of strings
Before this change we have

 #+begin_src ruby :results value :session
 ["1", "3"]
 #+end_src

 #+results:
 : 1", "3

 After, we have

 #+begin_src ruby :results value :session
 ["1", "3"]
 #+end_src

 #+results:
 | 1 | 3 |
2010-02-25 17:58:45 -05:00
Eric Schulte 8625e5c0bc babel: gnuplot can now return it's string output -- when session is set to "none" 2010-02-23 08:16:25 -07:00
Dan Davison a2d94ffc8e babel: prevent quoting of strings in shell variables 2010-02-23 07:31:43 -07:00
Eric Schulte 574f1b590e babel: adding support for the OZ programming language -- Thanks to Torsten Anders!
For information on the OZ programming language see
  http://www.mozart-oz.org/, for information on using Org-babel with
  OZ see the OZ specific documentation on Worg at
  http://orgmode.org/worg/org-contrib/babel/languages/org-babel-doc-oz.php
2010-02-16 13:28:08 -07:00
Dan Davison 1e96482389 babel: check pdf file existence before deleting 2010-02-15 10:29:56 -07:00
Eric Schulte df418de954 babel-clojure: slight change allowing strings to be passed in as variables 2010-02-08 13:17:37 -07:00
Eric Schulte a60a83fbb6 babel: better handling of table in shell scripts 2010-02-07 10:17:20 -07:00
Eric Schulte 047ac8ab1b babel: shell command used by org-babel-sh is now configurable using the org-babel-sh-command variable 2010-02-07 09:36:56 -07:00
Eric Schulte e4bc599745 org-babel-latex: allow pdf/png generation directly from latex source blocks 2010-02-06 09:54:10 -07:00
Eric Schulte aa72dfc54f babel: implement org-babel-load-session:* for R, clojure, gnuplot, python, ruby and sh 2010-01-11 10:14:30 -07:00
Joel Boehland baa98c1f14 Added support to name the slime-output-buffer (slime-repl) to the name of the respective org-babel session
Signed-off-by: Joel Boehland <joel.boehland@evocomputing.com>
2010-01-09 14:25:18 -07:00
Joel Boehland 7121a5e9c8 babel: add session support for clojure 2010-01-06 17:38:35 -07:00
Eric Schulte 0969873888 org-babel-gnuplot: variable expansion in gnuplot source-code with '$' character
Variable names in gnuplot source code preceded by the '$' character
  will be expanded to their value before the code is executed.  For
  example the following will results in the evaluation of 'plot
  sin(x)' by gnuplot.

  "sin(x)"

  plot $fun
2009-11-30 21:01:43 -07:00
Benjamin Andresen c1ee488f45 org-babel-screen: now parsing it's own parameters 2009-11-30 07:20:51 -07:00
Eric Schulte bec1643a40 org-babel-sh: fixed session-based evaluation for sh blocks 2009-11-27 12:31:28 -07:00
Dan Davison a9069d8dfd org-babel: more robust version of :results value for python and perl.
In ':results value' ('functional') mode, a return statement is now
required in python and perl code.
2009-11-11 16:09:05 -05:00
Joel Boehland 838363f047 Change defn to def for session level variable declarations. Trim trailing whitespace. 2009-11-11 11:52:51 -07:00
Dan Davison 3547a6b64d org-babel: further cleaning of parameter-passing to language files
Also update docstrings of language execution functions to reflect
changes.
2009-11-10 15:23:26 -07:00
Eric Schulte 0fa68a53ba org-babel: language specific files using cleaner parameter passing 2009-11-10 15:23:18 -07:00
Eric Schulte 97e21c5b09 org-babel-clojure: one list tiny fix 2009-11-09 22:44:13 -07:00
Eric Schulte 103e0c4bf5 org-babel-clojure: minor bug fixes 2009-11-09 22:24:06 -07:00
Joel Boehland 78a3c5d57b org-babel-clojure: Added clojure language support to org-babel 2009-11-09 22:23:38 -07:00
Dan Davison bec4551d8b org-babel: Add support for perl
Session-based evaluation is not supported.
2009-11-09 09:32:04 -07:00
Dan Davison 3ec02a953d org-babel-python: Silent bug fix.
The code worked because the unintended extra parentheses didn't cause problems.
2009-11-09 09:32:02 -07:00
Dan Davison 6875d4d8e3 org-babel: file output for ruby and python
With this change, if :file <filepath> is specified, ruby and python
blindly output a link to <filepath>. Responsibility for creating the
contents in <filepath> lies with the python/ruby code.
2009-11-09 09:32:01 -07:00
Eric Schulte e3bf0b4a81 org-babel-haskell: org-babel-haskell-export-to-lhs now optionally preserves indentation
based either on the value of org-src-preserve-indentation or the
    presence of the -i switch
2009-11-04 17:46:55 -07:00
Eric Schulte e01839a826 org-babel-latex: initial support for exporting latex from org-babel 2009-10-28 16:13:53 -06:00
Dan Davison 68a1240db8 org-babel: ensure that result is returned when using :results output
One half of this patch is a revert of c167a4ac32.

These changes are necessary so that :results output works correctly
with #+lob calls. For example the following example did not work:

--------------------------------------------------
3. :results output org -> doesn't work with #+lob:
--------------------------------------------------
\#+srcname: randthree(n,max)
\#+begin_src ruby
number = n
maximum = max
puts "* Random numbers\n" +
"Here are some random numbers: " +
(1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
"."
\#+end_src

\#+lob: randthree(n=3,max=10) :results output org
2009-10-20 09:24:15 -04:00
Dan Davison 64c26c6561 org-babel: remove prompt characters from R output
When evaluating R code in a persistent session, lines of output
typically start with a single prompt character. However, under certain
circumstances, lines start with a concatenation of (primary and
secondary) prompt characters separated by spaces. This seems to be
related to having blank lines in the input. This fix ensures that all
such prompt characters are removed from the output.
2009-10-19 23:34:13 -04:00
Dan Davison 8ca34cba0b org-babel: alter R tangling defaults
Use "#!/usr/bin/env Rscript", and use ".R" instead of ".r".
2009-10-19 21:44:41 -04:00
Dan Davison 8b52bf09e0 org-babel: capture graphical output from R
If a [:file filename.ext] header arg is provided, then all graphical
output from the source block is captured on disk, and output of the
source block is a link to the resulting file, as with the
graphics-only languages such as gnuplot, ditaa, dot, asymptote. An
attempt is made to find a graphics device corresponding to the file
extension (currently .png, .jpg, .jpeg, .tiff, .bmp, .pdf, .ps,
.postscript are recognised); if that fails, png format output is
created.

Additionally, values for several arguments to the R graphics
device can be passed using header args:

:width :height :bg :units :pointsize
:antialias :quality :compression :res :type
:family :title :fonts :version :paper :encoding
:pagecentre :colormodel :useDingbats :horizontal

Arguments to the R graphics device that are not supported as header
args can be passed as a string in R argument syntax, using the header
arg :R-dev-args

An example block is (although both bg and fg can be passed directly as
header args)

\#+begin_src R :file z.pdf :width 8 :height 8 :R-dev-args bg="olivedrab", fg="hotpink"
  plot(matrix(rnorm(100), ncol=2), type="l")
\#+end_src
2009-10-19 21:44:28 -04:00
Eric Schulte 3db817fb02 org-babel: now supports pp results (emacs-lisp, ruby, python) 2009-10-18 16:18:34 -06:00
Eric Schulte c167a4ac32 org-babel: emacs-lisp now returns nothing when ":results output" 2009-10-18 16:18:27 -06:00
Eric Schulte 28e6ff8d66 org-babel: adding python support (along the same lines as ruby) 2009-10-16 17:05:31 -06:00
Eric Schulte 770305a650 org-babel: adding ruby support for returning "code" results 2009-10-16 17:05:13 -06:00
Eric Schulte 430a3bf6ad org-babel: "code" results type for returning results in of source code syntax
This includes the required changes to org-babel.el and a
language-specific implementation for emacs-lisp.  The emacs-lisp
changes are from a patch by Benny Andresen.
2009-10-16 17:04:55 -06:00
Eric Schulte b0c1758c2a org-babel: dot improvements
for more information on the dot family of tools see
http://www.graphviz.org/
2009-10-14 16:03:40 -06:00
Eric Schulte 0444ca8661 org-babel: haskell lhs2tex export now responds to prefix argument 2009-10-09 11:44:27 -06:00
Eric Schulte c0d54a9a6b org-babel: Haskell lhs export: ensure all \[begin|end]{code} statements start at the first column 2009-10-07 16:01:24 -06:00
Eric Schulte 407bf3b816 org-babel: haskell lhs export now displays errors and configurable org-babel-haskell-lhs2tex-command 2009-10-04 17:49:01 -06:00
Eric Schulte 63b360041f org-babel: org-babel-haskell can now export to .lhs literate Haskell
this commit adds the function `org-babel-haskell-export-to-lhs'

   for information on lhs see http://people.cs.uu.nl/andres/lhs2tex/
2009-10-04 16:41:45 -06:00
Benjamin Andresen ce4aad900a org-babel: add langs/org-babel-screen.el 2009-10-04 10:22:30 -06:00
Eric Schulte 3f1be49a04 adding org-babel-load-in-session-maybe bound to Meta-Up (currently only for Haskell) 2009-09-24 21:58:49 -06:00
Eric Schulte 0fa8a7feac fleshed out org-babel-haskell-prep-session (called with Meta-Down inside source block) 2009-09-24 21:58:48 -06:00
Eric Schulte a704ce4896 org-babel-asymptote now supports interactive viewing if the :file header argument is missing 2009-09-16 16:21:45 -06:00
Eric Schulte 8e87868df2 org-babel: asymptote maps to asy-mode in `org-src-lang-modes' and added requirements section to org-babel-asymptote.el 2009-09-16 10:54:43 -06:00
Eric Schulte 6ce74742b8 org-babel-execute:gnuplot no longer pops up a gnuplot window
also some whitespace-only indentation changes in org-babel.el
2009-09-14 20:22:56 -06:00
Eric Schulte 133aa88a06 renaming the org-babel-lisp file to org-babel-emacs-lisp 2009-09-13 10:07:31 -06:00
Eric Schulte c0554c7753 merging with the org-babel repository 2009-09-11 13:44:05 -06:00