Rainer M Krug <rai...@krugs.de> 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. Regards,