ob: Fix case when replacing Noweb reference

* lisp/ob-core.el (org-babel-expand-noweb-references): Use FIXEDCASE.
* testing/lisp/test-ob.el (test-ob/noweb-expansion): Add test.

Reported-by: Sebastian Miele <sebastian.miele@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00070.html>
This commit is contained in:
Nicolas Goaziou 2020-03-09 23:10:04 +01:00
parent 8b67d79c3b
commit e18415d02c
2 changed files with 13 additions and 1 deletions

View File

@ -2812,7 +2812,7 @@ block but are passed literally to the \"example-block\"."
(mapconcat #'identity
(split-string expansion "[\n\r]")
(concat "\n" prefix))))))
body nil t 2)))
body t t 2)))
(defun org-babel--script-escape-inner (str)
(let (in-single in-double backslash out)

View File

@ -782,6 +782,18 @@ x
* C
#+begin_src emacs-lisp :noweb-ref foo
C
#+end_src"
(org-babel-expand-noweb-references))))
;; Preserve case when replacing Noweb reference.
(should
(equal "(ignore)"
(org-test-with-temp-text "
#+begin_src emacs-lisp :noweb-ref AA
\(ignore)
#+end_src
#+begin_src emacs-lisp :noweb yes<point>
<<AA>>
#+end_src"
(org-babel-expand-noweb-references)))))