From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Nikishkin Subject: :noweb expansion happens before :prologue expansion. Why? Date: Wed, 21 Aug 2019 13:50:51 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60231) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0JWU-00041S-8k for emacs-orgmode@gnu.org; Wed, 21 Aug 2019 01:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0JWT-0005i5-9I for emacs-orgmode@gnu.org; Wed, 21 Aug 2019 01:51:06 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:38359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0JWT-0005hO-1S for emacs-orgmode@gnu.org; Wed, 21 Aug 2019 01:51:05 -0400 Received: by mail-ed1-x530.google.com with SMTP id r12so1500101edo.5 for ; Tue, 20 Aug 2019 22:51:04 -0700 (PDT) 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" To: emacs-orgmode@gnu.org Hello, everyone I wanted to do the following #+name: common #+begin_src scheme (display "Common header\n") #+end_src #+begin_src scheme :noweb yes :prologue "<>" (display "particular block") #+end_src This fails, because :prologue is language-specific, and is expanded later than :noweb, so I am getting <> in my code rather than the expansion. Why? Only four language modules care to implement :prologue (R, scheme, maxima, gnuplot) , and all of them do it by just concatenating it with the rest of the code, and as a result the wonderful possibility of attaching common headers to blocks is greatly reduced, since they are not expanded at all. Would it make more sense to expand the :prologue and :epilogue _before_ :noweb rather than after and do it in a uniform way (that is, simply concatenate)? I am ready to make a patch, as long as it won't be rejected. -- Yours sincerely, Vladimir Nikishkin