From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: two sets of default header arguments for one language Date: Fri, 11 Sep 2015 18:27:12 +0200 Message-ID: <87oah8vs4f.fsf@nicolasgoaziou.fr> References: <5043E6AE-A82F-4F2A-8486-7826BA466703@gmail.com> <87r3m6q85a.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaR8r-000079-SM for emacs-orgmode@gnu.org; Fri, 11 Sep 2015 12:25:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaR8q-0005Iu-D8 for emacs-orgmode@gnu.org; Fri, 11 Sep 2015 12:25:37 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:47812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaR8q-0005IZ-51 for emacs-orgmode@gnu.org; Fri, 11 Sep 2015 12:25:36 -0400 In-Reply-To: (Rainer M. Krug's message of "Fri, 11 Sep 2015 09:09:01 +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: Rainer M Krug Cc: Alan Schmitt , emacs-orgmode , Rainer M Krug 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. Regards,