* lisp/ob.el (org-babel-set-current-result-hash): Change the hash of the
results for the current code block.
(org-babel-current-result-hash): Fix documentation.
* lisp/ob-lob.el (org-babel-lob-execute): Don't re-execute the called
function if the current call line hash matches that in its results.
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.
Nick Dokos <nicholas.dokos@hp.com> writes:
> Eric Schulte <schulte.eric@gmail.com> wrote:
>
>> The attached updated patch fixes a bug in the original.
>>
>
> Minor problem in applying:
>
> ,----
> | $ git apply ~/Mail/inbox/724
> | /home/nick/Mail/inbox/724:671: trailing whitespace.
> | #+name:
> | /home/nick/Mail/inbox/724:599: new blank line at EOF.
> | +
> | warning: 2 lines add whitespace errors.
> `----
The attached version fixes these issues, Thanks -- Eric
>From 0e43d59ee8d46a63f86780a502de726271bc39de Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Fri, 28 Oct 2011 10:44:21 -0600
Subject: [PATCH] removing code block, results and call-line synonyms -- BREAKING CHANGE
Following a round of on-list discussion many code block synonyms have
been removed, moving forward the following syntax is valid.
- call lines are specified with #+call:
- code blocks are named with #+name:
- results are named with #+name:, however results generated by a code
block may still be labeled with #+results:, and tables named with
#+tblname: will be considered to be named results
The following function may be used to update an existing Org-mode
buffer to the new syntax.
(defun update-org-buffer ()
"Update an Org-mode buffer to the new data, code block and call line syntax."
(interactive)
(save-excursion
(flet ((to-re (lst) (concat "^[ \t]*#\\+" (regexp-opt lst t)
"\\(\\[\\([[:alnum:]]+\\)\\]\\)?\\:[ \t]*"))
(update (re new)
(goto-char (point-min))
(while (re-search-forward re nil t)
(replace-match new nil nil nil 1))))
(let ((old-re (to-re '("RESULTS" "DATA" "SRCNAME" "SOURCE")))
(lob-re (to-re '("LOB")))
(case-fold-search t))
(update old-re "name")
(update lob-re "call")))))
Note: If an old version of Org-mode (e.g., the one shipped with Emacs)
is installed on your system many of the important variables will
be pre-defined with a defvar and *will not* have their values
automatically updated, these include the following.
- org-babel-data-names
- org-babel-result-regexp
- org-babel-src-block-regexp
- org-babel-src-name-regexp
- org-babel-src-name-w-name-regexp
It may be necessary to either remove the source code of older
versions of Org-mode, or to explicitly evaluate the ob.el file.
* lisp/ob-exp.el (org-exp-res/src-name-cleanup): Updated
Documentation.
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp): Updated
regular expression.
(org-babel-inline-lob-one-liner-regexp): Updated regular expression.
* lisp/ob-ref.el (org-babel-ref-resolve): Notice when something that
looks like a data results may actually be a code block.
* lisp/ob-table.el: Updated documentation.
* lisp/ob.el (org-babel-src-name-regexp): Simplified regexp.
(org-babel-get-src-block-info): Updated match strings.
(org-babel-data-names): Simplified acceptable names.
(org-babel-find-named-block): Indentation.
(org-babel-find-named-result): Updated to not return a code block as
a result.
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Removing
references to old syntactic elements.
(org-additional-option-like-keywords): Removing references to old
syntactic elements.
* contrib/babel/library-of-babel.org: Updated to make use of the new
syntax.
* testing/examples/babel-dangerous.org: Updated to make use of the new
syntax.
* testing/examples/babel.org: Updated to make use of the new syntax.
* testing/examples/ob-awk-test.org: Updated to make use of the new
syntax.
* testing/examples/ob-fortran-test.org: Updated to make use of the new
syntax.
* testing/lisp/test-ob.el: Removed two bad tests which tested the
literal values of old regular expressions rather than their
behavior.
* lisp/ob-lob.el (org-babel-map-call-lines): Allow mapping of code
over all call lines in a buffer.
* lisp/ob.el (org-babel-execute-buffer): Execute call lines when
executing an entire buffer.
* lisp/ob-lob.el (org-babel-lob-execute-maybe): Don't execute a call
inside a verbatim block.
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Check for example
blocks.
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-keys.el (org-babel-key-bindings): Bound to C-c C-v k.
* lisp/ob.el (org-babel-map-regexp): New generic mapping macro.
(org-babel-map-inline-src-blocks): Rewritten to use new macro.
(org-babel-kill-results): Remove some or all results in the current
file.
* lisp/ob-lob.el (org-babel-map-call-lines): Map over all lob call
lines in the current file.
* doc/orgcard.tex: Document new keybinding.
* lisp/ob-lob.el (org-babel-inline-lob-one-liner-regexp): Updated to
successfully match optional trailing header arguments in square
brackets.
(org-babel-lob-get-info): Updated to match the new regexp.
* lisp/ob-lob.el (org-babel-inline-lob-one-liner-regexp): Removing
this trailing space ensures that the insertion of the results looks
nice.
* lisp/ob.el (org-babel-insert-result): Insert inline lob line results
as inline results.
* lisp/ob-exp.el (org-babel-exp-lob-one-liners): Calculate length
appropriately given the style (block or inline) of the lob line.
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp): New regexp
specific for block lob lines.
(org-babel-inline-lob-one-liner-regexp): New regexp specific for
inline lob lines.
(org-babel-lob-one-liner-regexp): Combination of two lob regexps.
(org-babel-lob-get-info): Return info from *either* the block or
inline lob lines.
* lisp/ob-exp.el (org-babel-exp-lob-one-liners): Corrected the
structure of the resulting info list.
* lisp/ob-lob.el (org-babel-default-lob-header-args): Export the
results of call lines by default.
* lisp/ob-lob.el (org-babel-lob-get-info): including pass-through
header arguments in results variable header argument string
* lisp/ob.el (org-babel-execute-src-block): working with new header
argument setup
(org-babel-parse-header-arguments): only split header argument
strings when []'s are balanced
* lisp/ob-exp.el (org-babel-exp-results): replaced old function call
* lisp/ob-lob.el (org-babel-lob-execute): replaced old function call
* lisp/ob-ref.el (org-babel-ref-parse): removed obsolete optional
params argument, also no longer chokes when handed an
already-resolved reference
(org-babel-ref-resolve): removed obsolete optional params argument
* lisp/ob.el (org-babel-ref-parse): updated function declaration
(org-babel-get-src-block-info): replaced old function call
(org-babel-header-arg-names): indentation
(org-babel-execute-src-block): now expanding all parameters using
the newly combined org-babel-process-params
(org-babel-switch-to-session-with-code): indentation
(org-mode-hook): indentation
(org-babel-process-params): now packages all results into the
parameter alist and does variable expansion, this should no longer
be called from inside of language functions
(org-babel-expand-noweb-references): updated function call for newly
removed obsolete function parameter