From 8ef19cdeeeeb981b6e84fb5fec0fa4649f7d4de3 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 27 Feb 2013 08:58:32 +0100 Subject: [PATCH] ob-tangle: Correctly unescape code when tangling * lisp/ob-tangle.el (org-babel-spec-to-string): Use dedicated function for unescaping code. --- lisp/ob-tangle.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index a835915b7..f8cf1e1b4 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -309,12 +309,12 @@ references." (defvar org-bracket-link-regexp) (defun org-babel-spec-to-string (spec) "Insert SPEC into the current file. -Insert the source-code specified by SPEC into the current -source code file. This function uses `comment-region' which -assumes that the appropriate major-mode is set. SPEC has the -form - (start-line file link source-name params body comment)" +Insert the source-code specified by SPEC into the current source +code file. This function uses `comment-region' which assumes +that the appropriate major-mode is set. SPEC has the form: + + \(start-line file link source-name params body comment)" (let* ((start-line (nth 0 spec)) (file (nth 1 spec)) (link (nth 2 spec)) @@ -346,8 +346,7 @@ form (insert (format "%s\n" - (replace-regexp-in-string - "^," "" + (org-unescape-code-in-string (org-babel-trim body (if org-src-preserve-indentation "[\f\n\r\v]"))))) (when link-p (funcall