From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 4FT+IeXmGWNlHwAAbAwnHQ (envelope-from ) for ; Thu, 08 Sep 2022 14:58:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yL0IIeXmGWPgCQEAG6o9tA (envelope-from ) for ; Thu, 08 Sep 2022 14:58: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 39B6790BE for ; Thu, 8 Sep 2022 14:58:13 +0200 (CEST) Received: from localhost ([::1]:52424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWH6i-0004gX-4t for larch@yhetil.org; Thu, 08 Sep 2022 08:58:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWGk2-00041P-UF for emacs-orgmode@gnu.org; Thu, 08 Sep 2022 08:34:46 -0400 Received: from mail-4324.protonmail.ch ([185.70.43.24]:40589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWGjz-0000kZ-8T for emacs-orgmode@gnu.org; Thu, 08 Sep 2022 08:34:46 -0400 Date: Thu, 08 Sep 2022 12:34:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=protonmail3; t=1662640472; x=1662899672; bh=VqMAaQF5eVAhk3Rf/QSooyYF1k4xHXJjRjKGZJVSmo0=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=HAARQWJsUgvNB3+eX6qSOdPKR8dZ5buVaVSpI7UyxOJO30JTzNPPbvXcX47jqmIk1 /t+LkcjRBrJPWXxBfn15qizHPju85g7NEzDvv7D2IFlDvakUH10YLzKY35E1lG7mjO jmPSgvhcgoEb/nT2zcSYOdUyr255WzLbDcH0S/tcOVCkbefnXmtxsvzU9H4cxgGhRy YpNPBzlRKL4YRUufkiApIFuS7j+7hYYOjzT/IlQ/qGQaik7lm8Gdgf81Wdh4KeDkJw Ncy94sO8y12RhtGDdY4cMpxho462CMqa//9sWQfNs5/+l22AFL6rISfnORqLUsH5fJ vNnoKeHii1sqw== To: Ihor Radchenko From: Fedja Beader Cc: "minshall@umich.edu" , "emacs-orgmode@gnu.org" Subject: Re: per-file (or, really, per buffer) allowing/disallowing code block execution Message-ID: In-Reply-To: <87zgfao1hu.fsf@localhost> References: <595135.1662491125@archlinux> <87zgfao1hu.fsf@localhost> Feedback-ID: 216965:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.24; envelope-from=fedja@protonmail.ch; helo=mail-4324.protonmail.ch 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_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: , Reply-To: Fedja Beader 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=1662641893; h=from:from:sender:sender:reply-to: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=VqMAaQF5eVAhk3Rf/QSooyYF1k4xHXJjRjKGZJVSmo0=; b=Z3mtJ1V1RmEKMWLBS3uPXkrOpDpZ52o1jCMlS+vumFHebAuvfnLMcNfMGu/FjVtvtj8VLx AYVcncAZnsu3tCwZPJUSitdJcmiEoiGYRztROaeZ3pnH71+yMheCoFGGSei+OQfb/DIq/s QsxdQiukadfXelwy9d8u8hQ+XAXiYFLsjIRIrr1I72nX2Pdih9t1CmWuFB1BMr6Xx8//ci tmRKGVlBx3aEf8Bk1OgpqkzjK2wsYo0rBL5Bw99Sgoc33OmnUGvbR9J5mf7CsinaIS3VuJ sle0kdN6V5tY6ilvTJ8Jgfey2ldpeSiMYaZxQp1H5hDSO3M8zL9qsVyZEMfciw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662641893; a=rsa-sha256; cv=none; b=Pd03U51pwqnvaUC20vjwKKWuWy5HAygDrk1cm1/gTza/BuU1P+NnspdH+OvDyDSUTBpCq2 rYYXO2efyeVopmx9kecm0EG0v2H9t5EfZnPMdRhbtDNyia0CwrOxbULPgQUMrhOC5XrH9w H95IVsAmg2NUuAr+qJwFTWcOYJeENjzHYVAh0fGHCMtPUCPOxmYsJSxcJWqrtcilwmIjeV 7IdwkQ2c7mJfJK+E2m/MRi2pw7fij/8LcBdb8zjA+ai+NaeQlcjS/vAYHZyxCG8vqr+ug5 JmUIxxHeeusioco5wb96ZAwHzpe2HpIx9GHz4EtP28boW8WboPIB+z3gHvVVgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.ch header.s=protonmail3 header.b=HAARQWJs; dmarc=pass (policy=quarantine) header.from=protonmail.ch; 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.78 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.ch header.s=protonmail3 header.b=HAARQWJs; dmarc=pass (policy=quarantine) header.from=protonmail.ch; 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: 39B6790BE X-Spam-Score: -3.78 X-Migadu-Scanner: scn1.migadu.com X-TUID: z/36dhOP5SWm Hello Richard, Ihor and Steven, I'm aware that file-local variables exist, but it seems that all documentation for them put them *into the file*, which is not secure fo= r files downloaded from the internet. What is to stop a malicious file from= setting an "yes, execute me automatically" variable? Anyway, the point of my email was to suggest a change to org-mode such that= it provides a pleasant out-of-the-box user experience for people like me. = I want to use org-mode as a python/octave/R/whatever interactive notebook w= ithout having to spend several days learning elisp and the internal working= s of Emacs. I have spent these days, days that could be better (sorry!) use= d working on actual projects of mine. But I spent this time and the time to= articulate what I want and to write these emails in the hope that I will b= e the last person having to do so. I would also like to suggest org-mode to= other people instead of Jupyter notebook without having to add "oh, btw, y= ou might want to add these three pages of alien code to your init.el to mak= e it usable". To go a bit further off-thread, this change might seem unnecessary. However= , the other changes I want is also auto-executing all modified code blocks = on file save and/or when the cursor moves out of it, auto-executing depende= nt blocks when their dependency changes (e.g. blocks full of constants) or = marking blocks as stale. But I will make suggestions to improve these thing= s in later emails, once I know what I want. Hello Greg, Agreed, just yesterday I must have pressed C-c C-c "yes" three times a minu= te evaluating an embedded Octave script. The current default configuration = is not pleasant at all. Hello Ihor, > Then, what about the following: > 1. Set org-confirm-babel-evaluate globally to t > 2. In the files you maintain, you can always put > file-local/directory-local value of org-confirm-babel-evaluate to > nil. > 3. We can modify org-babel-confirm-evaluate _function_ to accept four > possible answers: yes, no, yes for all in buffer, no for all in > buffer. The extra 2 options will set buffer-local value of > org-confirm-babel-evaluate in the current Emacs session Don't know about option (1), (2) seems insecure at first glance, for the re= asons mentioned above. (3) sounds good (yes/no/always/never?) and what I wa= nt.