From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6NuZHxHSbGLAcgEAbAwnHQ (envelope-from ) for ; Sat, 30 Apr 2022 08:07:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mCjAHxHSbGI2TAAAauVa8A (envelope-from ) for ; Sat, 30 Apr 2022 08:07:13 +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 2802F12F6B for ; Sat, 30 Apr 2022 08:07:13 +0200 (CEST) Received: from localhost ([::1]:34226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkgG8-0000jX-7L for larch@yhetil.org; Sat, 30 Apr 2022 02:07:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkgDX-0000ht-MX for emacs-orgmode@gnu.org; Sat, 30 Apr 2022 02:04:37 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:53909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkgDU-0002Ol-DZ for emacs-orgmode@gnu.org; Sat, 30 Apr 2022 02:04:30 -0400 Received: by mail-pj1-x1036.google.com with SMTP id o69so7390867pjo.3 for ; Fri, 29 Apr 2022 23:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=+vMn1h3hzCeZpjcx1yUIFk7hgDXb5Q6l78/FUk7j9fY=; b=EdiLExPooGF1+ZBLaW0IXGo01h30A5l8m782ybeQcoa/ywMhcyvl4SGJgP8sMwrgtu Tz47DTvbUdJm8CI1KtrDrVNl/UwdE0GEKsyPsSGm93hMpy9+hQwxbPBdD8grGr8Sk/IX fF4rlgkGJF5BPuQiXn2egm58CO9CpRFaO0IXb+L9x3ZYusGGzln3uyxXCBHJLAYSOOgl WQOi/aapqfFVQKacutGrfmfv95EEcaM1wQ6e0/dZ9mVsflMZM6buTFJBflod0EqmOqsM rsuVA7qJJAw0Z+9dPHtNwWsaNrcX8NgE1T+0l2cEPJEGv4IFfZyaeUaIet/QRWmt9UrN oVVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=+vMn1h3hzCeZpjcx1yUIFk7hgDXb5Q6l78/FUk7j9fY=; b=P7UKjnGGdLrIFS9ZN8HjwwcNebQ/QjfAFWShLChHo19WTDn9DD92LvviZTWV7B1Eib 6l6QuELUb9iQ0sqyENZdInQQ2i5GVOifIbD8YtXhaQ4oyY0BZ3pl/NcEeqlRwOA58T3d XkCl7vlljULSSHn13NHQPrhZ71vlglrITdGl55/A1yRKlxam6fIsHDAsVa6BaZlBlJ44 RNPXQWQQMltRRKbD5/6AJ0aCe2N43AIoNjjAdSPvY4x0U91yUAvbQ2hH3vdf81LRBAPp nFgQlwmoPfKTp7qjCSEUXXN7vqcADmrn9GwMcZEg7obUNuri1JzuXOWKHkrj5FonnkKp TStw== X-Gm-Message-State: AOAM5326vkbu6l8QpOLNxCfzHyLz1fHYae1p9KRYwpx5CIh3t4IE38ee /2CpYi+zlOLODtQxWOsuOeWQs2P7SZDXew== X-Google-Smtp-Source: ABdhPJyC/JUFwhZnqghVpNTy2H1gwhw5Y1chJMB0JZnUe7BHozfSyP3hvWY3zAMyET7H7y/mf3SfXA== X-Received: by 2002:a17:902:e886:b0:15e:8ba0:b749 with SMTP id w6-20020a170902e88600b0015e8ba0b749mr2493129plg.95.1651298667050; Fri, 29 Apr 2022 23:04:27 -0700 (PDT) Received: from localhost ([45.83.130.130]) by smtp.gmail.com with ESMTPSA id e9-20020a17090ab38900b001cd4989fecdsm15622065pjr.25.2022.04.29.23.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 23:04:26 -0700 (PDT) From: Ihor Radchenko To: sebastien.miquel@posteo.eu Subject: Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments In-Reply-To: References: <2dd9630a-c584-0702-62aa-393ad56c621e@posteo.eu> <875ymt8goc.fsf@localhost> Date: Sat, 30 Apr 2022 14:05:09 +0800 Message-ID: <87v8urt8bu.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Cc: emacs-orgmode 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=1651298833; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=+vMn1h3hzCeZpjcx1yUIFk7hgDXb5Q6l78/FUk7j9fY=; b=ZzlqgaXW9z1pqxnxVS+fsfSoOQ5zG+d5GYuUi1rIrnR4IIrzNCrjWARSiA8weLe6hDX8zg 6PJcGQtxVeD4WjRxKA6NmnbCAVncPJzoNPBONpRBYS/ISgoU0RVAL4LbBuqmDV+dLRLxDc spmbnltghARf6KeJ3gDq4RMox4skwQYhmZh8J/hMDQDCoduy3jNUVbvjIhavoVK68LOjG9 rv9RV6b9yzWgMFWJqgmXykX7MNlD8ndYZAdO0O1HXVYs4UfjgpVHyxHf9u4vqGmtgi2gy5 La/ACoJI07mrqznAerIcgho+4uhTHX3PhX3vH3Of+YY2DjKhHbaIj2KYlbxbUg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651298833; a=rsa-sha256; cv=none; b=RKeffOX7OpxWh0PHWf9jsIOSlr9ovsTDTXeheseZHBBi0FgO8kzbf8rZAUL4MIg5CLC5hU +S8HBASLI68vkl4Owg3yM8uo9LjtdAeEJYGx6j8rcr5lcnWdUbZN6x21suRD8R9QRwwiTT vX1tCIoskB+trlThP79taxCYDTQk5AcmOp3n0fPtuGyDW7KdRVLKZhFrPYMvoKGUqfKUIF xJ2oTxfY4sVFhdYDXYFFqkfek783e/HonGdugPt/Plvo3pX1W3M5dSKmYcLdD7wR8R79Az dg2PoU6z0GM2uZKFyPowEIz3YnLR7+oWs+LDlUX9Nl+ZAoipd3RcepkprxJlXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EdiLExPo; dmarc=pass (policy=none) header.from=gmail.com; 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: -3.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EdiLExPo; dmarc=pass (policy=none) header.from=gmail.com; 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: 2802F12F6B X-Spam-Score: -3.49 X-Migadu-Scanner: scn1.migadu.com X-TUID: wHVDsqsVXS++ S=C3=A9bastien Miquel writes: > at least as long as you're tangling to a programming language, that > can read lisp strings. >> Consider the following example: >> >> #+BEGIN_SRC emacs-lisp :noweb yes :tangle yes :noweb-prefix no :noweb-tr= ans prin1-to-string >> <> >> (setq latex-header <>) >> #+END_SRC >> >> There are two noweb references here. Setting source block-wide >> :noweb-trans is not helpful because the first reference will be >> incorrectly filtered through prin1-to-string. > Indeed. Originally I had thought of adding a new syntax <<"nw">> to > insert a string representation. I've attached a new patch, that does > this instead of introducing :noweb-trans. Now that I think of the > universality of prin1-to-string, I actually like it slightly better > than :noweb-trans. It would break existing "nw"-like noweb references. This is too specific, as for me. 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=3D"" :tangle no (prin1-to-string (string-trim-right str)) #+end_src #+begin_src emacs-lisp :tangle yes (defun test () <> t) #+end_src Maybe we can instead distribute a library ob babel file containing useful functions together with Org. >>> [...] >> This sounds a bit confusing. I would also add an example where it is >> useful to set :noweb-prefix to no. > > I've added such an example in the revised patch attached. Other than :noweb-trans, the patch looks good for me. Best, Ihor