From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Seeking advice for conditional code Date: Thu, 31 Jan 2013 22:03:44 +0100 Message-ID: <86halx3w0f.fsf@somewhere.org> References: <86lib96zzl.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Fran=C3=A7ois, Fran=C3=A7ois Pinard wrote: > Would someone be kind enough to point me in the right direction, if > there is one already? My need is to have conditional code at > publication time, and being able to include or exclude regions of code > according to some symbol being "active" or "defined", or not. I want to be sure to understand: do you need - conditional tangled code, or - conditional "full" document (containing conditional code and conditional doc)? When you say "conditional", do you mean to to be able to decide to include = it or not, or even more (such as including one version or the other)? What's sure if that you can have conditions based on tags, and things in the following spirit:: --8<---------------cut here---------------start------------->8--- * Global constants #+tblname: params | Variable | dev | stg | prd | |--------------------+-----+-----+-----| | webServerName | a | g | m | | loginWebServerName | b | h | n | | pwWebServerName | c | i | o | | appBaseDir | d | j | p | | dbName | e | k | q | | dbBackupFile | f | l | r | * Show the params :d= ev: Params are "dynamically" assigned. Here the results with the "dev" tag: #+begin_src sh :rownames no :var data=3D(concat (car (org-get-tags-at (poin= t))) "-params") :exports both echo $data #+end_src --8<---------------cut here---------------end--------------->8--- Please tell if that's more or less the direction you want to take... Best regards, Seb --=20 Sebastien Vauban