From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: passing the contents of a block as an escaped string Date: Thu, 26 Jun 2014 09:27:09 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X045d-0001tg-LM for emacs-orgmode@gnu.org; Thu, 26 Jun 2014 03:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X045X-00056u-JF for emacs-orgmode@gnu.org; Thu, 26 Jun 2014 03:27:25 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:5906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X045X-00056h-Cv for emacs-orgmode@gnu.org; Thu, 26 Jun 2014 03:27:19 -0400 In-Reply-To: (Charles Berry's message of "Tue, 24 Jun 2014 16:37:23 +0000 (UTC)") 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: Charles Berry Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Charles, On 2014-06-24 18:37, Charles Berry writes: > ,---- > | #+NAME: prin-block > | #+BEGIN_SRC emacs-lisp :var a=3D"abc"=20 > | (defun foo (blk)=20 > | (save-excursion > | (org-babel-goto-named-src-block blk) > | (nth 1 (org-babel-get-src-block-info 'light)))) > |=20 > | #+END_SRC > |=20 > | #+NAME: weird-text > | #+BEGIN_SRC python > | just some plain text; > |=20 > | \\ a double slash > |=20 > | escape eol \n > |=20=20=20 > | OK?? > | #+END_SRC > |=20 > |=20 > | #+BEGIN_SRC python :var a=3D(foo "weird-text") :results output > | print(a); > | #+END_SRC > |=20 > | #+RESULTS: > | : just some plain text; > | :=20 > | : \\ a double slash > | :=20 > | : escape eol \n > | :=20 > | : OK?? > |=20 > | #+header: :var a=3D(prin1-to-string (foo "weird-text"))=20 > | #+BEGIN_SRC python :results output > | print(a); > | #+END_SRC > |=20 > | #+RESULTS: > | : "just some plain text; > | :=20 > | : \\\\ a double slash > | :=20 > | : escape eol \\n > | :=20 > | : OK??" > `---- Thanks a lot, it works great. I'm now having utf-8, orgmode, and python problems that I'll explore in another thread. Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJTq8tUAAoJEAQNCjtO0uXHouIIALwKvrcqL1549AM1LFxoe32Z qByEUtlHr0DK/y51IEkGmC/apbu6Dz7TWlHR0g0XmMoN5RcdDuJUrx+IiKn7Ux8j LZZVzq9YzV5Yuh0MzRmLCfvuedrH0akH+0cW5XltGHckZe0b7g1GTn8ZptYgm2ZN 7LECZYc8C5D4lwsH6ln5K0fn5z977lutGytAtGt6rPop3w9m3MxUjLsBjzM9NDME JoSn4YO9FMffBectD/I9FabfAtv3SUczZB4eVw4G/llox/UTpVh7Y7VWZWY3B1Lm d8TgWhj9Fgc8qfEAV+5gH/DZbC1+izlrEvEx2UABqi4FjYZZcG3LAl9UptWAEqw= =DWYN -----END PGP SIGNATURE----- --=-=-=--