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 ms13.migadu.com with LMTPS id qEZDAL7fXmc3lwAA62LTzQ:P1 (envelope-from ) for ; Sun, 15 Dec 2024 13:55:10 +0000 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 qEZDAL7fXmc3lwAA62LTzQ (envelope-from ) for ; Sun, 15 Dec 2024 14:55:10 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=afXE0rsz; 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=1734270909; a=rsa-sha256; cv=none; b=cBvhg+iuOcMNrbWDiOEyKcpOd/tg8Fb0Af+C8J1FSkNiJePycVVxLIU40UIqCh+JC6TKtm cDkleDxdbZHnBdJlr3RxJwfktfYbhq9STVIaBJSjYKMYv6crKPGAAPyHRZurQO0ntIyeOx hvLa+M6qRyyiYr74NGeNWXVCe56NpGAxYaTtkywp9Y7s9jmTocQTg9hw/1cjzSPkZ8mDtL um5NiBceFhJj0EXPqwnA72QkRHR4xhwl/A1Kvk2A5aCjw6xzhNp4zbDV9xpAhK4BDPZYAy Fvx7pnJ7KE3+Lhl+otjFSUka3bz6YaPmtQH16CQknlgVTq+coHZdGPvUgElHxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=afXE0rsz; 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=1734270909; 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=uGjDYZMshparHkDoOCzJ8wDmy2E65Ixw1jwseiQHe+A=; b=qWP+Go4EZCA+wgJcdJ99elEMvejWEZt/QuqdD4gPqIEbUxXFK4yvxFGVDBqp+41h5thjP0 VM2maYS9FvnkI7s77C7fyuV2z0pMgC6kr4SmI4Jnh9pigucZv/Y14GnjDJ/S2L1uUcwOHi Hsk8N3zASWMfdH+TDtUAabPmuO0TFz9G9IVR3bD/354N6F6016mPKZsg46UMOQBgKcKX+N xTDCRGBnIE+n9Q1A4ZeCjO+/PM9SaGRYO+IKUBBZj5vHzvrjzVQqbw/7OEknjpk/BIb5Sw 6N/ZPpJq+WWd7miEUgUQXaU3mY969BUBABIFoByRGf7QjNdxORaeZhSmBXT22g== 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 C594E622EB for ; Sun, 15 Dec 2024 14:55:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMp4j-0002TX-A9; Sun, 15 Dec 2024 08:54:25 -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 1tMp4h-0002TI-EP for emacs-orgmode@gnu.org; Sun, 15 Dec 2024 08:54: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 1tMp4f-0001cy-9y for emacs-orgmode@gnu.org; Sun, 15 Dec 2024 08:54:23 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B5E59240101 for ; Sun, 15 Dec 2024 14:54:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1734270857; bh=fHhL6hk2RA8kBOuthFUcmWJXSd1kf5EhlfojVrXj+/c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=afXE0rszjn2OaWceketCzWsPr24nh1/z0RDnSnrqZEICp427w75s1bk2FcYSnqZWb 0td0NQWnuDAZgfggDWPQ3o4UAlXjyk2St30NodWNrjcJnK/Gnjpf5iMR/aWj7AzXAn IMoce7zFZK+v37H3/KI2pDYJZfIYeQhSQVpMxndQCJLb3p1zAjt/c43KHxoAG6fxWN oAKZdFEkPKDHG2l32vvbUb6yiembS9BMCGvcleYfibC656k2Di0gdm+KuejaLPeZ5C weDTaT/bpnI18BfFOpVlXwZ1ZEk584fiDTMhuZ8pXXturhMXb4UG3b3YMWwx6XHfN3 knt6qMVYBGuQA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YB4Lb4LV5z6tw9; Sun, 15 Dec 2024 14:54:15 +0100 (CET) From: Ihor Radchenko To: Gilles Marait Cc: emacs-orgmode , emmanuel agullo Subject: Re: Change behavior of "org-babel-tangle-publish" from org 9.6 to 9.7 -- deleting source files and not tangling properly In-Reply-To: <878qvtkwhn.fsf@localhost> References: <652111520.30366591.1725288746643.JavaMail.zimbra@inria.fr> <87tteopvxw.fsf@localhost> <1781466320.35797146.1725958169824.JavaMail.zimbra@inria.fr> <878qvtkwhn.fsf@localhost> Date: Sun, 15 Dec 2024 13:55:44 +0000 Message-ID: <877c819hjz.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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.03 X-Spam-Score: -5.03 X-Migadu-Queue-Id: C594E622EB X-Migadu-Scanner: mx12.migadu.com X-TUID: JFJ9ljmXX/rg --=-=-= Content-Type: text/plain Ihor Radchenko writes: > 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. Gilles, may you please check if the attached patch works for you? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-babel-tangle-publish-Keep-the-original-tangled-f.patch >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 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--