emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brad Knotwell <bknotwell@yahoo.com>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: resend of a patch for ob-lua.el
Date: Tue, 22 Jan 2019 06:42:05 +0000 (UTC)	[thread overview]
Message-ID: <1530980378.1568524.1548139325432@mail.yahoo.com> (raw)
In-Reply-To: 1530980378.1568524.1548139325432.ref@mail.yahoo.com

[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]

It looks like my original patch was never integrated.  The code below makes tangling multi-line variable work by using Lua's multi-line string syntax ([=[ ... ]=]) instead of the python-like but invalid """.
Likewise, it doesn't change the single line behavior.
Testing is pretty straightforward:  pass a multi-line variable in as a header argument, tangle the file and try to load it.  Before == syntax error and after == code loads and runs.
Thx.
--Brad
diff --git a/lisp/ob-lua.el b/lisp/ob-lua.el
index 6b438b4f9..70d328ecf 100644

--- a/lisp/ob-lua.el

+++ b/lisp/ob-lua.el

@@ -148,7 +148,7 @@ specifying a variable of the same value."

     (if (eq var 'hline)

         org-babel-lua-hline-to

       (format

-       (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")

+       (if (and (stringp var) (string-match "[\n\r]" var)) "[=[%s]=]" "%S")

        (if (stringp var) (substring-no-properties var) var)))))

 

 (defun org-babel-lua-table-or-string (results)


[-- Attachment #2: Type: text/html, Size: 2959 bytes --]

       reply	other threads:[~2019-01-22  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1530980378.1568524.1548139325432.ref@mail.yahoo.com>
2019-01-22  6:42 ` Brad Knotwell [this message]
2019-01-22  8:05   ` resend of a patch for ob-lua.el Nicolas Goaziou

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=1530980378.1568524.1548139325432@mail.yahoo.com \
    --to=bknotwell@yahoo.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).