From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2AbOBigMU1/wEgAA0tVLHw (envelope-from ) for ; Sat, 05 Sep 2020 03:55:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EK5DAigMU19DRQAA1q6Kng (envelope-from ) for ; Sat, 05 Sep 2020 03:55:20 +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 79F109404D3 for ; Sat, 5 Sep 2020 03:55:19 +0000 (UTC) Received: from localhost ([::1]:55750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEPIL-0002rm-F1 for larch@yhetil.org; Fri, 04 Sep 2020 23:55:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEPI0-0002rc-Qe for emacs-orgmode@gnu.org; Fri, 04 Sep 2020 23:54:56 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:34108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEPHz-0005ET-5n for emacs-orgmode@gnu.org; Fri, 04 Sep 2020 23:54:56 -0400 Received: by mail-wm1-x343.google.com with SMTP id c19so8666120wmd.1 for ; Fri, 04 Sep 2020 20:54:54 -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=f2szk4cIeulYZMTzoVGDiMiKiKKMeINTRfp2uEBin5U=; b=H3eJ2CNvAu57+K6G1ElZWXNNHD+FBRz0pnzoWHvrI3fTenY25jUGhzpZ25dJ6X4ZIT OCZyYsOOTlzE7JuWfQ+ULxlKz3Hj+H+dh//V6hS3mg18hUllzwwnKzEywqCGYyiHgNR+ A/8gb49g/ab2AItEEpcJxMh9IGVThAeFaLUsg+rYdcQtQ5H5C4jrB/HyXLVkeFB0E4T7 Tka1EzgMnkhQJlRz8n5NQ0grj8PwrfYpgfqUPqvYcoQHOiWy2G7eE70jnv0xbY7LutT7 VjOA9s4/Pdx5QfdN5jv68L9Xz39DOQuuUZNzTXMKZpKNIADfj+WhtFI+/5SPCflDXvxJ zPvA== 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=f2szk4cIeulYZMTzoVGDiMiKiKKMeINTRfp2uEBin5U=; b=q8feZ9EOOUXNKCQ16na9zoLatopRoIdzwUltBFznRsfBJLOX+EcEa4FwpCZuq9w+I0 R3S0Tb8mC39DAsPhHdZtbiiGwQvQDmaeyzbh3e+CDCA3FNJ/3Nld4IgMSI/6dO2IWFGX PIOzROwfgSYgupqWvslfPfWP/XbitAtLrH2flnVpaMu9CZzBKtCDk1YH3OFRH+4j/WkH 3o46jXDmnAJbyTVECgljRkz9IMIDttzmmVJkp168VQ1QSp8lkdn8g6fQeGbLAdZfc26E WuI4OxzgATH6I2Gg6N+PIJCT9MqteMePawbuE8R8fYLPSg5htCqUG9iX7zXT59XPUZ8L EDyg== X-Gm-Message-State: AOAM5322Zz69gL4q7tFwxzgLZPJ4Q4RelPI5YalLO9RL5owE93Plc0Zm 2khMVp2oxsnQZ5T67G9FwTOib8/9IpanAU/2MyU= X-Google-Smtp-Source: ABdhPJzA4nYD4pYRBtVPwOq7yMlzVVbGJE3lz6dqp6xTYhrd3i+6h7OIQs36R0cBzTMX9LjCEoi9FHyziAvmuufed/w= X-Received: by 2002:a1c:dec2:: with SMTP id v185mr10284270wmg.1.1599278093117; Fri, 04 Sep 2020 20:54:53 -0700 (PDT) MIME-Version: 1.0 References: <87k0ywyydv.fsf@kyleam.com> <87k0yg4efs.fsf@kyleam.com> In-Reply-To: <87k0yg4efs.fsf@kyleam.com> From: Tom Gillespie Date: Fri, 4 Sep 2020 20:54:42 -0700 Message-ID: Subject: Re: [PATCH] lisp/ob-core.el: pass expanded body to org-confirm-babel-evaluate To: Kyle Meyer Content-Type: multipart/mixed; boundary="000000000000a36e1405ae88f284" Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=tgbugs@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=H3eJ2CNv; 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-Spam-Score: -1.71 X-TUID: n25B5qMzgg1X --000000000000a36e1405ae88f284 Content-Type: text/plain; charset="UTF-8" Hi Kyle, Following up in this thread having investigated the impact of coderefs. My conclusion is that coderefs need to be stripped out before they are passed to org-confirm-babel-evaluate. They are not present in the executed code and removing them is not something that a definition of org-confirm-babel-evaluate should have to know anything about. Right now I work around them by suggesting that users comment out their coderefs. This works because my use case is restricted to elisp code and I strip the comments using read, but other languages would not have such an easy solution. I have included a patch against maint that reuses the let block from org-babel-execute-src-block to accomplish this. Best! Tom --000000000000a36e1405ae88f284 Content-Type: application/x-patch; name="0001-lisp-ob-core.el-org-babel-check-confirm-evaluate-str.patch" Content-Disposition: attachment; filename="0001-lisp-ob-core.el-org-babel-check-confirm-evaluate-str.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kep4rtub0 RnJvbSBkZmI4ZWVlOTkwMWEwZmU0YmQ5MzM5MTEzODZmNjk4NjM3ODVhMTViIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBUb20gR2lsbGVzcGllIDx0Z2J1Z3NAZ21haWwuY29tPgpEYXRl OiBGcmksIDQgU2VwIDIwMjAgMjA6MzU6MDMgLTA3MDAKU3ViamVjdDogW1BBVENIXSBsaXNwL29i LWNvcmUuZWw6IG9yZy1iYWJlbC1jaGVjay1jb25maXJtLWV2YWx1YXRlIHN0cmlwCiBjb2RlcmVm cwoKKiBsaXNwL29iLWNvcmUuZWwgKG9yZy1iYWJlbC1jaGVjay1jb25maXJtLWV2YWx1YXRlKTog c3RyaXAgY29kZXJlZnMKYmVmb3JlIHBhc3NpbmcgdGhlIGJvZHkgb2YgdGhlIGJsb2NrIHRvIG9y Zy1jb25maXJtLWJhYmVsLWV2YWx1YXRlCnVzaW5nIHRoZSBzYW1lIGxldCBibG9jayBhcyBpcyB1 c2VkIGluIG9yZy1iYWJlbC1leGVjdXRlLXNyYy1ibG9jay4KLS0tCiBsaXNwL29iLWNvcmUuZWwg fCAxMSArKysrKysrKy0tLQogMSBmaWxlI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