* 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.
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.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.
This commit also bumps the version number to 7.8.06.
The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.
This commit reverts back the maint branch to its state before
merging the master branch. From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
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
* lisp/ob-awk.el (org-babel-execute:awk): Use "verbatim" as synonym
for "scalar".
* lisp/ob-sh.el (org-babel-sh-evaluate): Use "verbatim" as synonym for
"scalar".
* lisp/ob-sqlite.el (org-babel-execute:sqlite): Use "verbatim" as
synonym for "scalar".
* lisp/ob.el (org-babel-merge-params): Use "verbatim" as synonym for
"scalar".
Hi,
When evaluating shell code blocks in org-babel, the execution seems to hang
indefinitely. The following patch is trying to fix this problem by modifying
the way shell code is send to comint and the way the end-of-evaluation
indicator is looking for.
As I am far from an emacs lisp expert and as the patch modifies the widely use
org-babel-comint-with-output function, it certainly needs some testing. I've
made some tests with shell and R code blocks, but I'm not sure it's enough.
Thanks !
Julien
Fix sh block execution in a session
* lisp/ob-sh.el (org-babel-sh-evaluate) : when sending input to comint, wait
until previous line execution is finished
* lisp/ob-comint.el (org-babel-comint-with-output) : when looking for
end-of-evaluation indicator, search forward for the indicator before searching
forward for the prompt
* lisp/ob-sh.el (ob-ref): Uses ob-ref to resolve the value of the
:stdin header argument.
(org-babel-execute:sh): Use the :stdin header argument.
(org-babel-sh-var-to-sh): Split the bulk of this function off into a
new sub-function.
(org-babel-sh-var-to-string): New function for converting elisp
values to strings that make sense for parsing with sh.
(org-babel-sh-evaluate): Adding "stdin" option to session and
external evaluation options.
* lisp/ob-sh.el (org-babel-sh-var-to-sh): Wrap end token of heredoc in
single quotes which is the best practice.
(org-babel-sh-table-or-results): Use `org-babel-script-escape' for
more robust parsing of shell output.
* ob-sh.el (org-babel-sh-var-to-sh): Ensure value has the
structure of an Org-mode table (list of lists)
Non-nested lists can arise either by explicit assignment,
e.g. :var '(1 2), or by assigning a one-dimensional slice of a table.
* 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
* ob-sh.el (org-babel-execute:sh): Use generic expansion
function
(org-babel-expand-body:sh): Delete function
(org-babel-prep-session:sh): Change name of called function
(org-babel-variable-assignments:sh): Change function name
* lisp/ob-clojure.el (org-babel-prep-session:clojure): purging all
calls to removed org-babel-ref-variables
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): purging all
calls to removed org-babel-ref-variables
* lisp/ob-ruby.el (org-babel-prep-session:ruby): purging all calls to
removed org-babel-ref-variables
* lisp/ob-scheme.el (org-babel-prep-session:scheme): purging all calls
to removed org-babel-ref-variables
* lisp/ob-sqlite.el (org-babel-expand-body:sqlite): purging all calls
to removed org-babel-ref-variables
(org-babel-execute:sqlite): purging all calls to removed
org-babel-ref-variables
* ob-sh.el (org-babel-expand-body:sh): Refactor: break variable
assignment part out into a separate function
(org-babel-sh-variable-assignments): New function constructing
list of variable assignment statements
(org-babel-prep-session:sh): Use new function
`org-babel-sh-variable-assignments' instead of previous
(incorrect) variable assignment code.
* 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'