all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* resend of a patch for ob-lua.el
       [not found] <1530980378.1568524.1548139325432.ref@mail.yahoo.com>
@ 2019-01-22  6:42 ` Brad Knotwell
  2019-01-22  8:05   ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Knotwell @ 2019-01-22  6:42 UTC (permalink / raw)
  To: Org-mode

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: resend of a patch for ob-lua.el
  2019-01-22  6:42 ` resend of a patch for ob-lua.el Brad Knotwell
@ 2019-01-22  8:05   ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2019-01-22  8:05 UTC (permalink / raw)
  To: Brad Knotwell; +Cc: Org-mode

Hello,

Brad Knotwell <bknotwell@yahoo.com> writes:

> 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.

Thank you!

 Would you mind sending it using git format-patch command, along with
a proper commit message?

Also, free to write a regression test about it :)

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-22  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1530980378.1568524.1548139325432.ref@mail.yahoo.com>
2019-01-22  6:42 ` resend of a patch for ob-lua.el Brad Knotwell
2019-01-22  8:05   ` Nicolas Goaziou

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.