Commit Graph

172 Commits

Author SHA1 Message Date
Bastien Guerry 4a0afac669 ob-python.el: Fix compatibility bug.
* ob-python.el (org-babel-python-command): Fix docstring.
(org-babel-python-initiate-session-by-key): Fix bug: `run-python'
from Emacs >24.1 requires a python command as an argument.

Thanks to Myles English for raising this issue.
2013-01-23 13:58:20 +01:00
Bastien Guerry 5fc740a230 Merge branch 'maint' 2013-01-08 15:04:40 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +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
Eric Schulte ff0081847c requiring ob now pulls in all of Babel 2012-12-12 10:48:56 -07:00
Achim Gratz ba59eebb12 ob-python: specify defcustom parameters
* lisp/ob-python.el (org-babel-python-hline-to,
  org-babel-python-None-to): Specify customize group as 'org-babel and
  widget type as 'string.
2012-12-12 10:48:56 -07:00
Eric Schulte 78cdf14939 org-babel-result-cond - unified handling of results
* lisp/ob.el (org-babel-result-cond): This function should now be used
  by all language backends to handle the processing of raw code block
  output into scalar results, table results, or ignored results
  depending on the value of result-params.

* lisp/ob-C.el (org-babel-C-execute): Use org-babel-result-cond.
* lisp/ob-R.el (org-babel-R-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-R-evaluate-session): Use org-babel-result-cond.
* lisp/ob-awk.el (org-babel-execute:awk): Use org-babel-result-cond.
* lisp/ob-clojure.el (org-babel-execute:clojure): Use
  org-babel-result-cond.
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Use
  org-babel-result-cond.
* lisp/ob-fortran.el (org-babel-execute:fortran): Use
  org-babel-result-cond.
* lisp/ob-io.el (org-babel-io-evaluate): Use org-babel-result-cond.
* lisp/ob-java.el (org-babel-execute:java): Use org-babel-result-cond.
* lisp/ob-lisp.el (org-babel-execute:lisp): Use org-babel-result-cond.
* lisp/ob-maxima.el (org-babel-execute:maxima): Use
  org-babel-result-cond.
* lisp/ob-picolisp.el (org-babel-execute:picolisp): Use
  org-babel-result-cond.
* lisp/ob-python.el (org-babel-python-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-python-evaluate-session): Use org-babel-result-cond.
* lisp/ob-scala.el (org-babel-scala-evaluate): Use org-babel-result-cond.
* lisp/ob-sh.el (org-babel-sh-evaluate): Use org-babel-result-cond.
* lisp/ob-shen.el (org-babel-execute:shen): Use org-babel-result-cond.
* lisp/ob-sql.el (org-babel-execute:sql): Use org-babel-result-cond.
* lisp/ob-sqlite.el (org-babel-execute:sqlite): Use
  org-babel-result-cond.
2012-11-18 21:58:38 -07:00
Eric Schulte 32a6bae7c0 better hline and None translations in ob-python
* lisp/ob-python.el (org-babel-python-hline-to): Customize hline
  conversion to python.
  (org-babel-python-None-to): Customize none conversion from python.
  (org-babel-python-var-to-python): Use new variable.
  (org-babel-python-table-or-string): Use new variable.
2012-10-30 18:04:50 -06:00
Bastien Guerry 222eae4033 Fix error messages: don't use a dot at the end 2012-09-28 17:47:48 +02:00
Bastien Guerry 70dd1196d2 Massive code clean-up.
Delete trailing whitespaces.
Indent all sexps correctly.
Sentences end with double spaces.
2012-08-11 19:10:44 +02:00
Bastien Guerry e85479aeb1 Don't use `org-flet' in some functions
* ob-ref.el (org-babel-ref-index-list): Use let* and rename
the variable `length' to `lgth'.

* org-plot.el (org-plot/gnuplot-to-grid-data): Don't use
̀org-flet'.

* org-exp.el (org-export-format-source-code-or-example):
Ditto.

* org-exp-blocks.el (org-export-blocks-preprocess): Ditto.

* ob.el (org-babel-view-src-block-info)
(org-babel-execute-src-block, org-babel-edit-distance)
(org-babel-switch-to-session-with-code)
(org-babel-balanced-split, org-babel-insert-result): Ditto.

* ob-ref.el (org-babel-ref-index-list): Ditto.

* ob-python.el (org-babel-python-evaluate-session): Ditto.

* ob-lob.el (org-babel-lob-get-info): Ditto.

* ob-gnuplot.el (org-babel-expand-body:gnuplot): Ditto.

* ob-exp.el (org-babel-exp-do-export): Ditto.
2012-08-09 21:06:33 +02:00
Bastien Guerry 8eb584331a Add punctuation at the end of the first line of docstrings. Code cleanup. 2012-07-30 10:08:15 +02:00
Eric Schulte 63b5f8f2e8 replace flet/labels with org-flet/org-labels
This patch ensure Org-mode will build on all supported versions of
Emacs, after the renaming of the cl macros behind the cl- prefix in the
recent Emacs trunk.

* lisp/org-compat.el (org-flet): Compatibility function now that flet
  has been removed from cl-macs.
  (org-labels): Compatibility function now that labels has been removed
  from cl-macs.
* lisp/ob-R.el (org-compat): Require org-compat.
* lisp/ob-comint.el: Require org-compat.
* lisp/ob-exp.el (org-babel-exp-do-export): Switch to compatibility
  function.
* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Switch to
  compatibility function.
* lisp/ob-lob.el (org-babel-lob-get-info): Switch to compatibility
  function.
  (org-babel-lob-execute): Switch to compatibility function.
* lisp/ob-python.el (org-babel-python-evaluate-session): Switch to
  compatibility function.
* lisp/ob-ref.el (org-babel-ref-index-list): Switch to compatibility
  function.
* lisp/ob-sh.el (org-babel-sh-var-to-string): Switch to compatibility
  function.
* lisp/ob-tangle.el (org-babel-load-file): Switch to compatibility
  function.
  (org-babel-tangle): Switch to compatibility function.
  (org-babel-spec-to-string): Switch to compatibility function.
* lisp/ob.el (org-babel-view-src-block-info): Switch to compatibility
  function.
  (org-babel-execute-src-block): Switch to compatibility function.
  (org-babel-edit-distance): Switch to compatibility function.
  (org-babel-switch-to-session-with-code): Switch to compatibility
  function.
  (org-babel-sha1-hash): Switch to compatibility function.
  (org-babel-balanced-split): Switch to compatibility function.
  (org-babel-join-splits-near-ch): Switch to compatibility function.
  (org-babel-get-rownames): Switch to compatibility function.
  (org-babel-format-result): Switch to compatibility function.
  (org-babel-insert-result): Switch to compatibility function.
  (org-babel-examplize-region): Switch to compatibility function.
  (org-babel-merge-params): Switch to compatibility function.
  (org-babel-noweb-p): Switch to compatibility function.
  (org-babel-expand-noweb-references): Switch to compatibility function.
* lisp/org-bibtex.el (org-bibtex-headline): Switch to compatibility
  function.
  (org-bibtex-fleshout): Switch to compatibility function.
  (org-bibtex-read): Switch to compatibility function.
  (org-bibtex-write): Switch to compatibility function.
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Switch to
  compatibility function.
* lisp/org-exp.el (org-export-format-source-code-or-example): Switch to
  compatibility function.
* lisp/org-macs.el (org-called-interactively-p): Indentation fix.
* lisp/org-mouse.el (org-mouse-timestamp-today): Switch to compatibility
  function.
  (org-mouse-set-priority): Switch to compatibility function.
  (org-mouse-popup-global-menu): Switch to compatibility function.
  (org-mouse-context-menu): Switch to compatibility function.
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data): Switch to
  compatibility function.
  (org-plot/gnuplot-script): Switch to compatibility function.
* lisp/org.el (org-entry-get): Switch to compatibility function.
  (org-fill-paragraph): Switch to compatibility function.
  (org-auto-fill-function): Switch to compatibility function.
2012-07-25 09:23:57 -06:00
Eric Schulte cd080b025a ensure newline precedes automatically-added returns for Python code blocks
* lisp/ob-python.el (org-babel-execute:python): Ensure newline
  precedes automatically-added returns.
2012-04-23 11:39:28 -04:00
Bastien Guerry 5c38bf0ef7 Fix copyright and authors lines. 2012-04-02 00:53:28 +02:00
Bastien Guerry 8931636eae Copyright, license, and header fixes.
Thanks to Glenn Morris for this fix in Emacs trunk.
2012-01-05 09:43:21 +01:00
Bastien Guerry e44d2975ff Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
Achim Gratz ccc99317de backport copyright and license headers from Emacs trunk 2011-08-24 22:32:38 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Eric Schulte e409a859ff ob-python: inhibit return of the eoe string during session evaluation
* lisp/ob-python.el (org-babel-python-evaluate-session): Inhibit
  return of the eoe string during session evaluation.
2011-07-03 12:12:11 -06:00
Eric Schulte fcede7c577 ob-python: enough newlines to ensure a return when ":results output :session"
* lisp/ob-python.el (org-babel-python-evaluate-session): Enough
  newlines to ensure a return when ":results output :session".
2011-07-03 12:08:13 -06:00
Eric Schulte 9e7ef71da3 ob-python: more robust session evaluation
* lisp/ob-python.el (org-babel-python-evaluate-session): Introduced a
  new local function for sending input with a slight delay to allow
  pythong to re-draw the prompt.  No longer removing newlines inside
  code block bodies (was due to a defective regexp).
2011-07-03 09:19:50 -06:00
Eric Schulte 4a0e5cf88f initialize variable from ob-tangle in language files that use it
* lisp/ob-C.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-asymptote.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-awk.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-clojure.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-haskell.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-latex.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-lisp.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-ocaml.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-perl.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-python.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-ruby.el (ob-tangle): initialize variable from ob-tangle.
* lisp/ob-tangle.el (ob-tangle): initialize variable from ob-tangle.
2011-06-21 15:45:19 -07:00
Eric Schulte 56de599c00 ob-python: Send RET after every line w/session evaluation
* lisp/ob-python.el (org-babel-python-evaluate-session): Send
  comint-send-input after every line when interacting with an
  interactive python process.
2011-06-20 19:18:59 -07:00
Eric Schulte 28b325fa1e ob-python: in the case of ":results output table" results can be parsed as a table
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
  Allow parsing as a table in the case of ":results output table".
  (org-babel-python-evaluate-session):   Allow parsing as a table in
  the case of ":results output table".
2011-04-14 20:24:10 -06:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Carsten Dominik c895af44d4 Fix some compiler warnings
* lisp/ob.el (org-src-lang-modes): Defvar.
(org-at-item-p): Declare function.
* lisp/ob-calc.el (calc-store): Require.
(var-syms): Defvar.
* lisp/ob-python.el (py-default-interpreter): Defvar.
2011-03-01 08:08:36 +01:00
Dan Davison 8e4b9b3a6a ob: python: Don't bother removing echoed output in value mode
* lisp/ob-python.el (org-babel-python-evaluate-session): Pass nil as
remove-echo part of META argument to `org-babel-comint-with-output'

The regexp matching involved in this procedure can fail on large input
data, so we only do it when necessary (i.e. output mode).
2011-02-13 11:03:58 +00:00
Dan Davison dcfeec887a docstring edits
* lisp/ob.el (org-babel-merge-params): docstring typo
2011-01-20 17:20:19 +00:00
Dan Davison 43772d2d9a ob: avoid error when python session buffer has been killed
* lisp/ob-python.el: Test whether non-nil buffer is #<killed buffer>
2011-01-20 17:20:18 +00:00
Dan Davison e030d95ddb ob: language-specific changes in response to :file arg changes
These languages are capable of writing results to file; for several of
them this is their only mode of operation. These changes cause the
languages to return to ob.el either the computed result, or nil, when
they have written results to file themselves. This is in place of the
previous method of returning the output file name as a string to
ob.el.

* lisp/ob-asymptote.el (org-babel-execute:asymptote): Return nil to
signal that the intended content has been written to file.
* lisp/ob-ditaa.el (org-babel-execute:ditaa): Return nil to signal
that the intended content has been written to file.
* lisp/ob-dot.el (org-babel-execute:dot): Return nil to signal that
the intended content has been written to file.
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot): Return nil to signal
that the intended content has been written to file.
* lisp/ob-latex.el (org-babel-execute:latex): Return nil to signal
that the intended content has been written to file.
* lisp/ob-mscgen.el (org-babel-execute:mscgen): Return nil to
signal that the intended content has been written to file.
* lisp/ob-octave.el (org-babel-execute:octave): Return result; not
name of output file.
* lisp/ob-plantuml.el (org-babel-execute:plantuml): Return nil to
signal that the intended content has been written to file.
* lisp/ob-python.el (org-babel-execute:python): Return result; not
name of output file.
* lisp/ob-ruby.el (org-babel-execute:ruby): Return result; not
name of output file.
* lisp/ob-sass.el (org-babel-execute:sass): Return nil if result has
been written to file
2010-12-21 14:19:24 +00:00
Konrad Hinsen 8916e948d2 ob-python: ensure py-which-bufname is initialized
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Make
  sure that py-which-bufname is initialized, as otherwise it will be
  overwritten the first time a Python buffer is created.
2010-12-13 18:47:46 -07:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Eric Schulte 4081200ab0 ob-python: rename prefix to preamble
* lisp/ob-python.el (org-babel-execute:python): Rename "prefix" to
  "preamble".
  (org-babel-python-evaluate): Rename "prefix" to "preamble".
  (org-babel-python-evaluate-external-process): Rename "prefix" to
  "preamble".
2010-12-03 07:29:28 -07:00
Eric Schulte cfd7d07adc ob-python: content of :prefix argument appended to code file during external evaluation
* lisp/ob-python.el (org-babel-execute:python): Pass the new "prefix"
  header argument through to external evaluation.
  (org-babel-python-evaluate): Pass the new "prefix" header argument
  through to external evaluation.
  (org-babel-python-evaluate-external-process): When specified prepend
  "prefix" to the file used in external evaluation.
2010-12-02 07:25:50 -07:00
Dan Davison 7687748128 babel: fix python pretty print bug
* lisp/ob-python.el (org-babel-python-evaluate-session): Change python
module name from 'pp' to 'pprint'
2010-12-01 16:55:21 +00:00
Eric Schulte 994e1648e2 babel: python uses :return header argument
* lisp/ob-python.el (org-babel-execute:python): Use a :return header
  argument for external evaluation in which the code block body need
  be wrapped in a function

Thanks to Darlan Cavalcante for proposing this feature.
2010-11-27 23:59:51 +00:00
Eric Schulte b174975eb7 ob: safer conversion of results of scripting languages into elisp objects
* lisp/ob-python.el (org-babel-python-table-or-string): Using
  `org-babel-script-escape' for reading string input from scripting
  languages.

* lisp/ob-ruby.el (org-babel-ruby-table-or-string): Using
  `org-babel-script-escape' for reading string input from scripting
  languages.

* lisp/ob.el (org-babel-script-escape): Using
  `org-babel-script-escape' for reading string input from scripting
  languages.

* lisp/ob-haskell.el (org-babel-haskell-table-or-string): Using
  `org-babel-script-escape' for reading string input from scripting
  languages.
2010-11-22 18:51:00 -07:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Dan Davison 369cf54146 babel:removing calls to ob-process-params, and updating use of results
* lisp/ob-C.el (org-babel-C-execute): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-R.el (org-babel-execute:R): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
      (org-babel-R-variable-assignments): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-asymptote.el (org-babel-execute:asymptote): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-clojure.el (org-babel-execute:clojure): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-dot.el (org-babel-execute:dot): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): removing
      call to org-babel-process-params which should no longer be called
      from within a language file
      (org-babel-execute:emacs-lisp): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-haskell.el (org-babel-execute:haskell): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-js.el (org-babel-execute:js): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-lisp.el (org-babel-execute:lisp): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-ocaml.el (org-babel-execute:ocaml): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-octave.el (org-babel-execute:octave): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-perl.el (org-babel-execute:perl): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-python.el (org-babel-execute:python): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-ruby.el (org-babel-execute:ruby): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-scheme.el (org-babel-execute:scheme): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-screen.el (org-babel-execute:screen): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
      (org-babel-prep-session:screen): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-sh.el (org-babel-execute:sh): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-sql.el (org-babel-execute:sql): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * ob-haskell.el (org-babel-execute:haskell): Remove reference
      to processed params
    * ob-clojure.el (org-babel-execute:clojure): Remove reference
      to processed params
    * ob-R.el (org-babel-execute:R): Remove reference to processed
      params
2010-10-21 13:06:54 +01:00
Dan Davison 2699f4e9bc babel: python: New variable assignment and expansion scheme
* ob-python.el (org-babel-execute:python): Use generic
	expansion function
	(org-babel-prep-session:python): Change name of called function
	(org-babel-variable-assignments:python): Change function name
	(org-babel-expand-body:python): Delete function
2010-10-21 13:06:03 +01:00
Eric Schulte 2ddcf9e255 removing obsoleted optional third argument from org-babel-expand-body:LANG
* lisp/ob-C.el (org-babel-expand-body:c++): removing obsoleted
  optional third argument
  (org-babel-expand-body:c++): removing obsoleted optional third
  argument
  (org-babel-C-expand): removing obsoleted optional third argument
* lisp/ob-R.el:
  (org-babel-expand-body:R): removing obsoleted optional third
  argument
  (org-babel-execute:R): removing obsoleted optional third argument
  (org-babel-R-variable-assignments): removing obsoleted optional
  third argument
* lisp/ob-asymptote.el:
  (org-babel-expand-body:asymptote): removing obsoleted optional third
  argument
  (org-babel-execute:asymptote): removing obsoleted optional third
  argument
* lisp/ob-clojure.el:
  (org-babel-expand-body:clojure): removing obsoleted optional third
  argument
  (org-babel-execute:clojure): removing obsoleted optional third
  argument
* lisp/ob-css.el:
  (org-babel-expand-body:css): removing obsoleted optional third
  argument
* lisp/ob-ditaa.el:
  (org-babel-expand-body:ditaa): removing obsoleted optional third
  argument
* lisp/ob-dot.el:
  (org-babel-expand-body:dot): removing obsoleted optional third
  argument
  (org-babel-execute:dot): removing obsoleted optional third argument
* lisp/ob-emacs-lisp.el:
  (org-babel-expand-body:emacs-lisp): removing obsoleted optional
  third argument
  (org-babel-execute:emacs-lisp): removing obsoleted optional third
  argument
* lisp/ob-gnuplot.el:
  (org-babel-expand-body:gnuplot): removing obsoleted optional third
  argument
* lisp/ob-haskell.el:
  (org-babel-expand-body:haskell): removing obsoleted optional third
  argument
  (org-babel-execute:haskell): removing obsoleted optional third
  argument
  (org-babel-load-session:haskell): removing obsoleted optional third
  (org-babel-prep-session:haskell): removing obsoleted optional third
* lisp/ob-js.el:
  (org-babel-expand-body:js): removing obsoleted optional third
  argument
  (org-babel-execute:js): removing obsoleted optional third argument
* lisp/ob-latex.el:
  (org-babel-expand-body:latex): removing obsoleted optional third
  argument
* lisp/ob-lisp.el:
  (org-babel-expand-body:lisp): removing obsoleted optional third
  argument
  (org-babel-execute:lisp): removing obsoleted optional third argument
* lisp/ob-mscgen.el:
  (org-babel-expand-body:mscgen): removing obsoleted optional third
  argument
* lisp/ob-ocaml.el:
  (org-babel-expand-body:ocaml): removing obsoleted optional third
  argument
  (org-babel-execute:ocaml): removing obsoleted optional third
  argument
* lisp/ob-octave.el:
  (org-babel-expand-body:matlab): removing obsoleted optional third
  argument
  (org-babel-expand-body:octave): removing obsoleted optional third
  argument
  (org-babel-execute:octave): removing obsoleted optional third
  argument
  (org-babel-octave-variable-assignments): removing obsoleted optional
  third
* lisp/ob-org.el:
  (org-babel-expand-body:org): removing obsoleted optional third
  argument
* lisp/ob-perl.el:
  (org-babel-expand-body:perl): removing obsoleted optional third
  argument
  (org-babel-execute:perl): removing obsoleted optional third argument
* lisp/ob-plantuml.el:
  (org-babel-expand-body:plantuml): removing obsoleted optional third
  argument
* lisp/ob-python.el:
  (org-babel-expand-body:python): removing obsoleted optional third
  argument
  (org-babel-execute:python): removing obsoleted optional third
  argument
  (org-babel-python-variable-assignments): removing obsoleted optional
  third
* lisp/ob-ruby.el:
  (org-babel-expand-body:ruby): removing obsoleted optional third
  argument
  (org-babel-execute:ruby): removing obsoleted optional third argument
* lisp/ob-sass.el:
  (org-babel-expand-body:sass): removing obsoleted optional third
  argument
* lisp/ob-scheme.el:
  (org-babel-expand-body:scheme): removing obsoleted optional third
  argument
  (org-babel-execute:scheme): removing obsoleted optional third
  argument
* lisp/ob-screen.el:
  (org-babel-expand-body:screen): removing obsoleted optional third
  argument
* lisp/ob-sh.el:
  (org-babel-expand-body:sh): removing obsoleted optional third
  argument
  (org-babel-execute:sh): removing obsoleted optional third argument
  (org-babel-sh-variable-assignments): removing obsoleted optional
  third
* lisp/ob-sql.el:
  (org-babel-expand-body:sql): removing obsoleted optional third
  argument
* lisp/ob-sqlite.el:
  (org-babel-expand-body:sqlite): removing obsoleted optional third
  argument
  (org-babel-execute:sqlite): removing obsoleted optional third
  argument
* lisp/ob.el:
  (org-babel-expand-body:generic): removing obsoleted optional third
  argument
2010-10-21 13:06:00 +01:00
Dan Davison a06ea76c53 babel: Provide missing docstrings
* ob-sh.el (org-babel-sh-variable-assignments):
	Provide missing docstring
	* ob-python.el (org-babel-python-variable-assignments):
	Provide missing docstring
2010-10-21 13:05:58 +01:00
Dan Davison 24a5f8b4e5 babel: python: Fix variable assignments made by `org-babel-prep-session:python'
* ob-python.el (org-babel-expand-body:python): Refactor: break variable
    assignment part out into a separate function
    (org-babel-python-variable-assignments): New function constructing
    list of variable assignment statements
    (org-babel-prep-session:python): Use new function
    `org-babel-python-variable-assignments' instead of previous
    (incorrect) variable assignment code.
2010-10-21 13:05:58 +01:00
Eric Schulte db3798fd2b ob-python: fixed compiler warning
* lisp/ob-python.el (org-src-preserve-indentation): fixed compiler warning
2010-10-12 22:59:24 -06:00
Dan Davison 4eaa52caca babel: alter whitespace to fit into 80 columns
* ob-tangle.el (org-babel-spec-to-string): whitespace changes

	* ob-python.el (org-babel-expand-body:python): whitespace changes
2010-10-12 15:50:00 +01:00
Dan Davison deb391f128 babel: Don't trim whitespace when `org-src-preserve-indentation' is non-nil
* ob-tangle.el (org-babel-spec-to-string): Don't trim
	whitespace when `org-src-preserve-indentation' is non-nil

	* ob-python.el (org-babel-expand-body:python): Don't trim
	whitespace when `org-src-preserve-indentation' is non-nil

Based on report and patches by Antti Kaihola.
2010-10-12 15:47:59 +01:00
Dan Davison c33c313ee1 babel: Make temp file names consistent
* ob-python.el (org-babel-python-evaluate-session):
	Make temp file names consistent

	* ob-octave.el (org-babel-octave-evaluate-external-process):
	Make temp file names consistent

	* ob-clojure.el (org-babel-clojure-evaluate-external-process):
	Make temp file names consistent
2010-09-22 22:10:13 +01:00
Dan Davison 9993463c4d babel: Make temp file names consistent
* ob-scheme.el (org-babel-execute:scheme): Alter temp file name

	* ob-ruby.el (org-babel-ruby-evaluate): Alter temp file name

	* ob-python.el (org-babel-python-evaluate-external-process):
	Alter temp file name

	* ob-perl.el (org-babel-perl-evaluate): Alter temp file name

	* ob-octave.el (org-babel-octave-evaluate-session):
	Alter temp file name
	(org-babel-octave-import-elisp-from-file): Alter temp file name

	* ob-ledger.el (org-babel-execute:ledger): Alter temp file name

	* ob-gnuplot.el (org-babel-gnuplot-process-vars): Alter temp
	file name
	(org-babel-execute:gnuplot): Alter temp file name
2010-09-22 22:10:13 +01:00
Dan Davison ec0b3892b9 babel: New function to process file names for use in external processes
* ob.el (org-babel-process-file-name): New function
	(org-babel-maybe-remote-file): Delete function

	* ob-sql.el (org-babel-execute:sql):
	Use org-babel-process-file-name

	* ob-scheme.el (org-babel-execute:scheme):
	Use org-babel-process-file-name

	* ob-sass.el (org-babel-execute:sass):
	Use org-babel-process-file-name

	* ob-ruby.el (org-babel-ruby-evaluate):
	Use org-babel-process-file-name

	* ob-python.el (org-babel-python-evaluate-external-process):
	Use org-babel-process-file-name
	(org-babel-python-evaluate-session):
	Use org-babel-process-file-name

	* ob-plantuml.el (org-babel-execute:plantuml):
	Use org-babel-process-file-name

	* ob-perl.el (org-babel-perl-evaluate):
	Use org-babel-process-file-name

	* ob-octave.el (org-babel-octave-evaluate-external-process):
	Use org-babel-process-file-name
	(org-babel-octave-evaluate-session):
	Use org-babel-process-file-name,
	don't use org-babel-maybe-remote-file

	* ob-lisp.el (org-babel-execute:lisp):
	Use org-babel-process-file-name

	* ob-ledger.el (org-babel-execute:ledger):
	Use org-babel-process-file-name

	* ob-js.el (org-babel-execute:js):
	Use org-babel-process-file-name

	* ob-haskell.el (org-babel-haskell-export-to-lhs):
	Use org-babel-process-file-name

	* ob-gnuplot.el (org-babel-execute:gnuplot):
	Use org-babel-process-file-name

	* ob-eval.el (org-babel-eval-read-file): Don't use
	org-babel-maybe-remote-file

	* ob-dot.el (org-babel-execute:dot):
	Use org-babel-process-file-name

	* ob-ditaa.el (org-babel-execute:ditaa):
	Use org-babel-process-file-name

	* ob-clojure.el (org-babel-clojure-evaluate-external-process):
	Use org-babel-process-file-name

	* ob-asymptote.el (org-babel-execute:asymptote):
	Use org-babel-process-file-name

	* ob-R.el (org-babel-R-assign-elisp): Don't use
	org-babel-maybe-remote-file, use org-babel-process-file-name
	(org-babel-R-evaluate-external-process):
	Use org-babel-process-file-name
	(org-babel-R-evaluate-session):
	Use org-babel-process-file-name

	* ob-C.el (org-babel-C-execute):
	Use org-babel-process-file-name

In addition to passing the file path through `expand-file-name',
tramp-style remote file names are converted to conventional (local)
file paths. The reason is that, if a tramp file name was in use in
emacs, then the shell command will be executing on the remote machine
in question. Further, by default the file name is passed through
`shell-quote-argument'.
2010-09-22 22:10:13 +01:00
Dan Davison 7127eb44c1 babel: python: refactor `org-babel-python-evaluate'
* ob-python.el (org-babel-python-evaluate): Refactor as call
	to either `org-babel-python-evaluate-external-process' or
	`org-babel-python-evaluate-session'.
	(org-babel-python-evaluate-external-process): New function to
	handle evaluation in external process.
	(org-babel-python-evaluate-session): New function to
	handle evaluation in emacs inferior process.
2010-09-07 21:58:58 -04:00
Eric Schulte 7b00073f2d Babel now cleans up any temporary files created using org-babel-temp-file
* lisp/ob.el (org-babel-temporary-directory): variable to hold the
  value of the Babel temporary directory

  (org-babel-temp-file): replacement for make-temp-file with cleanup
  on exit of Emacs

  (org-babel-remove-temporary-directory): cleanup function run on exit
  of Emacs

  (kill-emacs-hook): now includes babel cleanup function

* lisp/ob-C.el (org-babel-C-execute): using org-babel-temp-file
  instead of make-temp-file

* lisp/ob-R.el (org-babel-R-assign-elisp): using `org-babel-temp-file'
  instead of `make-temp-file'

  (org-babel-R-evaluate-external-process): using `org-babel-temp-file'
  instead of `make-temp-file'

  (org-babel-R-evaluate-session): using `org-babel-temp-file' instead of
  `make-temp-file'

* lisp/ob-asymptote.el (org-babel-execute:asymptote): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-clojure.el (org-babel-clojure-evaluate-external-process):
  using `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-ditaa.el (org-babel-execute:ditaa): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-dot.el (org-babel-execute:dot): using `org-babel-temp-file'
  instead of `make-temp-file'

* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): using
  `org-babel-temp-file' instead of `make-temp-file'

  (org-babel-execute:gnuplot): using `org-babel-temp-file' instead of
  `make-temp-file'

* lisp/ob-haskell.el (org-babel-load-session:haskell): using
  `org-babel-temp-file' instead of `make-temp-file'

  (org-babel-haskell-export-to-lhs): using `org-babel-temp-file' instead
  of `make-temp-file'

* lisp/ob-latex.el (org-babel-execute:latex): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-ledger.el (org-babel-execute:ledger): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-lisp.el (org-babel-execute:lisp): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-octave.el (org-babel-octave-evaluate-external-process):
  using `org-babel-temp-file' instead of `make-temp-file'

  (org-babel-octave-evaluate-session): using `org-babel-temp-file'
  instead of `make-temp-file'

  (org-babel-octave-import-elisp-from-file): using `org-babel-temp-file'
  instead of `make-temp-file'

* lisp/ob-perl.el (org-babel-perl-evaluate): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-python.el (org-babel-python-evaluate): using
  `org-babel-temp-file' instead of `make-temp-file'
  using `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-ruby.el (org-babel-ruby-evaluate): using
  `org-babel-temp-file' instead of `make-temp-file'
  using `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-sass.el (org-babel-execute:sass): using
  `org-babel-temp-file' instead of `make-temp-file'

* lisp/ob-sh.el (org-babel-sh-evaluate): using `org-babel-temp-file'
  instead of `make-temp-file'

* lisp/ob-sql.el (org-babel-execute:sql): using `org-babel-temp-file'
  instead of `make-temp-file'

* lisp/ob-sqlite.el (org-babel-execute:sqlite): using
  `org-babel-temp-file' instead of `make-temp-file'

  (org-babel-sqlite-expand-vars): using `org-babel-temp-file' instead of
   `make-temp-file'
2010-08-25 14:47:47 -06:00
Dan Davison 4f82a58e8c babel: python: use eq instead of equal
* ob-python.el (org-babel-python-initiate-session-by-key): use
	eq instead of equal to compare symbols
2010-08-16 11:09:20 -04:00
Dan Davison 1239099120 babel: python: Fix recognition of lists and tuples
2010-08-03  Dan Davison  <davison@stats.ox.ac.uk>

    * ob-python.el (org-babel-python-table-or-string): Fix
    recognition of lists and tuples

Prior to this we had

 #+begin_src python
   return [1, 2]
 #+end_src

 #+results:
 : [1, 2]
2010-08-03 00:14:35 -04:00
Eric Schulte 9a2ea65bc3 ob-python: can now handle VERY long result lines
* lisp/ob-python.el (org-babel-python-table-or-string): can now handle
  VERY long result lines
2010-07-31 14:24:25 -06:00
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Eric Schulte f904376df4 ob-python: can now handle variable strings with newlines
* lisp/ob-python.el (org-babel-python-var-to-python): python can now
  handle input strings with newlines
2010-07-14 11:34:30 -07:00
Tom Dye 272aefce83 Finished editing Babel docstrings 2010-07-13 16:20:08 -07:00
Eric Schulte c53fc7d246 babel: consolidate execution messaging into ob.el
* lisp/ob.el (org-babel-execute-src-block): consolidate execution
  messaging into ob.el rather than spread out amongst all the language
  files
2010-07-12 22:26:25 -07:00
Eric Schulte 535ea52fff ob-python: allow user choice between python.el and python-mode.el for
* lisp/ob-python.el (org-babel-python-mode): adding configuration
  option to allow users to control whether they use python.el or
  python-mode.el

  (org-babel-python-initiate-session-by-key): updated for use with new
  configuration option
2010-07-09 10:58:12 -07:00
Eric Schulte 3416a0e323 babel: clean compile 2010-07-05 11:14:51 -07:00
Eric Schulte 7b3077dcd4 babel: cleaned up ruby (now using ob-eval) 2010-07-05 11:14:50 -07:00
Eric Schulte fd9bf71265 babel: fixed sessions in python, extracted external eval into ob-eval 2010-07-05 11:14:50 -07:00
Eric Schulte 6c2e35003f babel: all languages compiling cleanly (but R has a small problem)
For some reason ob-R refuses to compile when it requires ob-comint.

  When (require 'ob-comint) is not included in  ob-R.el everything
  compiles without error, but warnings are thrown because the
  arguments to a macro defined in ob-comint are mis-interpreted as
  functions.

  When (require 'ob-comint) is added to ob-R.el then it throws errors
  complaining that the last argument to a function is nil and should
  be a string.  I don't understand this error at all and can't fix it.
2010-07-05 11:14:50 -07:00
Eric Schulte d7b7025eac flattening out lisp directory structure
all babel and babel/langs files now live in the base of the lisp directory.
2010-07-05 11:14:49 -07:00
Renamed from lisp/babel/langs/ob-python.el (Browse further)