From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BABEL] "unset" :var definitions for subtree Date: Sun, 13 Feb 2011 11:33:35 -0700 Message-ID: <87d3mvrdg6.fsf@gmail.com> References: <4D500BEC.1080300@gmail.com> <87bp2koeir.fsf@gmail.com> <4D53A2D2.2080300@gmail.com> <87r5bfn8dg.fsf@gmail.com> <87bp2imzb7.fsf@gmail.com> <87zkq03ky3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=54703 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pogm8-00046h-6N for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 13:34:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pogm6-0003UT-Me for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 13:34:24 -0500 Received: from mail-pv0-f169.google.com ([74.125.83.169]:38814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pogm6-0003Sm-Bq for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 13:34:22 -0500 Received: by mail-pv0-f169.google.com with SMTP id 30so932319pvc.0 for ; Sun, 13 Feb 2011 10:34:21 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: emacs-orgmode , Rainer M Krug Dan Davison writes: > "Eric Schulte" writes: > >> [...] >>> >>> I agree, the things I was talking about don't end up being simpler in >>> terms of usage for this case. My thinking was that variable unsetting >>> might be something that would be required fairly rarely, and so it might >>> be worth appropriate to support it as part of a more general/powerful >>> mechanism tied into Org properties, or even that hook. >>> >> >> It does sound like if there were a way to disable inheritance for >> certain properties for certain sub-trees of a document, then that would >> be ideal -- although I can't imagine how such functionality would be >> implemented. Can we think of an Org-wide syntax for disinheriting >> specific properties? > > I'm not sure whether or how this fits it, but it's worth noting that Org > currently documents the following > > ,---- > | org-entry-get-with-inheritance is a Lisp function in `org.el'. > | > | (org-entry-get-with-inheritance PROPERTY &optional LITERAL-NIL) > | > | Get entry property, and search higher levels if not present. > | The search will stop at the first ancestor which has the property defined. > | If the value found is "nil", return nil to show that the property > | should be considered as undefined (this is the meaning of nil here). > | However, if LITERAL-NIL is set, return the string value "nil" instead. > `---- > > so that seems to suggest ":var nil" as a way of knocking out all :var > assignments, but doesn't immediately suggest how to knock out on a > per-variable basis. :var a=nil ? (Which otherwise would look for a src > block named "nil") > But then (I believe) once we implement the multiple inheritance mentioned in your other thread this would no longer work. > >>> Before we proceed with the variable unsetting, could someone provide a >>> motivating example, just to convince ourselves that the extra features >>> are justified? (The conclusion of another message was that the torque >>> script example was more a motivating example for shebang/preamble >>> processing than for variable unsetting.) >>> >> >> Certainly. >> >> 1. taking Rainer's first example, lets say that you want a variable >> specified for all but one code block in a file (maybe that one code >> block is the source of the value of the variable). In this case it >> would be much simpler to specify the variable file-wide, and then >> unset the variable for that one code block. > > Agreed. It's not clean, but currently in this situation one could just > set the offending variable to some other value. > >> 2. say you want the same session for /nearly/ every code block in a >> file. >> 3. same for :dir, :file, or :shebang... > > I'd just note that some of these already have natural values that can be > used to "unset" > > :session none > :dir . > :shebang "" > > :file > So the question seems to be, do we pick some /magic/ values for :var and :file, similar to "none" for sessions, or do we unify this unsetting behavior into a single magic value that can be used to unset any header argument. The later seems cleaner to me. Best -- Eric