Browse Source

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>
Nicolas Goaziou 5 years ago
parent
commit
e18415d02c
2 changed files with 13 additions and 1 deletions
  1. 1 1
      lisp/ob-core.el
  2. 12 0
      testing/lisp/test-ob.el

+ 1 - 1
lisp/ob-core.el

@@ -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)

+ 12 - 0
testing/lisp/test-ob.el

@@ -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)))))