From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Ruiz Subject: Re: bug in 8.2.5f for using tables as data in python? Date: Wed, 22 Jan 2014 12:41:40 +0000 (GMT) Message-ID: <1390394500.74076.YahooMailNeo@web171303.mail.ir2.yahoo.com> References: <1390394132.49030.YahooMailNeo@web171302.mail.ir2.yahoo.com> Reply-To: Miguel Ruiz Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="-1953309981-1056767261-1390394500=:74076" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5yZF-0005QI-Kj for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 09:14:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5yZ9-0002TK-AE for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 09:14:09 -0500 Received: from nm3-vm0.bullet.mail.ird.yahoo.com ([77.238.189.213]:41067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5yZ8-0002T2-MI for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 09:14:03 -0500 In-Reply-To: <1390394132.49030.YahooMailNeo@web171302.mail.ir2.yahoo.com> 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" ---1953309981-1056767261-1390394500=:74076 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =0A=0ACould it be a poorly rewritten patch? Original Daniel Gerber's propos= al works for me.=0A=0A=0Adiff --git a/lisp/ob-python.el b/lisp/ob-python.el= =0Aindex 1457682..523fd70 100644 (file)=0A--- a/lisp/ob-python.el=0A+++ b/l= isp/ob-python.el=0A@@ -137,7 +137,7 @@ specifying a variable of the same va= lue."=0A=A0=A0=A0=A0=A0=A0=A0 org-babel-python-hline-to=0A=A0=A0=A0=A0=A0= =A0 (format=0A=A0=A0=A0=A0=A0=A0=A0 (if (and (stringp var) (string-match "[= \n\r]" var)) "\"\"%S\"\"" "%S")=0A-=A0=A0=A0=A0=A0=A0 var))))=0A+=A0=A0=A0= =A0=A0=A0 (substring-no-properties var)))))=0A=A0=0A=A0(defun org-babel-pyt= hon-table-or-string (results)=0A=A0=A0 "Convert RESULTS into an appropriate= elisp=0A value.=0A=0A=0Avs=0A=0A=0Ahttp://lists.gnu.org/archive/html/emacs= -orgmode/2014-01/msg00286.html=0Adiff --git a/lisp/ob-python.el b/lisp/ob-p= ython.el=0Aindex 1457682..baa5764 100644=0A--- a/lisp/ob-python.el=0A+++ b/= lisp/ob-python.el=0A@@ -137,7 +137,7 @@ specifying a variable of the same v= alue."=0A=A0=A0=A0=A0=A0=A0=A0 org-babel-python-hline-to=0A=A0=A0=A0=A0=A0= =A0 (format=0A=0A(if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%= S\"\"" "%S")=0A=0A-=A0=A0=A0=A0=A0=A0 var))))=0A+=A0=A0=A0=A0=A0=A0 (if (st= ringp var) (substring-no-properties var) var)))))=0A=0A=A0(defun org-babel-= python-table-or-string (results)=0A=A0=A0 "Convert RESULTS into an appropri= ate elisp value.=0A=0A=0AMiguel. ---1953309981-1056767261-1390394500=:74076 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable

<= div style=3D"font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, = Lucida Grande, sans-serif; font-size: 12pt;">
Could it be a poorly rewritten patch? Original Daniel Gerber's pr= oposal works for me.


diff --git a/lisp/ob-python.el b/lisp/ob-python.el
inde= x 1457682..523fd70 100644 (file)
--- a/lisp/ob-python.el<= br clear=3D"none">+++ b/lisp/ob-python.el
@@ -137,7 +137,= 7 @@ specifying a variable of the same value."
    &nb= sp;   org-babel-python-hline-to
  &nb= sp;    (format
    &nb= sp;   (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S= \"\"" "%S")
-       var))))=
+       (substring-no-prop= erties var)))))
 
 (defun org= -babel-python-table-or-string (results)
   "Con= vert RESULTS into an appropriate elisp=0A value.


vs


http://lists.gnu.org/archive/html/emacs-orgmode/2014-01/msg00= 286.html
diff --git a/lisp/ob-python.el b/lisp/ob-python.= el
index 1457682..baa5764 100644
--- a/= lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -137,7 +137,7 @@ specifying a variable of the same value."
        org-babel-python-hline= -to
       (format

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

-  =      var))))
+    = ;   (if (stringp var) (substring-no-properties var) var)))))

 (defun org-babel-python-table-or-string (results)
   = "Convert RESULTS into an appropriate elisp value.


Miguel.
=



=
---1953309981-1056767261-1390394500=:74076--