From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yPmgBlollWKRSQAAbAwnHQ (envelope-from ) for ; Mon, 30 May 2022 22:13:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YLKMBlollWIMrQAA9RJhRA (envelope-from ) for ; Mon, 30 May 2022 22:13:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 95E369353 for ; Mon, 30 May 2022 22:13:13 +0200 (CEST) Received: from localhost ([::1]:40136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvllI-0007mO-Ia for larch@yhetil.org; Mon, 30 May 2022 16:13:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvlQq-00028S-71 for emacs-orgmode@gnu.org; Mon, 30 May 2022 15:52:04 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvlQn-0001vk-Ty for emacs-orgmode@gnu.org; Mon, 30 May 2022 15:52:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id ECEEB240026 for ; Mon, 30 May 2022 21:51:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1653940318; bh=fEtBENoPylWmoGbtnlhAsMvXYEW5u9cNVh78cFehBnc=; h=Date:Subject:To:From:From; b=Plks1fFKcNui8rpsSNwMiN5el7Ka8ihNpR+HgFHEZYEdYke7qFqZRGiYgEdIjJBoB wIzUKqrq2orQF3tbIQ0hOW55+iStYmq7Qbqke61oH/t0LB7qApOlbi98wOcUq7zLfD 73hryHyqEwo2L6yUSMTPBcX+n0eXgRIWYUEhanXlzAhFLBKUs70IvGXhhE1dLS4PIn L+oMXGBs4r891nEtrUg+NWrvQsHdQt6K9vdGQqlfpTiIxGDAMUZJE/WkbUsTh6AymU pj3VZyWeHfdYdAuU9Ya4JZGnekb0/7YipXZb24xlpOcg6YG5kGh1OntogVBA7Bi1bd Dl+lVuyU3QNHQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LBmJY1RqQz9rxD; Mon, 30 May 2022 21:51:57 +0200 (CEST) Message-ID: <03eb4c66-ecaf-b5f5-c4cc-2195fb6c1a1a@posteo.eu> Date: Mon, 30 May 2022 19:51:56 +0000 MIME-Version: 1.0 Subject: Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments Content-Language: fr To: Ihor Radchenko , emacs-orgmode References: <2dd9630a-c584-0702-62aa-393ad56c621e@posteo.eu> <875ymt8goc.fsf@localhost> <87v8urt8bu.fsf@localhost> From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= In-Reply-To: <87v8urt8bu.fsf@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=sebastien.miquel@posteo.eu; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sebastien.miquel@posteo.eu Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653941593; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=I+ys2X6XuAY1AcawU9EgLZqipRXiZZw0eNy+b0MPXmU=; b=birTXMidFP6v3wK1wnYCUiE23irSdTs3wwz4PSRS4zHfPUNeDmsWbl6BdAZRn4dlV6XmQj fiWvgI8Eac473qJ04wowbkmqcpnheK5uSKPhGMaxtDc65TfcVPNn0HgGprUmKNYno3D6Qo GWTBfLMtI1+ZIpGVozfh22+IDt68iNhMFvdfvJx8szlvYsLO34MIZSKvMW4zYB8x81xXF+ 3zNrihMzU/lE4AtRgZc3zociY1+1DMvnRhelXCH2/GtuRa4K5lrV0PlqlA6fRlN4DXksJZ 3kIMlGTZvO41tl4DBd4OobwrPd8TRL4ce4AdZKFdRfclJ7/52Ok7ZQY+ngnB0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653941593; a=rsa-sha256; cv=none; b=YUKTJS6LURhWuw2wNNaE2vQp1xb7gcexC7YAv/azFZZ48dhc9R+JQN3QxXRNaD0F6AtuaR P00ctbc6rtU6B87FFWTfhseUSYvTM78VmAOfu3HuzGE+AF6q5mOL5pOfa/IFIp/KHGNoPx L9o7uKkyLBs/nIADFS/aOK8Yfp5gn1jKSDxaeoL3+dmrTrm3MxsuWpzTfVoTTWfu/g+zps Z/4CoDXK4QHcnYP06bQ2o8z4u6mUtD69oj/asLBK7rmUeNFM/vVmMpM904LYguEA/Uu/qW wecm4oPenM4Kmke0+pJ7SoXkkquCm4vkuLbwY1Vjs67i0emd5IsNMPlqI5dR/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=Plks1fFK; dmarc=pass (policy=none) header.from=posteo.eu; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=Plks1fFK; dmarc=pass (policy=none) header.from=posteo.eu; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 95E369353 X-Spam-Score: -9.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: nYZwZMFczxHl Hi, Ihor Radchenko writes: > Thinking about the whole idea of :noweb-trans more, I see little benefit > compared to something like: > > #+name: documentation > This is a sample function documentation. > Because there are "quotes", it must be escaped and cannot be directly > used as noweb-reference. > > #+name: doc-escape > #+begin_src emacs-lisp :var str="" :tangle no > (prin1-to-string (string-trim-right str)) > #+end_src > > #+begin_src emacs-lisp :tangle yes > (defun test () > <> > t) > #+end_src I had converted my uses (tangling code, not text/documentation) to this but I ended up reverting. Some drawbacks:  + doesn't work for all languages (does work for LaTeX)  + the tangle gets very noisy: not only are the result of execution    printed in the echo buffer, but emacs visits the tangling buffer    and moves the point to each block.    Perhaps this is a bug that can be fixed.  + src block execution also resets the noweb cache, slowing down    tangle, though I have not tried to measure the effect. As stated in the OP, I find it unfortunate that org does not provide any way to tangle the content of a src block to a string representing this code. If anyone shows any interest, I've provided two possible implementations in this thread, that I can rebase. Regards, -- Sébastien Miquel