From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 6Ge5D5NVF2O36gAAbAwnHQ (envelope-from ) for ; Tue, 06 Sep 2022 16:13:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aJq7D5NVF2NPAgEA9RJhRA (envelope-from ) for ; Tue, 06 Sep 2022 16:13:39 +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 55B30449D9 for ; Tue, 6 Sep 2022 16:13:32 +0200 (CEST) Received: from localhost ([::1]:46082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVZKV-0004BY-I4 for larch@yhetil.org; Tue, 06 Sep 2022 10:13:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVYhL-0001kh-Ah for emacs-orgmode@gnu.org; Tue, 06 Sep 2022 09:33:04 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:40874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVYhI-0000fu-WD for emacs-orgmode@gnu.org; Tue, 06 Sep 2022 09:33:03 -0400 Received: by mail-pj1-x102e.google.com with SMTP id t11-20020a17090a510b00b001fac77e9d1fso14958548pjh.5 for ; Tue, 06 Sep 2022 06:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=S4Rvzcmcn5fm5yF2QbKOUKFfL09OFjBxic2tIR8gV9g=; b=c+vYnLmrNcVJnGnXkypaUNKujL/z1YCe0n7e1l2O0sdcGpBHzj55JbUbdY/0/DwDJT ln9rs/2QnA2YkMZtIGzAJwhsFLwQpq1ggn4f+K8PJF+CegejFImfIcdMn/q/kuuDFU6j 1yp98ID5uQ4ubtEqvAyJPK2o/uXLrqkDzG5rrdxigpAtr0fHBK4bFRYE5VUS5U0tUTQd XthtM73+Q/X5Yk+te1c0nhR1gIGCqdJq7HrsXIXPKGCZ8H+tBk90Q4pfr5CTk+N4c34t uEVSFKU+VS3uBNGyWOuOaqw3ivMALyqR2neBnx7B6PrkmwZkDFQ0QtIERi77OApaeo2I xelw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=S4Rvzcmcn5fm5yF2QbKOUKFfL09OFjBxic2tIR8gV9g=; b=4n1s0ijOIPv90BD6qSVZ0E6ObNuyUpwD629e/HqQujdEHTFPv7d+hnI3sTfmmXYkzC qnMeAf1edWKWUpGKyd10NyCSqZNLU3iaIAud/3m0z+iT/VqDER5qu6VZ/B8Au240tQUS GsRtet4g8NvbTc5ldM9o9LRR6X+htUK7yp89hPfzNLcBoX7s1HkT1iCJdDRpLaUbl9Cv vvQwwkbbCYoP//fnAMznQgR+WhjvCiNMKVZHfuYHjxuvnc/IlTc3PC0d2pSNuJK9kBCk lQpLxVg7cFHVlgpfbQm/TJd+66Yh/jxjjWk/T9ZYVDineMUHPmHxxbF7JbfDNz88V5uz djBA== X-Gm-Message-State: ACgBeo0wqxoVPVkjQV+VirCNj9x6DOsKFJ5mcwQ7XSyIa+jzUg7G6lVL rA0TKze+hhCbCkhGuq02fX1ZY0y9A8Q8Rw== X-Google-Smtp-Source: AA6agR79jjODTAx2C58DUGSVUatt37u2iBGV5rGBcgVNiCCMpQLfL54rZdO/qrqcWkrq+PKGgoHYjw== X-Received: by 2002:a17:90a:7088:b0:200:4e9f:a206 with SMTP id g8-20020a17090a708800b002004e9fa206mr12377909pjk.173.1662471179355; Tue, 06 Sep 2022 06:32:59 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id b28-20020aa78edc000000b00538232f33dfsm10076923pfr.187.2022.09.06.06.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 06:32:58 -0700 (PDT) From: Ihor Radchenko To: Fedja Beader Cc: "emacs-orgmode@gnu.org" Subject: Re: per-file (or, really, per buffer) allowing/disallowing code block execution In-Reply-To: References: Date: Tue, 06 Sep 2022 21:33:54 +0800 Message-ID: <87y1uwwrst.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102e.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: , 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=1662473612; 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=S4Rvzcmcn5fm5yF2QbKOUKFfL09OFjBxic2tIR8gV9g=; b=EHjJIX3lkuhWYni/Kexple7DX1+GF26zVJPTCNsrkiPusMtI3cslLjr2svrD0y36crKDps KPD+xNU31oLMyHr3do4+F/0YVjNfDd7+wEHWKjqdeSF5QYq0O52J6hlQPoQip/HbBo/3fE eKKThCfoT09wXfCrOO/wXddOjbS4iUDWcpk6bw+dZzTCsV5z0v4Jkskx5EiIlHYybII2Kn hhnEnFK8Y9v0r0O66tYMvRpdn2HsEEbW36JyWHu94M5EmAp6uWO6X7GijLht5wy/GG1CMG 7zt8fhJjZPYcIgBQgXRDybeGuwxd5SdkBRXoUl8cAI0DspoPoFkmlV+/sVEsag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662473612; a=rsa-sha256; cv=none; b=pfyq/edQzroCN2LtlBjH77vWhU162KpWOv4pxVUOe1cbX541LF9L8eLktfRSUN7nVoehH+ vdCf1cj1HKnp4yJQiXJ+IA+E/SIUIArXj6g8bcAEcXHjAafSCFpQiT5dxzmhSZ8Cip/df5 NAPRGTMldr54aBuOYm6uaZZ1MGq3Qkdgm6S+gLxM2Pu5PGhWsml8UN4ZDPQVtvq8aTbjco kStC60Ss3BCDxSKNLYh2AehfstbbZ0tO+08IA1rUjxZsY7jFWanD7/Fvyk0q0Ji0wTl1uD Qya+fy64RHrbko1D4wPkA3TatogR+yCRSOF/Ehm/eEsrWx8CdWKWS2MI4GQldw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=c+vYnLmr; 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: -1.77 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=c+vYnLmr; 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: 55B30449D9 X-Spam-Score: -1.77 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9QNcls+brgV1 Fedja Beader writes: > Pressing C-c C-c in a code block asks the user whether to > execute that code block or not. This soon becomes annoying. > To remedy this, org-mode provides us the variable > org-confirm-babel-evaluate. But this is not very user friendly. > > Additionally, as per documentation, this variable only controls > whether org-mode (babel? Forgive me, I am sort of a new user of > Emacs) will execute the code block without asking, or ask. > > What I would like to have, to safely and easily use org-mode > as an interactive notebook, is to not have to overload this > function and to be asked only once per buffer/file whether to: > 1) Unconditionally allow executing all code blocks > 2) Unconditionally disallow executing all code blocks > 3) Ask for every block. > > Particularly the second case is the one that cannot be > supported by simply defining org-confirm-babel-evaluate. 1) You can set org-confirm-babel-evaluate buffer-locally 2) Same or set :eval no header arg. (see https://orgmode.org/org.html#Evaluating-Code-Blocks) 3) You can set :eval query header arg. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92