From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CNQSKsWLc2VzfgAAauVa8A:P1 (envelope-from ) for ; Fri, 08 Dec 2023 22:33:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CNQSKsWLc2VzfgAAauVa8A (envelope-from ) for ; Fri, 08 Dec 2023 22:33:57 +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 22241628CD for ; Fri, 8 Dec 2023 22:33:57 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YPXy8x+Z; 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=1702071237; 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=cNnIjfKLMoKpH2uG23VqU67/60UMg2bqIcRZYgLrV0Y=; b=NJbFODvEO8a8tiNIilnm1gluNrVWSCBK+tGUuPTQhIW5MxJ/qZkSu2yLbLJy9F576qWkjl WuHnGqzwkNxSu3RvHWF/9aOrnDouoRa7HBZdt9Ysojbvqyf8iygtuvZSghdSS5+Nuu25Bn s9kWfipphuq09g8/c+3uWxgVOXyefudoMLu56TtjAuF7LaH/8iaSHE0SaOJOc+Di7f7O/A ouYreQ4pSQ8UIk7O2O/x/W1mLPqxS9kUP3klM6og5YGcnuRQwbHbvr7vXU2nzBcNXU2Uee 6Q+Vtanwe9Vw+pLZvfoQFOgGKwcb2da2IhQc3cQgy+UjM7jQf3/5xLEVM1EFgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YPXy8x+Z; 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=1702071237; a=rsa-sha256; cv=none; b=tiH5EdtapNUrR6GFi1axgVZ2GyaCtylxV6uOd1Dazqgq8WBIHAlWfkVwN4GaWLDjSAzZiy Dd6P8hd5q/KXMi0y6Iw53EVuarU0y2LVlHMO9Vz4EIy/gwPs9NtalJR8GyVa3PWy2iglR+ 9DUe4tbLwx+q9DaUIz4O4VSvsE/moHvloQU9krDLR6nVXH4b6I5Jr7e4vN/TEq1n0QflQN 6in/SwxRRRl+GIf+oyey7l4979/qd6rf9luqeD1gHRCBuYN04tqRSMe405GW3UOJkdPt5D lOnwOOGwoIabH0vl+2mWn/HqDofTUV0rb6R6QByXnmYIVARWIHVtlL34G+SSiw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBiT9-0000Rg-CG; Fri, 08 Dec 2023 16:33:11 -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 1rBiT8-0000RV-4n for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 16:33:10 -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 1rBiT6-0007ZK-68 for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 16:33:09 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 4283D240101 for ; Fri, 8 Dec 2023 22:33:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702071186; bh=j2Cg3eG5taWnZlnvQw6EOqwtkRQcbmvZBWAgAtH2UKA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=YPXy8x+ZNNl2To3Prs0RZgXbHDJFs1iHvDjcR1NICT7XoO5abyzj3gEghsKhbl/1Q Yvucr6mApA2I6UssSaiWVWhzuzFfn/UG+SACBDohr0glQbBlkUKLBFJVphndJU6slr hlXxXSKzGDBMhgCmPh7E8vktNrqLMzR1K7uWGQFt+0Wkby0j57xH9lvSe4kOqzQfJG ZfAZ3dhKjh6e4MCUfhLywtjvoRAFjb/4nMdd+fuRQEOOalJZp1HtO/7kuf3Te2tlM8 xNKvmePll3pLoDhve84iU7vqiVSQKAAEuPAz0aJvxSM8EBIcYoapR1NIauPmqxyx4C 3tBFkNr73E5tA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Sn4B94szjz9rxM; Fri, 8 Dec 2023 22:33:05 +0100 (CET) From: Ihor Radchenko To: Antero Mejr Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Move files when using org-babel-tangle-publish In-Reply-To: <87bkbsgx68.fsf@mailbox.org> References: <87bkbsgx68.fsf@mailbox.org> Date: Fri, 08 Dec 2023 21:36:04 +0000 Message-ID: <871qbwcr7f.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -2.31 X-Spam-Score: -2.31 X-Migadu-Queue-Id: 22241628CD X-TUID: d7YXJVaXSAS5 Antero Mejr writes: > When publishing using org-babel-tangle-publish to the same directory > that contains the org files, copy-file will signal an error, since the > source and destination files refer to the same file. So use rename-file > instead. > > When publishing to a different directory, this change also cleans up the > old files, which matches the behavior of the other publishing functions > like org-html-publish-to-html. Thanks for the patch! May you please submit a patch against Org mode git repository - https://git.savannah.gnu.org/cgit/emacs/org-mode.git, as described at https://orgmode.org/worg/org-contribute.html ? Also, may I know if you have an FSF copyright assignment? If not, you also need to add TINYCHANGE to the commit message - see https://orgmode.org/worg/org-contribute.html#first-patch > Fixes copy-file error when publishing to the current directory. > Don't leave behind the old tangled files when publishing. > > * lisp/org/ob-tangle.el (org-babel-tangle-publish): Use rename-file > instead of copy-file on tangled files. Please quote `rename-file' and `copy-file' like I do - it is our commit message convention (https://orgmode.org/worg/org-contribute.html#orgd7441de) > - (mapc (lambda (el) (copy-file el pub-dir t)) (org-babel-tangle-file filename))) > + (mapc (lambda (el) (rename-file el pub-dir t)) > + (org-babel-tangle-file filename))) I think that it would be nice to add a brief comment why `rename-file' to the code as well. `copy-file' looks innocent there from a first glance. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at