From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8I+tJwseZGceUQAAqHPOHw:P1 (envelope-from ) for ; Thu, 19 Dec 2024 13:22:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 8I+tJwseZGceUQAAqHPOHw (envelope-from ) for ; Thu, 19 Dec 2024 14:22:19 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=IM+YBFOE; 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=inria.fr ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734614539; 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=Q3iILAM5a3Lk+PctnOmOYMhNxWhiJuvo/2E3yGnn0cY=; b=aN3b4Cq9KGWzss09MXUxL3+M7SnN1lYgNLzZRPLvFsZ/jjcrybhSNg/U12xYHHTBleF4kI qgFHoROHqREQ7ihD5C0mzZbBkNYHg1t9HbFy/wMDXVeHZJLTIgJf/ePLauM32Ag/buZw55 ZCuPLajVqDtMQk7Gcs9IjK0HJPqn11CK4izrZcQXJ5uRYJ30UwCDWlNJR4gJzfB42tp2f6 hvsRQxXi/pqaHsx7YFb9Lwm79OfskeHCLsen32THIwiPDNMwXDQSDCGnHPTcVtNP514BGp s6/OdE+x01fetcraM7bSEr44+CpU4PbTNonp8ZFfpgXmvZNxtZCC7JcbCRlS8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=IM+YBFOE; 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=inria.fr ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734614539; a=rsa-sha256; cv=none; b=ATM7KreuxXB0P35u8QJfFVY8UQLtPLoph+3oh+raNvyj1fWEQ3fZ+yL8BxFzR+Y+2tqU6J 05M4o4MZZ435XtMRFh4wb1XAgvxMXaIS/mJboHV4Z74CSXJBf7FhdK2ojQ8+QGCdPy3Q3K Go5Tb6Dafzl9lpEvnpOs95sncBGi26J7IrpCLamwu0umLWqlmAemhntbCQg/xuLwIjq5JO EfAY2wSxJkPPd90s7JvfI3EzWvQ14VOLvMf6ZcTOEX1MnEk908js19MLaZEKS+9sIsBS9g OU83yYV4YHboXqxJ42Ht/qMEsyOpeaUSLzcPQmfimjxTk/mw+sH+R0DFENzeoQ== 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 A6B7D508BA for ; Thu, 19 Dec 2024 14:22:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOGTH-0002x6-A3; Thu, 19 Dec 2024 08:21:46 -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 1tOGNZ-0001eM-1A for emacs-orgmode@gnu.org; Thu, 19 Dec 2024 08:15:50 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOGNU-0003b7-Ut for emacs-orgmode@gnu.org; Thu, 19 Dec 2024 08:15:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:message-id:in-reply-to:references: subject:mime-version; bh=Q3iILAM5a3Lk+PctnOmOYMhNxWhiJuvo/2E3yGnn0cY=; b=IM+YBFOEbNcH8xeTUQ16pk2RqKsHjpExkehi69CnhwV/zhrWT/KEuk6c yCszcnPwKWuN7P6unzbrCZsAHAQBDplWywn3cQsDBFnzTICHc+rPg/qs+ T8Yivdj1X5M/5UwjUeRmfxjB9QeJJobcB5RHQd1PktKOi/yt+CXsActk3 I=; Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of gilles.marait@inria.fr designates 128.93.142.5 as permitted sender) identity=mailfrom; client-ip=128.93.142.5; receiver=mail2-relais-roc.national.inria.fr; envelope-from="gilles.marait@inria.fr"; x-sender="gilles.marait@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 include:mailout.safebrands.com a:basic-mail.safebrands.com a:basic-mail01.safebrands.com a:basic-mail02.safebrands.com ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:128.93.162.3 ip4:128.93.162.88 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@zcs2-store2.inria.fr) identity=helo; client-ip=128.93.142.5; receiver=mail2-relais-roc.national.inria.fr; envelope-from="gilles.marait@inria.fr"; x-sender="postmaster@zcs2-store2.inria.fr"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="6.12,247,1728943200"; d="scan'208,223";a="200052722" X-MGA-submission: =?us-ascii?q?MDHi9FeSbD8Ggwy8uMgH3N0HURgpZGxMewRp/c?= =?us-ascii?q?iccHs8C0rvRBqODHS1j9aOYf1l0u4y+MaDzzm/QgQG5BeOfisXP10kg2?= =?us-ascii?q?+QXp0DeTdY4xpOzBj8n3teHXbHF0vpbMUckICEdmCLYc7fcuDNT1LzuH?= =?us-ascii?q?InHhhYVPmHpfrDgC2vk1peTw=3D=3D?= Received: from zcs2-store2.inria.fr ([128.93.142.5]) by mail2-relais-roc.national.inria.fr with ESMTP; 19 Dec 2024 14:15:36 +0100 Date: Thu, 19 Dec 2024 14:15:35 +0100 (CET) From: Gilles Marait To: Ihor Radchenko Cc: emacs-orgmode , emmanuel agullo Message-ID: <1991176959.2790668.1734614135886.JavaMail.zimbra@inria.fr> In-Reply-To: <877c819hjz.fsf@localhost> References: <652111520.30366591.1725288746643.JavaMail.zimbra@inria.fr> <87tteopvxw.fsf@localhost> <1781466320.35797146.1725958169824.JavaMail.zimbra@inria.fr> <878qvtkwhn.fsf@localhost> <877c819hjz.fsf@localhost> Subject: Re: Change behavior of "org-babel-tangle-publish" from org 9.6 to 9.7 -- deleting source files and not tangling properly MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_88fd2565-8070-4720-b8a1-bf084d91b5f2" X-Originating-IP: [193.50.110.54] X-Mailer: Zimbra 10.1.3_GA_4699 (ZimbraWebClient - FF133 (Linux)/10.1.3_GA_4703) Thread-Topic: Change behavior of "org-babel-tangle-publish" from org 9.6 to 9.7 -- deleting source files and not tangling properly Thread-Index: pFtzne7hEmoYPA7v+4BGdMck5SXLiQ== Received-SPF: pass client-ip=192.134.164.83; envelope-from=gilles.marait@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 19 Dec 2024 08:20:16 -0500 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 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.43 X-Spam-Score: -3.43 X-Migadu-Queue-Id: A6B7D508BA X-TUID: WU4woEVOC8tt --=_88fd2565-8070-4720-b8a1-bf084d91b5f2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Ihor, Yes, it works perfectly. Thank you very much for the patch. I don't think I would have been able to do it properly with my limited knowledge of elisp. Gilles ----- Mail original ----- > De: "Ihor Radchenko" > =C0: "Gilles Marait" > Cc: "emacs-orgmode" , "emmanuel agullo" > Envoy=E9: Dimanche 15 D=E9cembre 2024 14:55:44 > Objet: Re: Change behavior of "org-babel-tangle-publish" from org 9.6 to = 9.7 -- deleting source files and not tangling > properly > Ihor Radchenko writes: >=20 >> IMHO, it makes more sense to preserve _and also document_ (in the >> docstring) the old behavior. We just need to make sure that the bug >> fixed in 478576749d does not re-surface - when publishing directory is >> "." the old code failed trying to copy tangled file into self. >> >> I think that we can simply call `org-publish-attachment' on every >> tangled file in `org-babel-tangle-publish' - `org-publish-attachment' >> takes care about the situation when the tangled file is already in the >> publishing dir. >=20 > Gilles, may you please check if the attached patch works for you? >=20 >=20 >=20 > [Documents > texte:0001-org-babel-tangle-publish-Keep-the-original-tangled-f.patch] >=20 >=20 > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at . > Support Org development at , > or support my work at --=_88fd2565-8070-4720-b8a1-bf084d91b5f2 Content-Type: text/x-patch; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit >From 778a29dcc64e7f400f94145adf01dca67f5588f4 Mon Sep 17 00:00:00 2001 Message-ID: <778a29dcc64e7f400f94145adf01dca67f5588f4.1734270889.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sun, 15 Dec 2024 14:52:39 +0100 Subject: [PATCH] org-babel-tangle-publish: Keep the original tangled files * lisp/ob-tangle.el (org-babel-tangle-publish): When publishing tangled files, do not remove the original versions of these files. Keeping was the old behaviour that some users relied upon. Removing the tangled files may also be unexpected when they were tangled outside publishing, during normal user workflows. Update the docstring to explicitly state that the tangled files are copied. Reported-by: Gilles Marait Link: https://orgmode.org/list/878qvtkwhn.fsf@localhost --- lisp/ob-tangle.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index fe143b039f..9554a3226d 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -227,13 +227,11 @@ (defun org-babel-tangle-file (file &optional target-file lang-re) (org-babel-tangle nil target-file lang-re))))) (defun org-babel-tangle-publish (_ filename pub-dir) - "Tangle FILENAME and place the results in PUB-DIR." - (unless (file-exists-p pub-dir) - (make-directory pub-dir t)) - (setq pub-dir (file-name-as-directory pub-dir)) - ;; Rename files to avoid copying to same file when publishing to ./ - ;; `copy-file' would throw an error when copying file to self. - (mapc (lambda (el) (rename-file el pub-dir t)) + "Tangle FILENAME and copy the tangled file to PUB-DIR." + (require 'ox-publish) + (declare-function org-publish-attachment "ox-publish" + (plist filename pub-dir)) + (mapc (lambda (el) (org-publish-attachment nil el pub-dir)) (org-babel-tangle-file filename))) ;;;###autoload -- 2.47.1 --=_88fd2565-8070-4720-b8a1-bf084d91b5f2--