Browse Source

ob-R.el: fix a bug when a :var is propertized text

* lisp/ob-R.el (org-babel-R-assign-elisp): Strip text properties from
strings.

Before this change, babel would try to format propertized strings
using elisp read syntax.  The upshot is that evaluating the following
code block would give an error (in R, not emacs), since the “bar” in
foo-ex gets text properties via font lock:

| #+name: foo-ex
| #+begin_example
| bar
| #+end_example
|
| #+name: foo
| #+begin_src R :var foo=foo-ex
|   foo
| #+end_src
Aaron Ecay 5 years ago
parent
commit
d035c14765
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/ob-R.el

+ 1 - 1
lisp/ob-R.el

@@ -242,7 +242,7 @@ This function is called by `org-babel-execute-src-block'."
 		    name file header row-names max))))
     (cond ((integerp value) (format "%s <- %s" name (concat (number-to-string value) "L")))
 	  ((floatp   value) (format "%s <- %s" name value))
-	  ((stringp  value) (format "%s <- %S" name value))
+	  ((stringp  value) (format "%s <- %S" name (org-no-properties value)))
 	  (t                (format "%s <- %S" name (prin1-to-string value))))))