From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Fran=C3=A7ois_Pinard?= Subject: Re: Seeking advice for conditional code Date: Thu, 31 Jan 2013 17:09:25 -0500 Message-ID: <868v796m3u.fsf@iro.umontreal.ca> References: <86lib96zzl.fsf@iro.umontreal.ca> <86halx3w0f.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U12K2-0004yT-Hd for emacs-orgmode@gnu.org; Thu, 31 Jan 2013 17:09:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U12Jy-0005Vd-L6 for emacs-orgmode@gnu.org; Thu, 31 Jan 2013 17:09:30 -0500 Received: from bureau.ubity.com ([64.254.249.42]:36383 helo=mercure.bureau.ubity.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U12Jy-0005VR-Hf for emacs-orgmode@gnu.org; Thu, 31 Jan 2013 17:09:26 -0500 In-Reply-To: <86halx3w0f.fsf@somewhere.org> (Sebastien Vauban's message of "Thu, 31 Jan 2013 22:03:44 +0100") 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 "Sebastien Vauban" writes: > Hi Fran=C3=A7ois, Hi, Sebastien! :-) > Please tell if that's more or less the direction you want to take... Direction already taken, and completed a few minutes ago! :-). But I'll happily revert to something else it if there is a better way to proceed. The addition of pseudo-Org directives does not really please me, I would prefer plain Org if possible. If you are curious, see comments at start of https://github.com/pinard/poporg/blob/master/extradoc.py. In my application, I even define context from the Makefile, which is an unexpected advantage. > 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 includ= e it > or not, or even more (such as including one version or the other)? Exactly! :-) It's not tangling. Rather, merely extract the documentation out of comments found in (program) source code. The comments (once removed the hash marks) are in Org format. I'm seeking for conditional documentation. > What's sure if that you can have conditions based on tags, and things in = the > following spirit:: > * Show the params = :dev: > 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 (po= int))) "-params") :exports both > echo $data > #+end_src I should have thought at exploring the usage of Org tags. :export: and :noexport: are already very useful, but the idea did not come to me that I could extend this to other tags. I probably do not use tags enough! In any case, the example above is quite interesting, and could be useful to solve other problems. I'll keep it around. > #+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 | I missed the point of this table however, I presume the "dev" column is to be linked in some way to the ":dev:" tag, but I do not see why/how. > Best regards, Thanks for caring, Sebastien! I feel all warm inside :-). Fran=C3=A7ois