From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: [PATCH] ob-shell Date: Mon, 23 Jun 2014 19:20:59 +0200 Message-ID: <87fvivczk4.fsf@Rainer.invalid> References: <86vbsycepz.fsf@somewhere.org> <87tx8iks22.fsf@bzg.ath.cx> <86ppi6qnb5.fsf@somewhere.org> <87vbrxx4zr.fsf@Rainer.invalid> <86ppi5uwgl.fsf@somewhere.org> <877g4cacn9.fsf@Rainer.invalid> <87vbrt8hpo.fsf_-_@Rainer.invalid> <87ha3ck9as.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz7vj-0002ks-SL for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 13:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz7vd-0007qn-HS for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 13:21:19 -0400 Received: from plane.gmane.org ([80.91.229.3]:44372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz7vd-0007qh-Ae for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 13:21:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wz7vb-0007GE-RF for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 19:21:11 +0200 Received: from pd9eb2333.dip0.t-ipconnect.de ([217.235.35.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Jun 2014 19:21:11 +0200 Received: from Stromeko by pd9eb2333.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Jun 2014 19:21:11 +0200 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 Pascal Fleury writes: > I was wondering how it would behave if the string that is put into a > variable contains newlines, backslashes and other things that bash > (and other shells) treats specially. Exactly like it does with the earlier method, except it doesn't fork and doesn't require certain versions of bash. > The trick with cat and BABEL_TABLE is resistant to this. I don't think so, some older versions of bash had a parsing bug that made it croak on single quotes in here documents. Single quoting the variable content only reuires special handling of single quotes. While that is tedious and error prone to do by hand, we're doing it with elisp anyway so this doesn't pose a problem. Also, it works for just about any shell, not only those that know about $( ) command substitution and implement here documents within the substitution correctly. > As in many cases (when I use it at least) the variable come from other > parts of the org file and are computed through another language > (python in my case) I have such cases that would break. If you have an example, please show it. > Also, I think the test coverage for such things is limited for > ob-shell.el in the org test suite. > We should probably add some test cases for this, and then make sure it > works with your implementation as well. By all means, please add such tests. While you're at it, you might want to double quote the variable expansions, which will show you that the shell is wholly capable of returning a list and even a table to Org, with or without associative arrays. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Samples for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra