From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cMX+OdbrmGOd2QAAbAwnHQ (envelope-from ) for ; Tue, 13 Dec 2022 22:17:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YJ7+OdbrmGNf4wAA9RJhRA (envelope-from ) for ; Tue, 13 Dec 2022 22:17:10 +0100 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 5F79117693 for ; Tue, 13 Dec 2022 22:17:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5Cdc-0007Za-Pf; Tue, 13 Dec 2022 16:16:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5CdZ-0007YP-FR for emacs-orgmode@gnu.org; Tue, 13 Dec 2022 16:16:30 -0500 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5CdW-0000XN-29 for emacs-orgmode@gnu.org; Tue, 13 Dec 2022 16:16:27 -0500 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-3f15a6f72d0so210838477b3.1 for ; Tue, 13 Dec 2022 13:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K26UOpIpVWq1t4d82zG7yulhaVN0QdSVVGNTuNRjXrs=; b=LI5edxyLLXKHpiyODKlgdEhEfiBzWbtsVzpp64cHxgRnlCtXWiPPctoptGzENYWaMR i/aVIJzgnqbKO6UjiIRNFClMK6HmM1gNEdnWSjcK1WZdTHem9Hk5UylAru3a2J6GHiJR kbZf5tvB8o4MnRJCIe0Q2la+cx4GQqh/l/ZZzcWdFzbIcye+HyCw96b3IHQ93mj0PbSO QH6gsXVDIGYTClFDiS1T1vLbQAeBxpJRMIxgxpEldr1bxqDI/3pkNmGHlRcjcH+dvMnn ilah+r1O88rKsFoq80a44NRcRzdxxHYMdoRWK4TQfN1mbzJKZU7PxG6/S/OuzzA9yNYH 43Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K26UOpIpVWq1t4d82zG7yulhaVN0QdSVVGNTuNRjXrs=; b=a8asLICSG0JMidN+FYPnEAlCuTWSrJDgD9cSWSFjh30Pr18YLaPuqC2ytwNv7CaKDr XL1uh92gTp1wiTLJkjhltzq28Jm+/oWiBh3xeg5IqlEgdzrOz11kY3OOXJlZnvRN92sB cc8epsM5NUsdYaJcABH8PE0n9v3PEWDeClAMYYMVZLZdv4n34w8nBsRJu8cTqsc2yiP3 gDXNlfYMhu7HNO0jhc5jBdZc7YGxcH7EWGeJqG+Ah5zh4dRBnHdyJCkZosL4ElC6qHCv FmQfEBUJwAZ6stZ3BQ95gVlNxCNh7LFbmSCafKm7HqM6QLqkwy07i8QPvOjl0at18d6o MbAA== X-Gm-Message-State: ANoB5pkan4ZpO/dw1ZDMjQIWrBY7nvoUsHE6e2CKhF7EJxpKDefFkWBo wZ47ZJNBDU6eD7z684KTnXOwMdV8up8/8rd+SYW7DY3BhKU= X-Google-Smtp-Source: AA0mqf5SYnx1KHvKQy3D2AzQCIupR0oYhHHriSNsF8LrZhgeciz4VPEU4gnpGKWQq+86pryF2vQnnYvS2mxMAvxk55Y= X-Received: by 2002:a81:528c:0:b0:357:858c:e015 with SMTP id g134-20020a81528c000000b00357858ce015mr27884049ywb.71.1670966184576; Tue, 13 Dec 2022 13:16:24 -0800 (PST) MIME-Version: 1.0 References: <87359ld5ye.fsf@kyleam.com> <874ju0j538.fsf@localhost> In-Reply-To: From: Tom Gillespie Date: Tue, 13 Dec 2022 13:16:13 -0800 Message-ID: Subject: Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable To: Max Nikulin Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::1132; envelope-from=tgbugs@gmail.com; helo=mail-yw1-x1132.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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670966230; 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=K26UOpIpVWq1t4d82zG7yulhaVN0QdSVVGNTuNRjXrs=; b=B1tjVJDhwR9G72NCDxbPiRjdlcA9fE4gPdRK1qtSRja9a//Ich0nnSdb6UcVhJ6UfTLgKR xD8OAwDuTLLlTZjdnNeZPFOJzIbo63U1EGabqBrtPuLlHRdd6S9L6dOy1Dp7Rq3BNV9I0O 6IYLmlfeIwqd8YtWUPdpOHydlUcxWy88Ecp5MW9w0NX0GMfPmSkmMAewKl9dxazx4VdWND KP01kHgyzW8vJhyc3rIwldXazsrFg4B0nrpotIDlcddY4J2cjWMCfFWCppK775FC6bpCH8 MdYBs9I5+zkUh8bfcFjkPpBP/A82zWqj6Ys+4gQlZZzfgUE7dPP3m20ZiVwMAw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LI5edxyL; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670966230; a=rsa-sha256; cv=none; b=STO/Twmf2yJ+d+L0WrZvVNX0RQ/SGqh/RJMFQU7TN8R97dN/7zSyQlum+PC8cGT7X5JO4J LRCP2Rrpx7IPYEYdQ5I0PehzY3NS+zttvp++0kOGdafFdeLMnyyMU5ooQfypDfFMF3cYdE M7YiuXwZNfMHvAF9U20tYkAN3Og7EecZZOB5g8RBPjmXdgRUnOsveJlW30TqC5BvCd1By4 d+qSwhcCE52o/blEqnqMSR/RJY+DMKtJSR9+Zb8z+GAIRC9Kn6OuaAk6ps47WDMfDkSLQ5 C6Kh++rFcxXvnEzwhlW1+Wr4akdnuQAL71urIzVzEMuwuqPBM+SnZuxUfvvcYg== X-Migadu-Spam-Score: -4.44 X-Spam-Score: -4.44 X-Migadu-Queue-Id: 5F79117693 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LI5edxyL; 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"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: YPO6HQDICkeG > Will it be clear to users what "cell" means in this context? I assume the language was originally chosen with tables in mind, but I think it is clear? The one issue is that using org-babel-confirm-evaluate doesn't use the word "cell" in the yes-or-no-p prompt. > Am I wrong that, roughly speaking, the effective value is (and > org-confirm-babel-evaluate-cell org-confirm-babel-evaluate)? You are correct. Only in the case that org-confirm-babel-evaluate-cell is or evaluates to t will the yes-or-no-p be displayed _IF_ org-confirm-babel-evaluate is or evaluates to t. org-babel-confirm-evaluate (NOT org-confirm-babel-evaluate) is the function that issues the yes-or-no-p. > Should it be described in the docstring? Maybe? In the current implementation the value of org-confirm-babel-evaluate takes precedence, which I think is the correct behavior. If someone has told us that they blindly want to execute all code, but not cells, we should not change the default behavior, and thus we should execute all cells and blocks > It seems e.g. :eval query affects the latter, but not the former. :eval has no impact on cells. In fact in some files I use :eval (and this-file-done-loading "never") on some blocks that (setq this-file-done-loading) at the end to achieve only-once behavior. > If it is so then it is too complicated for me to feel firm ground > while reasoning on security. :eval has never, and cannot impact evaluation of cells, because it is specifically used to control evaluation of blocks. Similarly :eval has no interaction with any of the confirm-babel-evaluate machinery. I see one possible point of confusion which is that he :eval that you see in the code of org-babel-read is a hack to create fake info for a cell. Are you maybe looking for a file level :eval-cell option/property that would allow you to declare that you should NEVER run cells at all and also never prompt? Basically this is an option that says "treat all cells as if they and their header property are the default value". I'm fairly certain that implementing such a thing is a bad idea, for example if someone sets :dir using a cell and it is overwritten they could execute code in the wrong environment, which can lead to nasty security issues. Thus the only global option for cells that we could safely implement would have the semantics of "treat all cells as if they are (error)". > I have not decided if it is feasible to add some property to the INFO > argument passed to `org-babel-confirm-evaluate' and to put there > condition which variable should determine result. Having done so before, I would rather not touch org-babel-confirm-evaluate if at all possible. The only disadvantage is that for now when users are prompted they will not be informed that it is a cell, however from the short nature of cells the will hopefully be able to figure it out. The fact that org already jumps to the location of the cell in the file helps a lot with this. Obviously this doesn't help in a batch context, but if a user is hitting this in batch mode they are in trouble anyway.