0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-04 03:43:01 +00:00
org-mode/testing/lisp
Nicolas Goaziou df10309489 ob-ref: Properly resolve references in ":post" arguments
* lisp/ob-core.el (org-babel-exp-reference-buffer): New variable, as
  a replacement for `org-current-export-file'.
(org-babel-check-confirm-evaluate): Use new variable.
* lisp/ob-exp.el (org-babel-exp-in-export-file): Use new variable.
(org-babel-exp-get-export-buffer): Remove function.
(org-babel-exp-process-buffer): Change signature.
* lisp/ob-ref.el (org-babel-ref-resolve): Use new variable during
  export in order to properly resolve references.
* lisp/ox.el (org-export-execute-babel-code): Use new variable.

* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
  Remove a cond branch as it is always
  false (`org-current-export-file' couldn't be a string).

* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines): Update
  test.
* testing/lisp/test-ob.el (test-ob/eval-header-argument): Update test.
* testing/lisp/test-ob-exp.el (ob-export/reference-in-post-header):
  New test.

During export, Babel executes sequentially all blocks in the buffer
being exported.  This can lead to modifications preventing some
references from being resolved.  As a workaround, Babel stores
a pristine copy of the buffer in a variable so it can always find
needed references.

Before this patch, the variable storing this copy was
`org-current-export-file' and was dynamically bound in "ox.el".  It
was used to resolve noweb references (`org-babel-expand-noweb-references')
but not regular references (`org-babel-ref-resolve').

Now, the variable is `org-babel-exp-reference-buffer' and it is bound
from `org-babel-exp-process-buffer'.  It is used to resolve all
references.  In particular, this allows to use references in :post
header.

Thanks to Jarmo Hurri for reporting it.
2014-03-19 21:34:56 +01:00
..
test-ob-awk.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-C.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-emacs-lisp.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-exp.el ob-ref: Properly resolve references in ":post" arguments 2014-03-19 21:34:56 +01:00
test-ob-fortran.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-header-arg-defaults.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-lilypond.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-lob.el ob-ref: Properly resolve references in ":post" arguments 2014-03-19 21:34:56 +01:00
test-ob-maxima.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-octave.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-perl.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-python.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-R.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-ruby.el ob-ruby.el: fix result of :results output :session combination. 2013-10-21 13:09:28 -06:00
test-ob-shell.el Renaming of ob-sh to ob-shell: various fixes 2014-02-02 00:08:56 -07:00
test-ob-table.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob-tangle.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-ob.el ob-ref: Properly resolve references in ":post" arguments 2014-03-19 21:34:56 +01:00
test-org-clock.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-org-element.el Merge branch 'maint' 2014-03-12 09:08:37 +01:00
test-org-footnote.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-org-list.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-org-macro.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-org-src.el Update copyright years again. 2014-01-07 14:18:17 +01:00
test-org-table.el Add ERT with org-lookup-all for GROUP BY and ranking 2014-02-22 21:18:28 +01:00
test-org.el `org-open-at-point' right after an object still open it 2014-03-02 10:32:51 +01:00
test-ox.el Merge branch 'maint' 2014-01-07 14:19:03 +01:00
test-property-inheritance.el Update copyright years again. 2014-01-07 14:18:17 +01:00