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) (lambda (i)
;; Expand body of code blocked ;; Expand body of code blocked
;; represented by block info I. ;; 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 (if (not comment) b
(let ((cs (org-babel-tangle-comment-links i))) (let ((cs (org-babel-tangle-comment-links i)))
(concat (funcall c-wrap (car cs)) "\n" (concat (funcall c-wrap (car cs)) "\n"

View File

@ -721,7 +721,43 @@ x
#+begin_src sh :noweb-sep \"\" #+begin_src sh :noweb-sep \"\"
(+ 1 1) (+ 1 1)
#+end_src" #+end_src"
(org-babel-expand-noweb-references))))) (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)))))
(ert-deftest test-ob/splitting-variable-lists-in-references () (ert-deftest test-ob/splitting-variable-lists-in-references ()
(org-test-with-temp-text "" (org-test-with-temp-text ""