Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2017-12-23 14:03:47 +01:00
commit 774e553f11
2 changed files with 40 additions and 2 deletions

View File

@ -2790,7 +2790,9 @@ block but are passed literally to the \"example-block\"."
(lambda (i)
;; Expand body of code blocked
;; represented by block info I.
(let ((b (org-babel-expand-noweb-references i)))
(let ((b (if (org-babel-noweb-p (nth 2 i) :eval)
(org-babel-expand-noweb-references i)
(nth 1 i))))
(if (not comment) b
(let ((cs (org-babel-tangle-comment-links i)))
(concat (funcall c-wrap (car cs)) "\n"

View File

@ -720,6 +720,42 @@ x
#+begin_src sh :noweb-sep \"\"
(+ 1 1)
#+end_src"
(org-babel-expand-noweb-references))))
;; Handle recursive expansion.
(should
(equal "baz"
(org-test-with-temp-text "
#+begin_src emacs-lisp :noweb yes<point>
<<foo>>
#+end_src
#+name: foo
#+begin_src emacs-lisp :noweb yes
<<bar>>
#+end_src
#+name: bar
#+begin_src emacs-lisp
baz
#+end_src"
(org-babel-expand-noweb-references))))
;; During recursive expansion, obey to `:noweb' property.
(should
(equal "<<bar>>"
(org-test-with-temp-text "
#+begin_src emacs-lisp :noweb yes<point>
<<foo>>
#+end_src
#+name: foo
#+begin_src emacs-lisp :noweb no
<<bar>>
#+end_src
#+name: bar
#+begin_src emacs-lisp
baz
#+end_src"
(org-babel-expand-noweb-references)))))