Commit Graph

124 Commits

Author SHA1 Message Date
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Aaron Ecay 0d000f5680 babel: small change in API.
* lisp/ob-core.el (org-babel--get-vars): New function.
(org-babel-get-header): Delete.
* lisp/ob-C.el (org-babel-C-expand-C):
(org-babel-C-expand-D):
* lisp/ob-R.el (org-babel-variable-assignments:R):
* lisp/ob-abc.el (org-babel-expand-body:abc):
* lisp/ob-asymptote.el (org-babel-variable-assignments:asymptote):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-calc.el (org-babel-execute:calc):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
* lisp/ob-dot.el (org-babel-expand-body:dot):
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp):
* lisp/ob-fortran.el (org-babel-expand-body:fortran):
(org-babel-fortran-ensure-main-wrap):
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars):
* lisp/ob-haskell.el (org-babel-variable-assignments:haskell):
* lisp/ob-js.el (org-babel-variable-assignments:js):
* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lilypond.el (org-babel-expand-body:lilypond):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
* lisp/ob-maxima.el (org-babel-maxima-expand):
* lisp/ob-ocaml.el (org-babel-variable-assignments:ocaml):
* lisp/ob-octave.el (org-babel-variable-assignments:octave):
* lisp/ob-org.el (org-babel-expand-body:org):
* lisp/ob-perl.el (org-babel-variable-assignments:perl):
* lisp/ob-picolisp.el (org-babel-expand-body:picolisp):
* lisp/ob-processing.el (org-babel-variable-assignments:processing):
* lisp/ob-python.el (org-babel-variable-assignments:python):
* lisp/ob-ruby.el (org-babel-variable-assignments:ruby):
* lisp/ob-scheme.el (org-babel-expand-body:scheme):
* lisp/ob-shell.el (org-babel-variable-assignments:shell):
* lisp/ob-shen.el (org-babel-expand-body:shen):
* lisp/ob-sql.el (org-babel-expand-body:sql):
* lisp/ob-sqlite.el (org-babel-expand-body:sqlite): Adapt to change.
* etc/ORG-NEWS: Document change.
2015-10-29 19:26:11 +00:00
Nicolas Goaziou f0bf77e82a Activate lexical binding in some libraries
* lisp/ob-C.el (org-babel-prep-session:C):
(org-babel-load-session:C):
* lisp/ob-J.el:
(org-babel-expand-body:J):
(org-babel-execute:J):
* lisp/ob-R.el:
(org-babel-expand-body:R):
* lisp/ob-abc.el:
(org-babel-execute:abc):
(org-babel-prep-session:abc):
* lisp/ob-asymptote.el:
(org-babel-execute:asymptote):
(org-babel-prep-session:asymptote):
* lisp/ob-awk.el:
(org-babel-expand-body:awk):
* lisp/ob-calc.el:
(org-babel-expand-body:calc):
* lisp/ob-clojure.el:
* lisp/ob-comint.el:
(org-babel-comint-in-buffer):
(org-babel-comint-with-output):
(org-babel-comint-eval-invisibly-and-wait-for-file):
* lisp/ob-coq.el:
* lisp/ob-css.el:
(org-babel-execute:css):
(org-babel-prep-session:css):
* lisp/ob-ditaa.el:
(org-babel-execute:ditaa):
(org-babel-prep-session:ditaa):
* lisp/ob-dot.el:
(org-babel-execute:dot):
(org-babel-prep-session:dot):
* lisp/ob-ebnf.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-eval.el:
* lisp/ob-forth.el:
* lisp/ob-fortran.el:
(org-babel-execute:fortran):
(org-babel-prep-session:fortran):
(org-babel-load-session:fortran):
* lisp/ob-gnuplot.el:
(org-babel-expand-body:gnuplot):
(org-babel-prep-session:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-groovy.el:
(org-babel-prep-session:groovy):
(org-babel-groovy-initiate-session):
* lisp/ob-haskell.el:
(org-babel-haskell-initiate-session):
* lisp/ob-io.el:
(org-babel-prep-session:io):
(org-babel-io-initiate-session):
* lisp/ob-java.el:
(org-babel-execute:java):
* lisp/ob-js.el:
* lisp/ob-keys.el:
* lisp/ob-latex.el:
(org-babel-prep-session:latex):
* lisp/ob-ledger.el:
(org-babel-execute:ledger):
(org-babel-prep-session:ledger):
* lisp/ob-lilypond.el:
(org-babel-lilypond-commands):
(org-babel-lilypond-process-basic):
(org-babel-prep-session:lilypond):
(org-babel-lilypond-parse-line-num):
* lisp/ob-lisp.el:
* lisp/ob-makefile.el:
(org-babel-execute:makefile):
(org-babel-prep-session:makefile):
* lisp/ob-matlab.el:
* lisp/ob-maxima.el:
(org-babel-prep-session:maxima):
* lisp/ob-mscgen.el:
(org-babel-prep-session:mscgen):
* lisp/ob-ocaml.el:
(org-babel-execute:ocaml):
(org-babel-prep-session:ocaml):
* lisp/ob-octave.el:
(org-babel-execute:octave):
(org-babel-octave-initiate-session):
* lisp/ob-org.el:
(org-babel-prep-session:org):
* lisp/ob-perl.el:
(org-babel-prep-session:perl):
(org-babel-perl--var-to-perl):
(org-babel-perl-initiate-session):
* lisp/ob-picolisp.el:
(org-babel-expand-body:picolisp):
(org-babel-execute:picolisp):
* lisp/ob-plantuml.el:
(org-babel-execute:plantuml):
(org-babel-prep-session:plantuml):
* lisp/ob-processing.el:
(org-babel-prep-session:processing):
* lisp/ob-python.el:
(org-babel-python-initiate-session):
* lisp/ob-ref.el:
(org-babel-ref-resolve):
* lisp/ob-ruby.el:
(org-babel-ruby-initiate-session):
* lisp/ob-sass.el:
(org-babel-execute:sass):
(org-babel-prep-session:sass):
* lisp/ob-scala.el:
(org-babel-execute:scala):
(org-babel-prep-session:scala):
(org-babel-scala-initiate-session):
* lisp/ob-scheme.el:
* lisp/ob-screen.el:
(org-babel-prep-session:screen):
(org-babel-screen-session-write-temp-file):
(org-babel-screen-test):
* lisp/ob.el:
* lisp/org-colview.el:
(org-columns-todo):
(org-columns-set-tags-or-toggle):
(org-columns-new):
(org-columns-uncompile-format):
(org-agenda-colview-summarize):
* lisp/org-footnote.el:
(electric-indent-mode):
* lisp/org-indent.el:
(org-indent-refresh-maybe):
* lisp/org-list.el:
* lisp/org-macro.el:
(org-macro--collect-macros):
* lisp/org-src.el:
* lisp/org-table.el:
(sort-fold-case):
(org-table-create):
(org-table-field-info):
(org-table-transpose-table-at-point):
(org-table-remove-rectangle-highlight):
(orgtbl-create-or-convert-from-region):
(org-define-lookup-function):
* lisp/ox-ascii.el:
(org-ascii-format-drawer-function):
(org-ascii--has-caption-p):
(org-ascii-bold):
(org-ascii-center-block):
(org-ascii-clock):
(org-ascii-code):
(org-ascii-dynamic-block):
(org-ascii-entity):
(org-ascii-example-block):
(org-ascii-export-snippet):
(org-ascii-export-block):
(org-ascii-fixed-width):
(org-ascii-footnote-reference):
(org-ascii-horizontal-rule):
(org-ascii-inline-src-block):
(org-ascii-format-inlinetask-default):
(org-ascii-italic):
(org-ascii-keyword):
(org-ascii-latex-environment):
(org-ascii-latex-fragment):
(org-ascii-line-break):
(org-ascii-node-property):
(org-ascii-planning):
(org-ascii-quote-block):
(org-ascii-radio-target):
(org-ascii-special-block):
(org-ascii-src-block):
(org-ascii-statistics-cookie):
(org-ascii-subscript):
(org-ascii-superscript):
(org-ascii-strike-through):
(org-ascii-timestamp):
(org-ascii-underline):
(org-ascii-verbatim):
(org-ascii-verse-block):
(org-ascii-filter-headline-blank-lines):
(org-ascii-filter-paragraph-spacing):
(org-ascii-filter-comment-spacing): Use lexical binding.
2015-10-26 01:56:00 +01:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
Protect apostrophes not covered by the last backport.  Convert
expressions like '(...)  to \\='(...)  and symbols written as 'name to
`name'.  (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)

If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
2015-09-21 18:38:39 -04:00
Paul Eggert ecf3a4af2c Backport remaining changes from commit 7e09ef0
Add changes from Emacs repo that should have been backported with
bb77dd2.

Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
2015-08-10 02:17:19 -04:00
Thierry Banel 2081cd3f62 Remove default #includes in Babel C, C++
* ob-C.el (org-babel-C-expand-C): remove automatic inclusion
of <string.h>, <stdio.h>, <stdlib.h>

* ob-C-test.org: adjust C++ tests to manually include
required header files.

<http://permalink.gmane.org/gmane.emacs.orgmode/96528>
2015-03-31 12:05:49 +02:00
Nicolas Goaziou 77f088066d Silence byte-compiler 2014-11-07 21:46:08 +01:00
Thierry Banel 4753bfa3bf Enable multiple files in :includes header
* ob-C.el (org-babel-C-expand-C, org-babel-C-expand-D): Let
:includes, :defines, :imports accept several items separated by
blanks without enclosing them in parenthesis.

Thanks to Will Everett for reporting this.
2014-10-12 14:00:51 +02:00
Ernesto Durante ccf52269aa ob-C: fix missing function org-babel-expand-body:cpp 2014-08-28 10:46:56 -04:00
Thierry Banel 25fc4d8344 Make C, C++, D, Java, Groovy compilers customizable
* ob-C.el (org-babel-C-compiler):
	(org-babel-C++-compiler):
	(org-babel-D-compiler): changed defvar to defcustom
	* ob-java.el (org-babel-java-command):
	(org-babel-java-compiler): changed defvar to defcustom
	* ob-groovy.el (org-babel-groovy-command):
	changed defvar to defcustom
2014-06-16 11:05:01 -04:00
Bastien Guerry 8d613e9c4f ob-C.el: Tiny formatting fix 2014-06-14 14:36:10 +02:00
Eric Schulte f652196723 fix bug in ob-C
* lisp/ob-C.el (org-babel-C-val-to-C-type): Fix miss-named variable
  bug.
2014-06-13 07:46:29 -04: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 5bf928bae7 Merge branch 'maint'
Conflicts:
	lisp/ob-core.el
	lisp/org.el
	lisp/ox.el
2014-05-28 16:23:08 +02:00
Achim Gratz 310b9dd2b6 ob-C: lexical-let requires cl at compilation time
* lisp/ob-C.el: Require cl during compilation so that lexical-let is
  known.
2014-05-28 14:40:52 +02:00
Jakob Lombacher af23a276a3 Bugfix, there was one entry too much.
It failed when mixed (int double) table is used as input variable e.g
| 1 | 1.2 |

TINYCHANGE
2014-03-27 17:53:39 -04: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
Bastien Guerry c41f5075ac Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-05 06:36:11 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Thierry Banel 14337ce4eb Merge D-language into ob-C.el C&C++-languages 2013-12-21 11:59:27 -07:00
Eric Schulte 8c98879d7c declare function to appease compiler
* lisp/ob-C.el (org-remove-indentation): Declare function to appease
  compiler.
* lisp/ob-core.el (org-remove-indentation): Declare function to
  appease compiler.
* lisp/ob-fortran.el (org-remove-indentation): Declare function to
  appease compiler.
2013-11-23 17:02:22 -07:00
Eric Schulte 39070b7fc7 sometimes remove common indentation when trimming
* lisp/ob-C.el (org-babel-C-execute): Remove common indentation when
  trimming.

* lisp/ob-core.el (org-babel-read-result): Remove common indentation
  when trimming.
  (org-babel-update-block-body): Remove common indentation when
  trimming.

* lisp/ob-fortran.el (org-babel-execute:fortran): Remove common
  indentation when trimming.

* lisp/ob-tangle.el (org-babel-process-comment-text): Better default
  to process tangled comments.
2013-11-23 15:57:29 -07:00
Achim Gratz 54a64f50b5 ob-C, ob-clojure, ob-tangle, org-agenda, org, ox: fix byte-compiler warnings
* lisp/ob-C.el, lisp/ob-clojure.e: Require 'cl at compile-time.
* lisp/ob-tangle.el: Do not require 'cl at compile time.
* lisp/org-agenda.el: Declare function `org-columns-remove-overlays´.
* lisp/org.el: Declare functions `org-clocktable-shift´,
  `org-clock-update-time-maybe´, `org-clock-remove-overlays´,
  `org-babel-tangle-file´, `org-table-blank-field´,
  `org-table-insert-row´, `org-add-archive-files´, `org-table-begin´,
  `org-table-end´.  Move defsubst `org-uniquify´ before its many uses.
* lisp/ox.el: Move defsubst `org-export-get-parent´ before its many
  uses.
2013-11-15 20:18:58 +01:00
Bastien Guerry 487057fc26 Fix conflicts from previous merge 2013-11-12 21:11:23 +01:00
Bastien Guerry 71884cc039 Merge branch 'maint'
Conflicts:
	lisp/ob-C.el
	lisp/ob-clojure.el
	lisp/ob-core.el
	lisp/ob-lisp.el
	lisp/org-clock.el
2013-11-12 21:00:49 +01:00
Bastien Guerry f95641c443 Backport changes from Emacs revs 115081 and 115082
2013-11-12  Stefan Monnier  <monnier@iro.umontreal.ca>

	Address some byte-compiler warnings.
	* ob-abc.el (org-babel-expand-body:abc): Use dolist.
	(org-babel-execute:abc): Fix regexp quoting.
	* ob-calc.el (org--var-syms): Rename from `var-syms'.
	* ob-lilypond.el (ly-compile-lilyfile): Remove redundant let-binding.
	* ob-table.el (sbe): Move debug declaration.
	* org-clock.el (org--msg-extra): Rename from `msg-extra'.
	* org.el (org-version): Avoid var name starting with _.
	(org-inhibit-startup, org-called-with-limited-levels)
	(org-link-search-inhibit-query, org-time-was-given)
	(org-end-time-was-given, org-def, org-defdecode, org-with-time):
	* org-colview.el (org-agenda-overriding-columns-format):
	* org-agenda.el (org-agenda-multi, org-depend-tag-blocked)
	(org-agenda-show-log-scoped):
	* ob-python.el (py-which-bufname, python-shell-buffer-name):
	* ob-haskell.el (org-export-copy-to-kill-ring):
	* ob-exp.el (org-link-search-inhibit-query):
	* ob-R.el (ess-eval-visibly-p):
	* ob-core.el (org-src-window-setup): Declare before use.
	(org-babel-expand-noweb-references): Remove unused `blocks-in-buffer'.
	* ox-odt.el (org-odt-hfy-face-to-css):
	* org-src.el (org-src-associate-babel-session, org-src-get-lang-mode):
	* org-bibtex.el (org-bibtex-get, org-bibtex-ask, org-bibtex)
	(org-bibtex-check):
	* ob-tangle.el (org-babel-tangle, org-babel-spec-to-string)
	(org-babel-tangle-single-block, org-babel-tangle-comment-links):
	* ob-table.el (sbe):
	* ob-sqlite.el (org-babel-sqlite-expand-vars):
	* ob-sql.el (org-babel-sql-expand-vars):
	* ob-shen.el (org-babel-execute:shen):
	* ob-sh.el (org-babel-execute:sh, org-babel-sh-evaluate):
	* ob-scala.el (org-babel-scala-evaluate):
	* ob-ruby.el (org-babel-ruby-table-or-string)
	(org-babel-ruby-evaluate):
	* ob-python.el (org-babel-python-table-or-string)
	(org-babel-python-evaluate-external-process)
	(org-babel-python-evaluate-session):
	* ob-picolisp.el (org-babel-execute:picolisp):
	* ob-perl.el (org-babel-perl-evaluate):
	* ob-maxima.el (org-babel-execute:maxima):
	* ob-lisp.el (org-babel-execute:lisp):
	* ob-java.el (org-babel-execute:java):
	* ob-io.el (org-babel-io-evaluate):
	* ob-haskell.el (org-babel-execute:haskell):
	* ob-fortran.el (org-babel-execute:fortran):
	* ob-exp.el (org-babel-exp-code):
	* ob-emacs-lisp.el (org-babel-execute:emacs-lisp):
	* ob-ditaa.el (org-babel-execute:ditaa):
	* ob-core.el (org-babel-execute-src-block, org-babel-sha1-hash)
	(org-babel-parse-header-arguments, org-babel-reassemble-table)
	(org-babel-goto-src-block-head, org-babel-mark-block)
	(org-babel-expand-noweb-references, org-babel-script-escape)
	(org-babel-process-file-name):
	* ob-clojure.el (org-babel-execute:clojure):
	* ob-calc.el (org-babel-execute:calc):
	* ob-awk.el (org-babel-execute:awk):
	* ob-abc.el (org-babel-execute:abc):
	* ob-R.el (org-babel-expand-body:R):
	* ob-C.el (org-babel-C-execute): Avoid deprecated ((lambda) ...).

2013-11-12  Glenn Morris  <rgm@gnu.org>

	* ox-html.el (org-html-scripts): Add 2013 to copyright years.
	(org-html-infojs-template): Copyright holder to FSF.
2013-11-12 20:57:31 +01:00
Oleh Krehel 29b6e207da lisp/ob-C.el (org-babel-C-execute): turn on inhibit-lisp eval 2013-10-30 12:05:58 -06:00
Rüdiger Sonderfeld cdfcc064d2 ob-C: Add list support.
* lisp/ob-C.el (org-babel-C-var-to-C): Add list support
(org-babel-C-val-to-C-list-type, org-babel-C-val-to-C-type,
org-babel-C-format-val): New functions.
(org-babel-C-ensure-main-wrap, org-babel-execute:C,
org-babel-execute:C++, rg-babel-execute:cpp, org-babel-C++-compiler,
org-babel-C-compiler): Improve docstring.
* testing/examples/ob-C-test.org (string_var): Add required std::
(Array): Add missing ID.
(Matrix): Add tests for list support.
* testing/lisp/test-ob-C.el (ob-C/table): Test succeeds.
(ob-C/list-var, ob-C/vector-var, ob-C/list-list-var): Add tests for
list support.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2013-06-06 12:06:26 -06: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
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
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
Achim Gratz 2dfa6aaf79 Let ob-C and ob-fortran work correctly on Windows/Cygwin
* lisp/ob.el (org-babel-exeext): New defconst to hold extension for
  executables or nil if none.  Should be ".exe" for both Windows and
  Cygwin.

* lisp/ob-C.el (org-babel-C-execute): Use org-babel-exeext when
  constructing the target file name for the compiled executable.

* lisp/ob-fortran.el (org-babel-execute:fortran): Add org-babel-exeext
  when constructing the target file name for the compiled executable.
2012-07-25 12:02:01 -06:00
Eric Schulte 6c1b38182b better wrapping of main C function
Thanks to Dov Grobgeld for pointing out this fix.

* lisp/ob-C.el (org-babel-C-ensure-main-wrap): Add an explicit return
  to automatically generated main methods.
2012-04-10 16:01:54 -04:00
Eric Schulte da0e6fbde1 add .exe to the end of compiled C files on windows
Thanks to Richard Stanton for pointing out this problem and
  suggesting the fix.

* lisp/ob-C.el (org-babel-C-execute): Add .exe to the end of compiled
  C files on windows.
2012-03-31 13:03:31 -04:00
Eric Schulte 18c68c13aa Revert "add the local directory to the library search path for C/C++ block compilation"
This reverts commit 4202665f5b.

The buffer file name is not always available (e.g., during export), so
it should not be relied upon, rather a header argument should be used.
2012-03-31 11:39:13 -04:00
Eric Schulte 4202665f5b add the local directory to the library search path for C/C++ block compilation
* lisp/ob-C.el (org-babel-C-execute): Add the local directory to the
  library search path for C/C++ block compilation.

This patch was submitted to the list by Daimrod.
2012-03-26 07:39:14 -04:00
Bastien Guerry 3dc9cc35ec More copyright year fixes. 2012-01-04 15:47:43 +01:00
Eric Schulte 1b11c7e6a0 replacing usage of characterp with integerp (which should work w/Emacs22)
* contrib/babel/langs/ob-fortran.el (org-babel-fortran-var-to-fortran):
  Replacing usage of characterp with integerp (which should work w/Emacs22).
* lisp/ob-C.el (org-babel-C-var-to-C): Replacing usage of characterp
  with integerp (which should work w/Emacs22).
2011-09-17 14:52:29 -06: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 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
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Eric Schulte 6b02a28822 ob-C: unified naming of "c++" functions/variables to "C++"
Thanks to Martyn Jago for this patch

* lisp/ob-C.el (org-babel-tangle-lang-exts): Replace "c++" with "C++".
  (org-babel-C++-compiler): Replace "c++" with "C++".
  (org-babel-execute:cpp): Replace "c" with "C++".
  (org-babel-execute:C++): Replace "c" with "C++".
  (org-babel-expand-body:C++): Replace "c" with "C++".
  (org-babel-C-execute): Replace "c" with "C++".
2011-02-22 21:20:26 -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
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 86418567cd babel: C: Don't trim body when expanding
* ob-C.el (org-babel-C-expand): Don't trim body
2010-10-21 13:06:01 +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 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 708d0e2da1 babel: Remove unused variable
* ob-C.el (org-babel-C-execute): Remove unused variable
2010-09-22 22:10:12 +01:00
Eric Schulte 025921e94f Babel language files should not require org mode explicitly
* lisp/ob-C.el (org): no longer requires org
* lisp/ob-ledger.el (org): no longer requires org
2010-09-10 09:33:00 -06:00
Eric Schulte e3d271ea5b fixed issue in org-babel-temp-file when forcing extension types
* lisp/ob-C.el (org-babel-C-execute): corrected arguments to
  org-babel-temp-file

* lisp/ob-latex.el (org-babel-execute:latex): corrected arguments to
  org-babel-temp-file

* lisp/ob.el (org-babel-temp-file): corrected arguments to
  make-temp-file
2010-08-25 19:21:42 -06: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
Eric Schulte bb8086ffbb ob-C: more generous regular expression for matching main call
* lisp/ob-C.el (org-babel-C-ensure-main-wrap): more generous regular
  expression for matching main function
2010-07-25 12:32:48 -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 46fec6b08b ob-C: removing excess newlines around expanded C code bodies
* lisp/ob-C.el (org-babel-C-expand): removing excess newlines around
  expanded C code bodies
2010-07-15 16:43:06 -07:00
Eric Schulte 2cd33b94d9 ob-c: no longer ignores the :results vector header argument
* lisp/ob-C.el (org-babel-C-execute): no longer ignores the :results vector
  header argument
2010-07-14 23:17:03 -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 c32d773919 babel: code cleaning -- `error' and `with-current-buffer' usage for Emacs inclusion 2010-07-06 10:30:58 -07:00
Eric Schulte 3416a0e323 babel: clean compile 2010-07-05 11:14:51 -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-C.el (Browse further)