From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QCeLNW/CtmV+5AAA62LTzQ:P1 (envelope-from ) for ; Sun, 28 Jan 2024 22:09:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id QCeLNW/CtmV+5AAA62LTzQ (envelope-from ) for ; Sun, 28 Jan 2024 22:09:03 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OLf6nCBz; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706476143; 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=rbiPnt9OWAA/lb3wWiio1HKa2HhRRkU30lDnmf+WO9A=; b=Y8Zpo8RemTgU8gVhhQtdJGmU1nvgkmllFeL/Q75paq3IlWyznHPNVOxaZ5qjoYZ+MgJHpU y4u/55YqSaOUR0Dwzq6D4+K/74oEAq9zXL6qvvqGOlhLmV7XF8RNrwiM83DR5UafrPMOV7 QqKI7IEVaYTf9N8lo7v/sAdky5MpT6kphRBx16ox+thC38QQT1NxlgibhQNMdO2hxObatT KV3kCsSmpSWNOxsEq5lDwH78FqfRkloddiweT1i6mWiyonjPtwlxF1zTde/YCm5MZcgfPD u1DuI2xKZaILp0VQs1heovdzB99cRuFHCWifpzn4aHEzORakjD6jyD464vkLIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OLf6nCBz; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706476143; a=rsa-sha256; cv=none; b=MWQ1eXW7CLwqWGrGZdqw1q3oAZJhQ/c7YwwtRvbkkffFin68W4kUnkpxG7PwER/BXdgVqg Co+M9rlBsn04rUNIGlqqDmdWrmL2jZdYJ85aaFhMfJy8Dn/Ho/yPWpNx2BIV6QiNLhf4I+ WJfr6EkFDVPCmAoEmPrTUZfhzJ92SDh//JFD4WX0Qsop80n/8vrnTi6Qss4mJC9vVwTHUL ctMHg+wb4j06dYhvNGd5De8H741GlraKpUeEZHs3LVmtj8hGhYgJTMmtvqvCw6opd9sZ+J VyV20Wj7fh2Pp+laVC5nBqUqaRi6uAZ1v5ahniGihEIpkqaIISz9zAVsnCs2sg== 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 8B94532470 for ; Sun, 28 Jan 2024 22:09:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUCO3-00063D-VC; Sun, 28 Jan 2024 16:08:19 -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 1rUCO2-000635-7y for emacs-orgmode@gnu.org; Sun, 28 Jan 2024 16:08:18 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUCNy-0002Tg-G4 for emacs-orgmode@gnu.org; Sun, 28 Jan 2024 16:08:17 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6E494240029 for ; Sun, 28 Jan 2024 22:08:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1706476091; bh=tgHooIVaF/iHqKFffpDQEK0Svc05Ql9ZO7b3esrODfw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=OLf6nCBzCqHkJVOMHS414Dv6bcHnn4twZUA3MBT2W01QauV9PitPznCy1Vu9fWb7v uXIjVFyLomKqVHWGy/JdPcD3esp4koW22MzaeIT2uhFHEfPPe9pjtkeXfwvpIl0TNz 5ZGqmjN2zB87KXJPlIC44QnFMfhflA7E4d/D2HEPQdDHUhnoFPxHVi9YQoIH2+Yr0J 6bJPDX98O9BbDcx9bLrYRnlfNXXxJ/Qi8gg8Bg0F5QX4RVwP7l2dw9WFgfJJxbAx4c 9ftIYjHJlfC2oW3bcCWGuaCRYB6Y1kGCs8KxPu3q8cY8TbzT1A3zqbYe/Oa+zH9thV tvSt/SjlGOBYw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TNPCt2kGcz9rxS; Sun, 28 Jan 2024 22:08:10 +0100 (CET) From: Ihor Radchenko To: Olivier Lischer Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] ob-tangle: Add flag to optionally remove files before writing In-Reply-To: <878r49i78e.fsf@liolin.ch> References: <877cjzhjtg.fsf@liolin.ch> <87wmryelfo.fsf@localhost> <878r49i78e.fsf@liolin.ch> Date: Sun, 28 Jan 2024 21:11:39 +0000 Message-ID: <87le89qi2c.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.79 X-Spam-Score: -9.79 X-Migadu-Queue-Id: 8B94532470 X-Migadu-Scanner: mx12.migadu.com X-TUID: QUuZzQ0PnGOI Olivier Lischer writes: >> Thanks for the patch, but may you please explain why introducing such >> variable is useful? > > Sure. > > I configure all my .dotfiles in an Org mode file and tangle the > configuration in the right places. The tangled files are all > read-only to prevent accidentally editing of the "right" configuration > file. With the current tangling mechanism, this results in a "Permission > denied" error because the function writes to a read-only file. In a > earlier version this use case was possible because the file was > recreated before writing to it. Thanks for the explanation! I suggest changing your patch, setting the default value of `org-babel-tangle-remove-file-before-write' to 'auto. This will keep the current behaviour but fall back to delete + write new file when the tangle target is read-only. That will avoid feature regression. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at