From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BABEL] "unset" :var definitions for subtree Date: Wed, 09 Feb 2011 18:27:38 -0700 Message-ID: <87bp2koeir.fsf@gmail.com> References: <4D500BEC.1080300@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=50443 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnLUD-0000pC-03 for emacs-orgmode@gnu.org; Wed, 09 Feb 2011 20:38:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnLU9-0008Ku-3z for emacs-orgmode@gnu.org; Wed, 09 Feb 2011 20:38:18 -0500 Received: from mail-gx0-f169.google.com ([209.85.161.169]:55353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnLU8-0008Kp-V4 for emacs-orgmode@gnu.org; Wed, 09 Feb 2011 20:38:17 -0500 Received: by gxk5 with SMTP id 5so400406gxk.0 for ; Wed, 09 Feb 2011 17:38:16 -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: Rainer M Krug Cc: emacs-orgmode Rainer M Krug writes: > Hi > > For one project, I am usinr org to write submit scripte to a cluster > runing torqu. The important bit in this is, that between the shebang and > the code, no other executable line must occur. As I am using variables > in org (:var) they will occur just after the shebang, which causes a > problem for torque. So, my question is, is there a way to "unset" > variables defined by using :var for a subtree? > Hi Rainer, Interesting question... unfortunately I don't think that removing variables from header arguments is possible under the current setup. Perhaps in your case you could add a function to the post-tangle hook, which recognizes when it is being called in a just-tangled torqu script (maybe by searching for a series of #PBS lines), and then removes any lines between the shebang and the first #PBS line? More generally, I wonder what a natural method would be to allow unsetting of pre-set header arguments for local blocks or subtrees? This may only apply to the :var header argument, as most others have a default setting which can be actively set. If you have any ideas for a natural syntax for such an operation I'd be happy to hear it. Cheers -- Eric > > #+BABEL: :session *R* :results output :exports both :tangle > Analysis_sensitivity.R :var RESULTSDIR="/media/Results/" :var > ANALYSISDIR="~/Documents/Projects/analysis/" > > > * submit script (SA.sub) > :PROPERTIES: > :tangle: ./SA.sub > :exports: code > :END: > #+begin_src sh > #PBS -j y > #PBS -M Rainer@krugs.de > #PBS -V > #PBS -l nodes=1:mem=4gb > ## > cd $PBS_O_WORKDIR > #+end_src > > I would need the tangled code to be : > > #!/bin/bash > #PBS -j y > #PBS -M Rainer@krugs.de > #PBS -V > #PBS -l nodes=1:mem=4gb > ## > cd $PBS_O_WORKDIR > > But it is > > #!/bin/bash > RESULTSDIR=/media/Results/ > ANALYSISDIR=~/Documents/Projects/analysis/ > #PBS -j y > #PBS -M Rainer@krugs.de > #PBS -V > #PBS -l nodes=1:mem=4gb > ## > cd $PBS_O_WORKDIR > > > But RESULTSDIR and ANALYSISDIR is used in the remainder of the document > (several other subtrees) > > Any help appreciated, > > Rainer