From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iAfACgDzjmCQaAEAgWs5BA (envelope-from ) for ; Sun, 02 May 2021 20:44:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kNdGBgDzjmCTBAAAbx9fmQ (envelope-from ) for ; Sun, 02 May 2021 18:44:16 +0000 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 C84DD94CC for ; Sun, 2 May 2021 20:44:15 +0200 (CEST) Received: from localhost ([::1]:36070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldH4g-0001hu-RQ for larch@yhetil.org; Sun, 02 May 2021 14:44:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldGvN-0007yL-I2 for emacs-orgmode@gnu.org; Sun, 02 May 2021 14:34:37 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:44950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldGvL-0004s1-0s for emacs-orgmode@gnu.org; Sun, 02 May 2021 14:34:37 -0400 Received: by mail-wr1-x42b.google.com with SMTP id l13so1699048wru.11 for ; Sun, 02 May 2021 11:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aEzDes38VYA7il/7nGsgOXlwyYv7JXTxRXk+J+xBbaY=; b=ft85kW2O18x3VSLsNLxsQZmyaINeSPFmBI0zmcBLNDLE4AjutoewsUhHMT43lYnzl4 fDk2te67VVmCjy/FkK2SWcr19oI1ryQ/7RLDWH2qVdWe4H3v8hrgcjNYrGAwq/etjG44 2eVxgGl3hcfYfYI+7mhT9bczPKQwAxHZVS5UQplQswmEOmlrVg6zf0QreDSm/4nQszsR 2lxmuGHc/hfm5nXH5MljsXY7HgKOx+Wm0Q/8Em6Sj3CxJTCsr9za+Kl+L3vPvKa49bFC nNB9Zt+Z4BoZSrltbJSIxTpTymPDOK9Qnn3+zx3YmhV7ONqAX8NYUXxfl8FD7LbhJV29 Gp8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aEzDes38VYA7il/7nGsgOXlwyYv7JXTxRXk+J+xBbaY=; b=qVquTYJmTXxFzRkTbCsCZ3irZSSP09R3mBoFAQr5auUkG8d1mbeBUGKQBalrDO7VKO W84ehXlH1a76zjcnQlhg92fzZsBWdTUaOIwpjSztRHpUUc5eC0ILwXCL5iHPQW9uuySY tGNqOOQVNpqDLJm9lrtEtdrYSgGIfzcrJzHlJJvx56Y3Si+SB6XOnwsoW+CLmEJF30h9 0HMyI5dOJKZYIK3xj+rMW23SrZJ5Pd5MmlvSe4t+qTwnFRgM71cg0F0vkJBg8VUPK9Xe NwiTROA1mpaKMZSSvsfop136qmd6wZVynTQLIgArxd9SEs/dWAvWAPrZtlACo+m3/gJL UMHA== X-Gm-Message-State: AOAM532gzvv7nQNU0GdctwBCYkwC+fL4mEeiMT+dqijRFmUZ4nWHmHKY mJ1ej2hu1toMeCMgCULHN59pQ65tG8RchQRfmNg= X-Google-Smtp-Source: ABdhPJyn5SFKf1vSo9/4jvy90rKDxh992RE2/ql4EVJTpnPYbaBSfLRmLM5FehC3DqIQS2oEgl2Zj3cdkZbxNTPGw20= X-Received: by 2002:adf:fb07:: with SMTP id c7mr20521530wrr.88.1619980473465; Sun, 02 May 2021 11:34:33 -0700 (PDT) MIME-Version: 1.0 References: <82897e7d-f987-11f4-f7f5-fa1b8e462c0c@posteo.eu> <87fsz59fuk.fsf@gmail.com> In-Reply-To: <87fsz59fuk.fsf@gmail.com> From: Tom Gillespie Date: Sun, 2 May 2021 11:34:22 -0700 Message-ID: Subject: Re: [Feature request] String escaped noweb expansion To: Timothy Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sebastien.miquel@posteo.eu, emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619981055; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=aEzDes38VYA7il/7nGsgOXlwyYv7JXTxRXk+J+xBbaY=; b=JcwYLe95G7+oER04HUB18wrBXBeNjHnGztdbLRp3snZOy0YiVmbMJ6IxybsySrrqviP2Yv a/I9X6W6ij815opMVFY9iVBSaqPvaF96dW6ZR1vGpzy/pgM8kBDb04Sz0IeC3CECAFzuaq iy3BgWX+mbOtFmo1sPyLVP/T+42Y0e8JV7kbZTU/FdI1q0OzCiKRCWmKVy9l6LxGB2nb39 Y0ZgRsraFUxe5k5Magi3kzlmlv1WQ9M4BklE9UL4ouq/uXFjpxAyMhMtbwKnclNfz5g3i7 06xjXn9C+EZtiT9yLZwYjtUGwLvhUsZtUOpF/hPoOT17fQ7ZqVefvUO37XpF1A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619981055; a=rsa-sha256; cv=none; b=oox0ZntMcy8PmPwXbjCyxroTaar+WFekeSCK62q88hqBPle63lv6bigsKb1adnoe2ZNyXE dv9Tv4Woq73ZwQVfxsIcPFnvCVXEjk4e4rQzgRG6OsspuDTbdfb1heVZQqqEcDS1Q2JzYh j8XHGP9YnEjDTguCzEwWKJ11uU1gbuYDSSpxXCkTq6E8Ai/k8iydEbiMAHqK0ygZBBNxpT RswwvwRKI0BLOvh6N+Eyen3OoOkZ3QaP1F39qnpQYKlal+jU6zLcXNtVf//qDhMbVKdoRH cNwIJiqTl3dQTTi9/KsjwCLop+vNjkhHNnySwyZY73q+itKu0k7fc8uTqc5XNA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ft85kW2O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.16 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ft85kW2O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C84DD94CC X-Spam-Score: -3.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: yxYfhvqdk5LB Hi Sebastien, I have encountered issues with this before when trying to noweb code into a string that was code to be sent via ssh. I ended up switching to use typeset -f in bash in most cases now, but that is not possible for other languages. Some languages also have enough different types of syntax for strings that they can work around such cases, but again, not all do. One potential issue with this suggestion is how it would interact with multi-line blocks, because you can't have anything on the same starting line as the noweb expressions since it will be repeated in front of every subsequent line. This would also require each org-babel lang implementation to provide a method for correctly string-escaping the nowebbed values (in some cases e.g. shell this is decidedly non-trivial). With all of these things in mind, I would thus suggest not trying to overload the noweb operator for this purpose. Having a string escaped equivalent would be nice, but because it requires more than just a simple copy/paste into the buffer, it seems like it probably needs separate notation. Best, Tom