all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Moresi <peter.moresi@gmail.com>
To: Peter Moresi <peter.moresi@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Issue with multiline string variable for JavaScript source code blocks
Date: Tue, 18 Nov 2014 16:04:25 -0800	[thread overview]
Message-ID: <CAK_Lq028E1wYfGgOHmPRmu4SdpJf+8azMKRK-pGVryoXoTof5g@mail.gmail.com> (raw)
In-Reply-To: <87bno4fb8j.fsf@nicolasgoaziou.fr>


[-- Attachment #1.1: Type: text/plain, Size: 33 bytes --]

Sure, the patch is attached.​

[-- Attachment #1.2: Type: text/html, Size: 54 bytes --]

[-- Attachment #2: 0001-Fix-problem-passing-multiline-variables-into-JS-sour.patch --]
[-- Type: text/x-patch, Size: 872 bytes --]

From 2c8214a8e45a6368c709ae26d6d20c7458ebe0dd Mon Sep 17 00:00:00 2001
From: Peter Moresi <peter.moresi@pnmac.com>
Date: Tue, 18 Nov 2014 15:58:17 -0800
Subject: [PATCH] Fix problem passing multiline variables into JS source code
 block

---
 lisp/ob-js.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index 47355b3..1a95216 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -114,7 +114,7 @@ Convert an elisp value into a string of js source code
 specifying a variable of the same value."
   (if (listp var)
       (concat "[" (mapconcat #'org-babel-js-var-to-js var ", ") "]")
-    (format "%S" var)))
+        (replace-regexp-in-string "\n" "\\\\n" (format "%S" var))))
 
 (defun org-babel-prep-session:js (session params)
   "Prepare SESSION according to the header arguments specified in PARAMS."
-- 
1.7.10.4


  reply	other threads:[~2014-11-19  0:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 20:44 Issue with multiline string variable for JavaScript source code blocks Peter Moresi
2014-11-18 21:30 ` Nicolas Goaziou
2014-11-19  0:04   ` Peter Moresi [this message]
2014-11-21 23:07     ` Nicolas Goaziou
2014-11-22  0:12       ` Peter Moresi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK_Lq028E1wYfGgOHmPRmu4SdpJf+8azMKRK-pGVryoXoTof5g@mail.gmail.com \
    --to=peter.moresi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.