* doc/org.texi (Top): Documentation for new tangle-mode header argument.
(Specific header arguments): Documentation for new tangle-mode header
argument.
(rownames): Documentation for new tangle-mode header argument.
(tangle-mode): Documentation for new tangle-mode header argument.
* lisp/ob-core.el (org-babel-common-header-args-w-values): Adding the
new :tangle-mode header argument.
(org-babel-read): Read values starting with a "#" character as emacs
lisp.
* lisp/ob-tangle.el (org-babel-tangle): Use the new :tangle-mode header
argument.
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): Use the
new :tangle-mode header argument.
* lisp/ob-core.el (org-babel-where-is-src-block-head): return
point-marker instead of point.
(org-babel-current-exec-src-block-head): new global variable which is
bound during `org-babel-execute-src-block-maybe'
(org-babel-get-src-block-info): return a list of 7 elements, last
being the header location
Evaluation backends might need to use the exact location of the block in
original org file. For example when inserting the correct source
references for visual debugging. With this patch the information on
current block is available in `org-babel-current-exec-src-block-head'.
* lisp/ob-core.el (org-babel-parse-inline-src-block-match),
lisp/ob-exp.el (org-babel-exp-src-block): Give header arguments from
properties priority over default header arguments.
The previous commit e79e8943de did fix this only in
ob-core.el (org-babel-parse-src-block-match). It was already correct
in ob-lob.el (org-babel-lob-execute).
* lisp/ob-core.el (org-babel-inline-result-wrap): Defcustom controlling
the wrapping of inline results.
(org-babel-examplize-region): Use new defcustom controlling the
wrapping of inline results.
* org-agenda.el (org-agenda-write):
* ob-core.el (org-babel-expand-src-block): Use
`org-called-interactively-p'.
Thanks to Jason L Wright for reporting this.
* lisp/ob-core.el (org-babel-execute-src-block): Return nil in case of
`:results none'. Also run `org-babel-after-execute-hook' in this
circumstance.
Previously, the code returned the string "results silenced" in the case
of =:results none=, as this is the return value of the call to
`message'; additionally, the after-execute hook was not being run.
* ob-core.el (org-babel-insert-result): Fix bug when inserting
results as a list: ensure we split a string containing "\n".
Thanks to Sébastien Vauban for reporting this.
* lisp/ob-core.el (org-babel-when-in-src-block): New macro.
(org-babel-execute-src-block-maybe)
(org-babel-expand-src-block-maybe)
(org-babel-load-in-session-maybe, org-babel-pop-to-session-maybe):
Use it.
org-babel-get-src-block-info is a potentially expensive operation, which
is why its ‘light’ argument exists. But in any case, it is overkill to
query the whole info, if all that is needed is whether point is in a
block or not. Factor the simplified common code out into a macro.
* lisp/ob-core.el (org-babel-execute-src-block): Use `copy-tree'
to prevent setf from modifying users variables withing let-bound
`info' variable.
Otherwise, the setf calls in this function can reach into and change
other configuration variables, such as the library of babel.
* lisp/ob-core.el (org-babel-execute-src-block): Make sure we process
file results before they are passed to the post-processing code block,
and not afterwards. Tangles these two header arguments in the code,
but makes for more intuitive behavior and enables important use cases.
* lisp/ob-core.el (org-babel-common-header-args-w-values): Add :post to
the list of header arguments.
(org-babel-execute-src-block): Post process results when the :post
header argument has been supplied.
* doc/org.texi (var): Remove the "Alternate argument syntax" section
from the documentation.
* lisp/ob-core.el (org-babel-src-name-w-name-regexp): Update the regexp
used to match code block names.
(org-babel-get-src-block-info): Remove the code used to parse this
alternate variable specification syntax.
* lisp/ob-core.el (org-babel-temp-file): For remote hosts, modify the prefix
and leave `temporary-file-directory' unchanged.
The reason setting `temporary-file-directory' doesn't work here is
because `make-temp-file' recursively calls itself (indirectly).
Modifying `temporary-file-directly', affects the recursive calls as well,
which results in a "No such file file or directory" error.
The fix is to leave `temporary-file-directory' unaltered, for remote
hosts, and instead modifying the 'prefix' argument to `make-temp-file'
appropriately.
TINYCHANGE
* lisp/ob-core.el (org-babel-confirm-evaluate-answer-no): Dynamically
scoped variable, if bound non-nil the confirmation dialog will not
be initiated and denial of evaluation is assumed.
The new variable `org-babel-confirm-evaluate-answer-no´ can be bound
to suppress the user interaction as is needed for async export, as
discussed in http://thread.gmane.org/gmane.emacs.orgmode/67719
multiple changes to remove overly long lines.
* lisp/ob-core.el (org-babel-execute-src-block): A cond makes it more
clear that we definitely do not execute without user confirmation.
(org-babel-where-is-src-block-result): Overly long line.
* lisp/ob-core.el (org-babel-check-confirm-evaluate): New macro to
establish bindings based on INFO.
* lisp/ob-core.el (org-babel-check-evaluate): New defsubst that checks
if the evaluation of a code block is disabled. Refactors the first
part of the original function `org-babel-confirm-evaluate´.
* lisp/ob-core.el (org-babel-confirm-evaluate): New defsubst that
checks if the user should be queried and returns the answer. Keeps
the second part of the original function `org-babel-confirm-evaluate´.
* lisp/ob-core.el (org-babel-execute-src-block): Do not ask for
confirmation if the cached result is current.
* lisp/ob-core.el (org-babel-confirm-evaluate): Re-implement using
bindings for common subexpressions.
There was a minor bug in the reporting of an aborted evaluation as
"disabled" when no export was happening and eval-no-export was t since
the state of the export was not checked again.
* lisp/ob-core.el (org-babel-call-process-region-original): Change
declaration into definition with nil initial value at the beginning
of the file and drop the later definition. Add comment that the
dynamic scoping of this variable is done for tramp.
Reverting "Fix a typo I introduced while editing Achim's commit 091bf0"
Reverting "ob-core.el: Do not ask for confirmation if cached value is current"
This reverts commit 091bf02514.
* ob-core.el (org-babel-execute-src-block): Do not run
`org-babel-confirm-evaluate´ if source block has a cache and the
cache value is current (there is no evaluation involved in this
case).
* lisp/org.el (org-reverse-string): Add `org-reverse-string' to
reverse a string.
* lisp/org-id.el(org-id-new, org-id-decode): Replace
`org-id-reverse-string' by `org-reverse-string'.
* lisp/ob-core.el(org-babel-trim): Replace `org-babel-reverse-string'
by `org-reverse-string' and declare it.
TINYCHANGE
* add a header-row delimiter to the tables returned from mysql
* add new sql-specific header args for the database connection, and implements them for mysql
* add support for :colnames (mysql only)
* (minor) add an edebug spec to org-babel-result-cond to allow edebugging through it
* add some doc about what header args are used
The syntax of result hashes with times are now as show below.
#+RESULTS[<TIME> HASH]:
* lisp/ob-core.el (org-babel-result-regexp): Simplified regexp given new
time hash layout.
(org-babel-current-result-hash): New match string.
(org-babel-hide-hash): New match string.
(org-babel-where-is-src-block-result): New match string, and inserting
hashes in the new format.
* ob-core.el (org-babel-next-src-block)
(org-babel-previous-src-block): Rewrite using
`org-next-block'.
* org.el (org-next-block, org-previous-block): New navigation
commands.
(org-mode-map): Bind the new commands to C-c C-F and C-c C-B
respectively.
Thanks to Bill White for suggesting this.
* ob-core.el (org-ts-regexp): Remove duplicate defconst'ing.
(org-babel-result-regexp): Don't use `org-ts-regexp', use a
regexp string directly.
This is not the best solution, we should be able to use
`org-ts-regexp' here, but the dependencies makes it hard.
So let's not define org-ts-regexp twice, just use a raw
regexp instead, and add a FIXME warning about this.
suggested by Thomas Alexander Gerds
* lisp/ob-core.el (org-babel-result-regexp): Now matching time stamp as
well.
(org-babel-hash-show-time): Variable controlling the display of time
stamps.
(org-babel-current-result-hash): With hash time stamps.
(org-babel-hide-all-hashes): With hash time stamps.
(org-babel-where-is-src-block-result): With hash time stamps.
* lisp/ob.el: Only use the :wrap argument up to the first space when creating
the #+END_ directive.
Using an option like ":wrap SRC fundamental" was generating and end marker of
"#+END_SRC fundamental", which caused the new exporter to fail to handle to
block properly.
Patch from Michael Gauland.