From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [ANN] BREAKING CHANGE -- removing #+BABEL file-wide property lines Date: Fri, 21 Oct 2011 14:09:44 -0400 Message-ID: <6106.1319220584@alphaville.americas.hpqcorp.net> References: <87pqhrih3s.fsf@gmail.com> <30891.1319141196@alphaville.dokosmarshall.org> <87fwinifqu.fsf@gmail.com> <32184.1319143892@alphaville.dokosmarshall.org> <87zkgvgxe7.fsf@gmail.com> <1405.1319147324@alphaville.dokosmarshall.org> <87zkgvfhra.fsf@gmail.com> <2127.1319148505@alphaville.dokosmarshall.org> <87vcrjfgt1.fsf@gmail.com> <80sjmmvm60.fsf@somewhere.org> <4EA129DB.4070006@christianmoe.com> <8762ji5jr6.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHJdK-00073a-TD for emacs-orgmode@gnu.org; Fri, 21 Oct 2011 14:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHJdG-0006rw-CG for emacs-orgmode@gnu.org; Fri, 21 Oct 2011 14:15:54 -0400 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:47273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHJdF-0006pe-Tk for emacs-orgmode@gnu.org; Fri, 21 Oct 2011 14:15:50 -0400 In-Reply-To: Message from Eric Schulte of "Fri, 21 Oct 2011 11:37:01 MDT." <8762ji5jr6.fsf@gmail.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: Eric Schulte Cc: Sebastien Vauban , nicholas.dokos@hp.com, emacs-orgmode@gnu.org, mail@christianmoe.com Eric Schulte wrote: > > > > 2. Allowing you to pass multiple buffer-wide arguments with :var. This > > could make a substantive difference in some applications. The > > following will work: > > > > #+BABEL: :var euro=1.3791 :var salestax=.15 > > > > The following will not, since it tries to set the same property: > > > > #+PROPERTY: var euro=1.3791 > > #+PROPERTY: var salestax=.15 > > > > If BABEL is dropped for PROPERTY, it would be good for the :var: > > property to support multiple arguments (comma-separated would be good > > for consistency with passing arguments through the SRCNAME). E.g.: > > > > #+PROPERTY: var euro=1.3791, salestax=.15 > > > > I think I'd like this better in any case. > > > > Nice idea. This same issue with "var" arose when we first started > allowing header arguments to be specified inside subtree properties. > I've just implemented your suggestion so the following are now possible. > > #+PROPERTY: var foo=1, bar=2 > #+PROPERTY: cache yes > #+begin_src emacs-lisp > (+ foo bar) > #+end_src > > #+results[be32e67491d4e92f75769aebe423c20ca01626fe]: > : 3 > > and > > #+begin_src emacs-lisp :var foo="this", bar="that" > (concat foo " " bar) > #+end_src > > #+results[3cde077efa81f1ca24a62ac264dbd5776b6e0054]: > : this that > > Thanks for the suggestion and I hope the above is a sufficient > replacement for the now-missing #+BABEL: syntax. > Just to clarify my understanding: on a #+PROPERTY line, you *have* to say #+PROPERTY: var a=1, b=2 but in the code block itself, you can say *either* #+begin_src emacs-lisp :var a=1, b=2 ... *or* #+begin_src emacs-lisp :var a=1 :var b=2 ... Experimentally, both of these currently work: do you have any plans to outlaw the last form? Also, how does the comma-separated list of variable assignments interact with a language where comma has syntactic significance? I was primarily thinking of python where e.g. a=[1,2,3] or a=(1,2) is a legal construct. AFAICT, that never worked in babel[fn:1], so it may not matter much, but it may be a good idea to come up with a quoting mechanism so things like that can be added in the future if necessary. Thanks, Nick Footnotes: [fn:1] I checked in 7.7 to avoid the recent churn with the following code block #+begin_src python :var a='(1,2)' len(a) #+end_src and I get ,---- | File "", line 3 | a=[1, [\,, 2]] | ^ | SyntaxError: unexpected character after line continuation character `---- in the org babel error output buffer.