From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: two sets of default header arguments for one language Date: Fri, 18 Sep 2015 12:17:03 +0200 Message-ID: References: <5043E6AE-A82F-4F2A-8486-7826BA466703@gmail.com> <87r3m6q85a.fsf@nicolasgoaziou.fr> <87oah8vs4f.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcsjF-00039q-A5 for emacs-orgmode@gnu.org; Fri, 18 Sep 2015 06:17:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcsjB-0000FG-9K for emacs-orgmode@gnu.org; Fri, 18 Sep 2015 06:17:17 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcsjB-0000Ew-1M for emacs-orgmode@gnu.org; Fri, 18 Sep 2015 06:17:13 -0400 Received: by wiclk2 with SMTP id lk2so24684682wic.1 for ; Fri, 18 Sep 2015 03:17:12 -0700 (PDT) In-Reply-To: <87oah8vs4f.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 11 Sep 2015 18:27:12 +0200") 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: Nicolas Goaziou Cc: Alan Schmitt , emacs-orgmode --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nicolas Goaziou writes: > Rainer M Krug writes: > >> That's a pity. >> >> It would be really great if one could define different sets of >> hearer-args and then, at thr beginning of a code block, simply use: >> >> #+MACRO: forTangle :tangle ./test.R :export none >> #+MACRO: forExecution :tangle no :export both :session Test14 >> #+MACRO: forNoSession :tangle no :export both > > It might be great. Probably hackish too. > > Anyway simplicity of macros is one of its features, IMO. They are > limited, yet useful for simple things. > > Fortunately, there are other ways to achieve what you want without them. > >> Would it be difficult to include this feature? > > Probably not. The most permissive model for macros is even simpler to > implement than the current one, i.e., something like > > (replace-regexp-in-string macro-regexp macro-template buffer) > > However macros actually follow a different paradigm, in which they are > required to be parsed. As a consequence they cannot really break the > structure of their container, which turns them into "safe" tools. For > example, you can compare the model above and the current one in the > following document > > A paragraph Paragraph{{{this(arg > #+name: table > | cell | )}}} | > > Your proposal in to allow them where the parser doesn't look, e.g., > Babel header arguments, but probably also other places (node properties, > keywords...). It is difficult to draw a line. In any case, I'm not sure > macros would benefit from it. Babel can already do a lot of > destructuring in a document, not every tool needs to be as versatile as > Babel. Thanks for your explanations - I am not using macros regularly (not yet...) so I was not aware of these aspects. I was just using macros as an example - I am not advocating to change macros if this would change something. A simpler option would be possibly to use properties. Assuming I have the following properties define= d: ,---- | #+PROPERTY: headerArgsForTangline :tangle ./testfile.R | #+PROPERTY: headerArgsForSession :tangle no :session *MyRSession* | #+PROPERTY: headerArgsForNoSession :tangle no `---- then I could do ,---- | :header-args*: headerArgsForSession=20 `---- and the header arguments would be set to the value of headerArgsForSession and be ":tangle no :session *MyRSession*". This would make it possible to define sets of header arguments for certain aspects (one example I would use it for: creating graphs and define the width and height properties. Depending if I want portrait or landscape graphs, I would use the one or the other property and they could be ca=3Dhanged easily for the whole document.) Cheers, Rainer > > =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJV++SjAAoJENvXNx4PUvmCQpYH+gLtGsu3XIOZ3bla9A1SOE17 0Iny8W4V8mxZNj4iWZX6at9kRCYEIOrBdFCQ4JMhK5gTjS4HxiXNds8hnz+rj1DD 3I5NACRnubolcNPZexIBkh3FN3dNulABZ4XDOi4VRBgXdwBWcNMn/i04Y4a+cp4X wIhApB8iCkiC1XEu5B/ZpLJY/YXSyM+01lBT5tiRlYLup+qd+rI9ATVk3GxSCBUF JnXfRPGYiHiLki+4ie9OrXbEpHAgZlwFHHTkuMK0xpH/hYcj41WhYnOZsoZNGdGS FKzDw0Sr811MTEer3f2WGE0zb0sVKmB5UI7/fOSQeHxRih1EN2cUzS7uj7Ww2AE= =XLJM -----END PGP SIGNATURE----- --=-=-=--