org-mode/lisp
Ian Martins 6edfc2b57c ob-java.el: Add support for variables, return values, tramp
* lisp/ob-java.el: Add support for variables and return values.  Write
tempfiles to the `org-babel-temporary-directory'.  Make package,
class, and main method definitions optional.

* testing/lisp/test-ob-java.el: Add tests.

ob-java was missing features common to many other org-babel
implementations, such as the ability to accept variables and return a
value. This brings those features to ob-java, making the experience
more consistent across org-babel languages, and expanding the ways
java source blocks interact with org mode buffers.

A simple java program requires boilerplate code to declare a class and
main method.  This boilerplate code makes java source blocks more
tedious to write and more effort to read.  This is more evident in an
org buffer where there may be many small source blocks.  This change
makes that code optional.  If it is not provided, the source block
will be wrapped in the boilerplate code just before compilation.

Most org babel implementation write temporary files to the
`org-babel-temporary-directory'.  That avoids polluting the current
directory and provides built-in support for tramp.  ob-java would
write source files and binaries to the directory containing the org
file by default.  This may be unexpected and unwanted, and didn't work
with tramp.  This change writes all tempfiles to the
`org-babel-temporary-directory'.

Executing an ob-java source block would always try to compile and run
the code in the source block, so a source block that wasn't
runnable (didn't contain a main method) would error during run.  This
change adds a generic main method just before compilation if one isn't
included in the source block so that the run will succeed.

There were no tests for ob-java.  This adds tests.
2020-10-25 15:24:08 -04:00
..
Makefile Move link-related core functions out of "org.el" 2019-03-10 18:00:27 +01:00
ob-C.el Merge branch 'maint' 2020-09-04 12:12:37 +02:00
ob-J.el ob-J.el: Add a maintainer 2020-09-05 08:06:01 +02:00
ob-R.el lisp/ob-R.el: Don't throw an error when result cannot be parsed 2020-05-24 16:08:52 +02:00
ob-abc.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-asymptote.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-awk.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-calc.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-clojure.el ob-clojure.el: More minor refinements 2020-02-17 02:38:02 +01:00
ob-comint.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-coq.el Backport commit dd16e46bb from Emacs 2020-10-25 01:10:16 -04:00
ob-core.el lisp/ob-core.el: Allow passing empty vector to :file-desc to omit description 2020-10-06 23:13:12 -04:00
ob-css.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-ditaa.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-dot.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-ebnf.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-emacs-lisp.el ob-emacs-lisp.el: Don't wrap execution within `save-window-excursion' 2020-09-07 07:37:19 +02:00
ob-eshell.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
ob-eval.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-exp.el Skip archived headings when tangling and exporting 2020-09-07 06:51:06 +02:00
ob-forth.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-fortran.el Backport commit 770f76f05 from Emacs 2020-03-15 22:51:31 -04:00
ob-gnuplot.el ob-gnuplot: Download remote input files 2020-10-24 14:14:02 +02:00
ob-groovy.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-haskell.el ob-haskell: Introduce :compile header argument 2020-05-25 09:17:14 +02:00
ob-hledger.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-io.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-java.el ob-java.el: Add support for variables, return values, tramp 2020-10-25 15:24:08 -04:00
ob-js.el Backport commit dd16e46bb from Emacs 2020-10-25 01:10:16 -04:00
ob-latex.el ob-latex.el: Make latex to svg compilation very customizable 2020-10-24 14:28:29 +02:00
ob-ledger.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-lilypond.el Various minor fixes 2020-02-18 23:24:09 +01:00
ob-lisp.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-lob.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
ob-lua.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-makefile.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-matlab.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-maxima.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-mscgen.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-ocaml.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-octave.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-org.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-perl.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-picolisp.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-plantuml.el Backport commit c6fa0ad31 from Emacs 2020-10-04 15:06:39 -04:00
ob-processing.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
ob-python.el ob-python: Rename exec tmpfile handle to prevent conflict 2020-10-24 07:01:27 -07:00
ob-ref.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-ruby.el ob-ruby.el: allow specification of ruby command w/header arg 2020-10-24 13:37:25 +02:00
ob-sass.el Backport commit c6fa0ad31 from Emacs 2020-10-04 15:06:39 -04:00
ob-scheme.el ob-scheme.el: Add support for `geiser-scheme-implementation' 2020-06-08 10:46:08 +02:00
ob-screen.el ob-screen: Quote session name before passing to string-match 2020-07-15 23:28:00 -04:00
ob-sed.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-shell.el ob-shell.el: New option `org-babel-shell-results-defaults-to-output' 2020-09-07 19:30:04 +02:00
ob-shen.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-sql.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-sqlite.el Merge branch 'maint' 2020-09-06 11:59:31 +02:00
ob-stan.el Backport commit c6fa0ad31 from Emacs 2020-10-04 15:06:39 -04:00
ob-table.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ob-tangle.el Skip archived headings when tangling and exporting 2020-09-07 06:51:06 +02:00
ob-vala.el Backport commit dd16e46bb from Emacs 2020-10-25 01:10:16 -04:00
ob.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
ol-bbdb.el lisp/ol-bbdb.el: Tiny formatting enhancements 2020-05-23 10:32:43 +02:00
ol-bibtex.el Backport commit 78eacf31e from Emacs 2020-10-04 15:06:39 -04:00
ol-docview.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-eshell.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-eww.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-gnus.el ol-gnus: Prefer nnselect to nnir if available 2020-09-07 23:19:15 -04:00
ol-info.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-irc.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-mhe.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-rmail.el Move custom links to new tooling 2020-02-19 18:42:50 +01:00
ol-w3m.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
ol.el ol.el: Fix store and insert link in indirect buffer 2020-09-04 17:59:21 +02:00
org-agenda.el org-agenda.el: Fix typo in docstring 2020-10-24 13:34:02 +02:00
org-archive.el Merge branch 'maint' 2020-04-12 01:44:21 -04:00
org-attach-git.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
org-attach.el Merge branch 'maint' 2020-07-08 00:12:06 -04:00
org-capture.el Merge branch 'maint' into master 2020-10-03 02:28:11 -04:00
org-clock.el Merge branch 'maint' into master 2020-08-23 22:39:44 -04:00
org-colview.el org-colview: Fix done keywords highlighting in agenda buffers 2020-10-20 00:35:11 -04:00
org-compat.el Merge branch 'maint' 2020-08-10 20:38:18 -04:00
org-crypt.el org.el (org-end-of-meta-data): Allow to skip only standard drawers 2020-09-13 18:36:15 +02:00
org-ctags.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
org-datetree.el org-datetree.el: Respect `org-blank-before-new-entry' 2020-09-09 10:07:29 +02:00
org-duration.el Add `generated-autoload-file' buffer local variable 2020-02-18 23:37:24 +01:00
org-element.el org-element: Swap pcase patterns to avoid Emacs 24 error 2020-09-16 21:53:57 -04:00
org-entities.el entities: Fix "empty" entity in LaTeX 2020-10-04 14:53:18 +02:00
org-faces.el Review face for export dispatcher highlighted keys 2020-10-24 13:44:42 +02:00
org-feed.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
org-footnote.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
org-goto.el Merge branch 'maint' 2020-09-05 09:41:42 +02:00
org-habit.el habit: Fix of the fix of color for very first done of a habit 2020-07-04 12:44:13 +02:00
org-id.el id: Close unnecessary buffers after having looked for an ID 2020-10-06 12:11:58 +02:00
org-indent.el org-indent.el: Deprecate `org-hide-leading-stars-before-indent-mode' 2020-02-20 15:17:21 +01:00
org-inlinetask.el Update copyright year to 2020 2020-01-01 13:38:46 -05:00
org-install.el org-install.el: Do not warn users. 2013-01-22 14:08:39 +01:00
org-keys.el Bind `org-force-cycle-archived' to C-c C-TAB 2020-06-01 14:39:28 +02:00
org-lint.el Fix `org-lint-link-to-local-file'. 2020-09-26 10:34:59 +02:00
org-list.el list: Fix item insertion when split point is near blanks 2020-08-16 11:42:53 +02:00
org-macro.el macro: Small refactoring. 2020-04-26 22:57:47 +02:00
org-macs.el org-macs.el: Silence byte-compiler under 'make single' 2020-07-15 23:37:21 -04:00
org-mobile.el Fix org menu initialization 2020-02-07 16:26:31 +01:00
org-mouse.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
org-num.el Backport commit 78eacf31e from Emacs 2020-10-04 15:06:39 -04:00
org-pcomplete.el Silence byte-compiler 2020-06-03 16:52:20 +02:00
org-plot.el lisp/org-plot.el: Add a maintainer 2020-09-08 09:14:54 +02:00
org-protocol.el org-protocol: Allow slashes after sub-protocol 2020-05-22 17:54:41 +02:00
org-refile.el org-refile.el (org-refile): Add description of RFLOC to docstring 2020-10-20 00:35:10 -04:00
org-src.el src: Do not undo edit buffers back to empty state 2020-07-02 19:30:14 +02:00
org-table.el Backport commit c6fa0ad31 from Emacs 2020-10-04 15:06:39 -04:00
org-tempo.el Backport commit dd16e46bb from Emacs 2020-10-25 01:10:16 -04:00
org-timer.el org-timer.el: Remove useless `or' conditional 2020-03-02 15:55:45 +01:00
org.el Merge branch 'maint' into master 2020-10-25 01:12:00 -04:00
ox-ascii.el Do not leak "attachment" links 2020-02-22 14:22:49 +01:00
ox-beamer.el Extend export tooling in link parameters 2020-02-19 18:41:37 +01:00
ox-html.el html: Improve consistency on internal anchors naming scheme 2020-09-09 10:23:28 +02:00
ox-icalendar.el Tiny formatting fixes 2020-02-18 22:57:37 +01:00
ox-latex.el ox-latex: Fix links to files with name matching an image type 2020-08-16 12:01:20 +02:00
ox-man.el Do not leak "attachment" links 2020-02-22 14:22:49 +01:00
ox-md.el ox-md: Fix docstring. 2020-06-28 08:44:11 +02:00
ox-odt.el Use `org-preview-latex-image-directory' instead of hardcoding 2020-09-05 10:41:36 +02:00
ox-org.el Extend export tooling in link parameters 2020-02-19 18:41:37 +01:00
ox-publish.el publish: Fix site-map file name 2020-04-18 18:22:28 +02:00
ox-texinfo.el Merge branch 'maint' into master 2020-09-07 21:23:16 -04:00
ox.el Review face for export dispatcher highlighted keys 2020-10-24 13:44:42 +02:00