From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 0NkKN2zMbWW2JgAA9RJhRA:P1 (envelope-from ) for ; Mon, 04 Dec 2023 13:56:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0NkKN2zMbWW2JgAA9RJhRA (envelope-from ) for ; Mon, 04 Dec 2023 13:56:12 +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 B065B59ABA for ; Mon, 4 Dec 2023 13:56:12 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kSS2tJ+h; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701694572; 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=ubQBEqVIk1XgIooTOm6IlrJcLE1i2vOU6x8sKJ6Gjws=; b=FywEm98GohvJnumd7+Wi5CDsx9inL7rlBlQoMMCExx2Ydbbv/ocpJJ2qYBpxRkZmoqqkQn p/EUXgJwsOgo+u/PBHqfCvqAD5vhap4VAC4X9MsPnro3P1hmggJNEp4pS3xGG8tWwV4Kod qxz9D9GvhzOUOaXGOnNk1LPmtP3EqjK6tk4VduOY11vgF5kOMsuh/AJth/47magLwQ0oh/ DrG4AUfR2iqcswfAkcJGfrnuO1G19KrcOuzZFseC/ixo/05f0DjvWitOK4nKL/MTYveS3m 8XKPj6a8pfw3h5wRxEcMNO3xuUuJULvdbghwT+dXuxFRYIqYvJZWNAI76j6DuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kSS2tJ+h; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701694572; a=rsa-sha256; cv=none; b=KoOYr2S23LSyTKmLghT+rBON/N4G0OZ6OOJsU1pmwoszig8hmpKCSRZvqtkKDPrfqyNvYM nnEGNIAAOowu0EKfwwez11s5DQKwVZNtQ6G9hrH/VrorwlTFNgkbOFXnFvKh0uGsJlslBF 5TWcRKiTCvjFb2NZeIkOkrpwNAbpRcO1HigH328WWf9YnzBfxB3MHnrdxWfq0PV62xDdD/ GpjzNCqWaKEGb1qvswtm0MFpaOCW8dSxpMkai31WB/XQKzY+63epUs0BhqEi8vLQkPQkDL +A7z8nJUV4A8W6a/vP9R8vF8tWJBbJTa+oZ9WwFQJr7BkFah2DQ7lx4YeBctkQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rA8Tw-0004Z7-HJ; Mon, 04 Dec 2023 07:55:28 -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 1rA8To-0004P9-7i for emacs-orgmode@gnu.org; Mon, 04 Dec 2023 07:55:23 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rA8Tl-0005uW-Hz for emacs-orgmode@gnu.org; Mon, 04 Dec 2023 07:55:19 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 19CCB240103 for ; Mon, 4 Dec 2023 13:55:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1701694515; bh=rFSP56rGUpvw5IaH1Odv7Mkd2QriodBzSJIUoHvcAQg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=kSS2tJ+hnLpxjNqKYnQQmStpcDCv93rebaSUNpdyhM88i6SbVbXnjqpkVhJ+/N5Qu LC+IpH8wQpZgapFx2o8gPJKWbEdN+r8763NB+hm2j88NTyjbhcKTQW1p3nzcKozDR8 CWMyxwlXZaJTMMtFczsjbMauK6blElwTmtGG+AMrBdO6n7WmX+CjYCSjs2rYUw/1II i6iCflAV9ekYQyTeb2dbDcpxZyQrjzLA1hwr2bi2BkXwvPRncq10l//XIb9fkrCysK 422s+eZmlFL3+e2ImVsOh4ITD6RHcYr3iFYslo+PSQCjkyDapj1wuQvTGTKQX9nY6U ykWILHRePqt4A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SkNtV49SWz6tyL; Mon, 4 Dec 2023 13:55:14 +0100 (CET) From: Ihor Radchenko To: Cletip Cletip Cc: Max Nikulin , Org Mode List Subject: Re: [BUG] Tangle with symbolic links don't work In-Reply-To: References: <87wmuu3lh7.fsf@localhost> <87leb9243e.fsf@localhost> Date: Mon, 04 Dec 2023 12:58:13 +0000 Message-ID: <87r0k2m8ey.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.35 X-Spam-Score: -9.35 X-Migadu-Queue-Id: B065B59ABA X-Migadu-Scanner: mx12.migadu.com X-TUID: t7RBbgbZIz4H --=-=-= Content-Type: text/plain Cletip Cletip writes: > Sorry to bring up the subject again, but I didn't quite understand what the > solution was: should I modify the function ? Is it modified in a new > version of org-mode ? The tentative solution is attached. May you test it? The previous discussion was mostly about how to best approach the solution. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-babel-tangle-Do-note-erase-the-existing-tangle-t.patch >From cf9db7b5a602c2c0d4970c69a95d98640cefc9a0 Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Mon, 4 Dec 2023 13:55:05 +0100 Subject: [PATCH] org-babel-tangle: Do note erase the existing tangle target before overwriting * lisp/ob-tangle.el (org-babel-tangle): Do not remove the existing tangle target file, if any. `write-region' later will overwrite it anyway, while removing may be unexpected if the existing target is a symlink. Reported-by: Cletip Cletip Link: https://list.orgmode.org/orgmode/CAPHku6O9NfVMAfmE3_ahmpJea_2Qm0mJMFX6qPpT8uiQ94KMZA@mail.gmail.com/ --- lisp/ob-tangle.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index b30fd9274..b48269897 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -310,9 +310,8 @@ (defun org-babel-tangle (&optional arg target-file lang-re) (compare-buffer-substrings nil nil nil tangle-buf nil nil))))))) - ;; erase previous file - (when (file-exists-p file-name) - (delete-file file-name)) + ;; We do not erase, but overwrite previous file + ;; to preserve any existing symlinks. (write-region nil nil file-name) (mapc (lambda (mode) (set-file-modes file-name mode)) modes)) (push file-name path-collector)))))) -- 2.42.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--