Thanks to Richard Riley for the initial idea and implementation
* lisp/ob.el (org-babel-demarcate-block): interactive demarcation of
code blocks
* lisp/ob-keys.el (org-babel-key-bindings): key bindings for block
demarcation
* doc/orgcard.tex: documentation in the ref card
* lisp/ob-keys.el (org-babel-key-bindings): adding key-binding for
`org-babel-goto-src-block-head'
* lisp/ob.el (org-babel-goto-src-block-head): jump to the head of the
current code block
* lisp/ob.el (org-babel-next-src-block): now raising more informative
error when no further code blocks can be found
(org-babel-previous-src-block): now raising more informative error
when no previous code blocks can be found
Thanks to Sébastien Vauban for making the case for this behavior
* lisp/ob.el (org-babel-insert-result): remove existing results when
nil results are returned
* ob.el (org-babel-temp-file): Don't use babel temporary
directory in remote case; use make-temp-file with remote file
name so that temp file is guaranteed not to exist previously
on remote machine.
(org-babel-tramp-localname): New function to return local name
portion of possibly remote file specification
* ob-R.el (org-babel-R-evaluate-external-process): Respond to
changes in `org-babel-temp-file'; pass local file name to
remote R process.
(org-babel-R-evaluate-session) Respond to
changes in `org-babel-temp-file'; pass local file name to
remote R process.
this makes it possible to export while not evaluating some code
blocks
* lisp/ob-exp.el (org-babel-exp-do-export): removing hacky ":noeval",
which is now an alias to ":eval no"
* lisp/ob.el (org-babel-confirm-evaluate): ":noeval" is an alias for
":eval no", also no longer throwing errors
(org-babel-header-arg-names): adding both eval and noeval as general
header arguments
(org-babel-execute-src-block): now using the new non-error
confirmation functionality
ob-org has two non-standard header arguments in that it exports it's
results by default and the result type defaults to raw, this ensures
that the body of a begin_src org block exports transparently.
This is a breaking change in that if you are currently using org
code blocks to export org-fontified code you will have to set the
":exports" header argument for org-mode blocks to "code" on a block,
file, language or system-wide basis.
* Makefile (LISPF): adding ob-org.el to the makefile
* lisp/ob-org.el: defines handling of org code blocks
* lisp/ob.el (org-babel-insert-result): now when "org" is a result
type the results are wrapped in an org code block
Thanks to Noorul Islam for pointing out this issue
* lisp/ob.el (org-babel-remove-temporary-directory): the version of
`delete-directory' found in files.el can not be assumed to be
present on all versions, so this copies the recursive behavior of
that command in such a way that all calls to delete-directory will
also work with the built-in internal C implementation of that
function. This is not overly difficult as all elements of the
directory can be assumed to be files.
* 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'
* ob.el (org-babel-initiate-session): new function derived
from previous `org-babel-switch-to-session'
(org-babel-switch-to-session): refactored to use new
`org-babel-initiate-session'
This breaks the original `org-babel-switch-to-session' into a new
function `org-babel-initiate-session' and
`org-babel-switch-to-session'.
* ob.el (org-babel-do-in-edit-buffer): Suppress message and
check that org-src buffer is current before attempting exit
* org-src.el (org-edit-src-code): New argument quietlyp allows
message to be suppressed
* ob.el (org-babel-do-in-edit-buffer): New macro to
evaluate lisp in the language major mode edit buffer.
(org-babel-do-key-sequence-in-edit-buffer): New function to call
an arbitrary key sequence in the language major mode edit
buffer
* org-src.el (org-src-switch-to-buffer): Add new allowed value
'switch-invisibly for `org-src-window-setup'.
* ob-keys.el (org-babel-key-bindings): Bind
`org-babel-do-key-sequence-in-edit-buffer' to x and C-x in
`org-babel-map'
* ob.el (org-babel-switch-to-session-with-code): new function
to generate split frame displaying edit buffer and session.
* ob-keys.el (org-babel-key-bindings): binding for
`org-babel-switch-to-session-with-code'
* ob.el (org-babel-execute-src-block-maybe): remove check for
`org-babel-no-eval-on-ctrl-c-ctrl-c'; this is done in the new
function `org-babel-execute-safely-maybe'
(org-babel-execute-maybe): new function to execute src blocks
or lob/call lines.
(org-babel-execute-safely-maybe): new function to execute src blocks
or lob/call lines via C-c C-c
(org-ctrl-c-ctrl-c-hook): remove
`org-babel-execute-src-block-maybe' and add
`org-babel-execute-safely-maybe'.
* ob-lob.el (org-ctrl-c-ctrl-c-hook): remove
`org-babel-lob-execute-maybe'
* ob-keys.el (org-babel-key-bindings): New function
`org-babel-execute-maybe' is bound to C-c C-v e and C-c C-v
C-e
* lisp/ob.el (org-babel-get-src-block-info): ensure that we don't
match (and return info for) source blocks without a language
* lisp/org-exp.el (org-export-replace-src-segments-and-examples):
updated source code block regexp so that the presence of a language
can be explicitly checked. Also now raising an error when a source
block does not have a language.
Thanks to Austin Frank for suggesting these features and to Jonathan
Arkell for an implementation suggestion
This commit
- adds `org-babel-goto-named-result' for jumping to named results
- adds TAB-completion to `org-babel-goto-named-src-block'
- standardizes on "-src-" instead of "-source-" in all babel functions
- adds `org-babel-[next/previous]-src-block' functions and keybindings
- documents the above in orgcard.tex
* doc/orgcard.tex: update documentation of babel keybindings
* lisp/ob-exp.el (org-exp-res/src-name-cleanup): standardized on
"-src-" instead of "-source-"
* lisp/ob-keys.el (org-babel-key-bindings): updating keybindings for
new movement functions
* lisp/ob-lob.el (org-babel-lob-ingest): standardized on "-src-"
instead of "-source-"
* lisp/ob-ref.el (org-babel-ref-resolve-reference): standardized on
"-src-" instead of "-source-"
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): standardized on
"-src-" instead of "-source-"
* lisp/ob.el (org-babel-src-name-regexp): standardized on "-src-"
instead of "-source-"
(org-babel-src-name-w-name-regexp): adding regexp for matching
source names along with their names
(org-babel-get-src-block-info): using new named source block regexp
(org-babel-result-regexp): adding optional whitespace after result
regexp
(org-babel-result-w-name-regexp): adding regexp for matching results
which have names
(org-babel-named-src-block-regexp-for-name): standardized on "-src-"
instead of "-source-"
(org-babel-map-src-blocks): standardized on "-src-" instead of
"-source-"
(org-babel-where-is-src-block-head): standardized on "-src-" instead of
"-source-"
(org-babel-goto-named-src-block): standardized on "-src-" instead of
"-source-", also added completing read
(org-babel-src-block-names): collects source block names from a file
or the current buffer
(org-babel-goto-named-result): function for jumping to a named
result
(org-babel-result-names): returns results names from a file or the
current buffer
(org-babel-next-src-block): jump to the next source block
(org-babel-previous-src-block): jump to the previous source block
* lisp/ob.el (org-babel-default-header-args): Added (:tangle . "no")
to the default header arguments. This is already the intended
behavior, but it's better to be more explicit about such things.
* lisp/ob.el (org-babel-confirm-evaluate): adding a new :eval header
argument which can be used to control evaluation
* doc/org.texi (eval): adding documentation for the new :eval header
argument
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.