From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew MacLean Subject: ob-ruby org-babel-ruby-table-or-string numeric argument patch Date: Mon, 10 Aug 2015 12:00:31 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7bd7645615d5d3051cf8c4cf Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOrNV-0007tZ-SU for emacs-orgmode@gnu.org; Mon, 10 Aug 2015 14:00:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOrNU-0005hJ-1Z for emacs-orgmode@gnu.org; Mon, 10 Aug 2015 14:00:53 -0400 Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]:33222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOrNT-0005gr-R8 for emacs-orgmode@gnu.org; Mon, 10 Aug 2015 14:00:51 -0400 Received: by obbhe7 with SMTP id he7so33549981obb.0 for ; Mon, 10 Aug 2015 11:00:50 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --047d7bd7645615d5d3051cf8c4cf Content-Type: multipart/alternative; boundary=047d7bd7645615d5ce051cf8c4cd --047d7bd7645615d5ce051cf8c4cd Content-Type: text/plain; charset=UTF-8 Yo~! fa5fd6351605912ec75e783cb626497b1ebe471e introduced a change where org-babel-script-escape stopped accepting numbers. This caused an issue in ob-ruby.el where when trying to evaluate something like "2 + 2", you would get the message: `org-babel-script-escape' expects a string This broke evaluation of Ruby code blocks. I suspect this is not the only location where this problem might arise, so I am submitting a patch so the function simply returns numbers if they are passed in rather than dying. (Because numbers don't need to be escaped, and this was the previous behaviour.) Could you review my patch? Thanks..! --047d7bd7645615d5ce051cf8c4cd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yo~!

fa5fd6351605912ec75e783cb626497b1ebe471e = introduced a change where org-babel-script-escape stopped accepting numbers= . This caused an issue in ob-ruby.el where when trying to evaluate somethin= g like "2 + 2", you would get the message:

=C2=A0 `org-bab= el-script-escape' expects a string

This broke evaluation o= f Ruby code blocks.

I suspect this is not the only location whe= re this problem might arise, so I am submitting a patch so the function sim= ply returns numbers if they are passed in rather than dying. (Because numbe= rs don't need to be escaped, and this was the previous behaviour.)
<= br>
Could you review my patch? Thanks..!
--047d7bd7645615d5ce051cf8c4cd-- --047d7bd7645615d5d3051cf8c4cf Content-Type: text/x-patch; charset=US-ASCII; name="org-babel-script-escape-numbers.patch" Content-Disposition: attachment; filename="org-babel-script-escape-numbers.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_id6841zr0 ZGlmZiAtLWdpdCBhL2xpc3Avb2ItY29yZS5lbCBiL2xpc3Avb2ItY29yZS5lbAppbmRleCBlM2Fi ZTk3Li4wMWM0ZGE4IDEwMDY0NAotLS0gYS9saXNwL29iLWNvcmUuZWwKKysrIGIvbGlzcC9vYi1j b3JlLmVsCkBAIC0yODEzLDM0ICsyODEzLDM3IEBAIGJsb2NrIGJ1dCBhcmUgcGFzc2VkIGxpdGVy YWxseSB0byB0aGUgXCJleGFtcGxlLWJsb2NrXCIuIgogICAgICAgKGVycm9yICJVbnRlcm1pbmF0 ZWQgc3RyaW5nIGluIGBvcmctYmFiZWwtc2NyaXB0LWVzY2FwZSciKSkKICAgICAoYXBwbHkgIydz dHJpbmcgKHJldmVyc2Ugb3V0KSkpKQogCi0oZGVmdW4gb3JnLWJhYmVsLXNjcmlwdC1lc2NhcGUg KHN0ciAmb3B0aW9uYWwgZm9yY2UpCi0gICJTYWZlbHkgY29udmVydCB0YWJsZXMgaW50byBlbGlz cCBsaXN0cy4iCi0gICh1bmxlc3MgKHN0cmluZ3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