From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew MacLean Subject: fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby Date: Tue, 11 Aug 2015 14:52:39 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113d3e768e65af051d0f4942 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGXe-0003n7-4C for emacs-orgmode@gnu.org; Tue, 11 Aug 2015 16:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPGXc-0006gT-N2 for emacs-orgmode@gnu.org; Tue, 11 Aug 2015 16:53:02 -0400 Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:35718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGXc-0006eJ-GQ for emacs-orgmode@gnu.org; Tue, 11 Aug 2015 16:53:00 -0400 Received: by oihn130 with SMTP id n130so112504855oih.2 for ; Tue, 11 Aug 2015 13:52:59 -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 --001a113d3e768e65af051d0f4942 Content-Type: multipart/alternative; boundary=001a113d3e768e65a9051d0f4940 --001a113d3e768e65a9051d0f4940 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.) Thanks..! By the way, sorry if this ends up being a duplicate... I learned not so long ago I needed to subscribe to actually post here and wasn't sure if my last post went to /dev/null or is just awaiting moderation. (I tested to make sure the patch still works with the most recent commit of the maint branch.) --001a113d3e768e65a9051d0f4940 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yo~!

fa5fd6351605912ec75e783cb626497b1ebe471e= =20 introduced a change where org-babel-script-escape stopped accepting=20 numbers. This caused an issue in ob-ruby.el where when trying to=20 evaluate something like "2 + 2", you would get the message:
=C2=A0 `org-babel-script-escape' expects a string

This b= roke evaluation of Ruby code blocks.

I suspect this is not the only location where this problem might arise,=20 so I am submitting a patch so the function simply returns numbers if=20 they are passed in rather than dying. (Because numbers don't need to be= =20 escaped, and this was the previous behaviour.)

Thanks..!<= br>

By the way, sorry if this ends up being a duplicate= ... I learned not so long ago I needed to subscribe to actually post here a= nd wasn't sure if my last post went to /dev/null or is just awaiting mo= deration. (I tested to make sure the patch still works with the most recent= commit of the maint branch.)
--001a113d3e768e65a9051d0f4940-- --001a113d3e768e65af051d0f4942 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_id7tny9h0 ZGlmZiAtLWdpdCBhL2xpc3Avb2ItY29yZS5lbCBiL2xpc3Avb2ItY29yZS5lbAppbmRleCBlM2Fi ZTk3Li4wMWM0ZGE4IDEwMDY0NAotLS0gYS9saXNwL29iLWNvcmUuZWwKKysrIGIvbGlzcC9vYi1j b3JlLmVsCkBAIC0yODEzLDM0ICsyODEzLDM3IEBAIGJsb2NrIGJ1dCBhcmUgcGFzc2VkIGxpdGVy YWxseSB0byB0aGUgXCJleGFtcGxlLWJsb2NrXCIuIgogICAgICAgKGVycm9yICJVbnRlcm1pbmF0 ZWQgc3RyaW5nIGluIGBvcmctYmFiZWwtc2NyaXB0LWVzY2FwZSciKSkKICAgICAoYXBwbHkgIydz d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