From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +MsLEiWic2VZpwAA9RJhRA:P1 (envelope-from ) for ; Sat, 09 Dec 2023 00:09:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +MsLEiWic2VZpwAA9RJhRA (envelope-from ) for ; Sat, 09 Dec 2023 00:09:25 +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 781F610CCD for ; Sat, 9 Dec 2023 00:09:24 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=Fzjl4ocX; 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=reject) header.from=mailbox.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702076964; 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=k6YgCNkyjfKcvQUR9VozrAetoVOLeVYfeiM5BElFYMs=; b=UrnKXMy+dOa4VU6w9lx1F5ev4BB9z+fX5Zq0oyVpVnj+vzEQqpynmALpYY6p7emBV3Oa+r 2GwIp15OHkHk6HK5/8ReS1oABvRhuG2yaWgAeGFyUh4Ay/NJGY1WgAG4r+fx1ygNYIR2Kx up05usRNaCR6OCtMEvjGXpQbc5JTmSRFz/O+5zuDKSf+HILyTVfhhPqAxAoRAtiC60oAt5 yvNAbpCnwEKbgmE2lXBJZkbmjxcnDmdr39Py/zKLXG7ZGmnrCi8C6tJ73Npfe55Gd97eoo nGX/oSWvKIJtrIeoHOfMHZX5nlw8o2Cf2YOKcT90A3nndIE8hBmzbhR/sA7rzQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702076964; a=rsa-sha256; cv=none; b=P4jwOt+y2yh6KBAG7l4MvbHiWVWcpHNuVeTqd/qr8v+uk6CLX4ZQEHbLtwPMUpxrQ6hodb 7HTceT3qNjlSAU/G+WBSarQ36Kz5UVoKEnss0iV/EaRzKkLxxGr3LYN0eXWZJUIIdAtngU bTpNbQFDij8Xg3lEWnoW3NKZH5nL/0kIf5q8q4E9KrqEbc4yswMWoIxjJLBC1xx6OkZcEd M//03CxT4x9i4tGnEZ4c1xEW+FszgxV9kY3y0ojlYcEnD9q5T8vt+fD3X09J7OGv1TgBom GtXcFXD9fiyzKWGkb4rDIuTeJwTUF9NbUC4CwArqJQCG+mbTFD7UEw1ntRORhw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=Fzjl4ocX; 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=reject) header.from=mailbox.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBjxP-0004AA-Uj; Fri, 08 Dec 2023 18:08:31 -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 1rBjxN-00049o-5w for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 18:08:29 -0500 Received: from mout-p-103.mailbox.org ([2001:67c:2050:0:465::103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1rBjxK-0002YQ-4i for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 18:08:28 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4Sn6Hz58V5z9sWZ; Sat, 9 Dec 2023 00:08:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1702076895; h=from:from: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; bh=k6YgCNkyjfKcvQUR9VozrAetoVOLeVYfeiM5BElFYMs=; b=Fzjl4ocX+i/oiwsJcWd//yEAaXzQcieB/XM0my+idIGqnKqV/fDkH3Ht2zPurPQVpcUeT+ Gfp1rh3xU28EKcUcFmSxZQuqT4UJ9cb/lVUaRi/IfoQzRAfSk9go8VdrLT+X85pdTJSO/v 7cJgwij3oFDY97B7Y8D9VzzpZAk5eoAinQTPkwQuyKEwIGKL00dbmFMpRfpx3BD7eluvcm LdHbe4MIAcD8HtO+WsrdWq1Ta7IszXYsY39H08sKjT9M8YVS+XToNYHMJRMQan0vNnZmIQ 5Csxnvq+CI8QTXWy13Ff3heAXbjiU/VuqBmxsv55U/QP2Qv0YnWXfkBNMp2Prw== From: Antero Mejr To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Move files when using org-babel-tangle-publish In-Reply-To: <871qbwcr7f.fsf@localhost> (Ihor Radchenko's message of "Fri, 08 Dec 2023 21:36:04 +0000") References: <87bkbsgx68.fsf@mailbox.org> <871qbwcr7f.fsf@localhost> Date: Fri, 08 Dec 2023 23:08:07 +0000 Message-ID: <87v898mgx4.fsf@mailbox.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-MBO-RS-ID: 797da5050e35907aeef X-MBO-RS-META: kysiiet7pfnd1a1i87kh5mj99grrbga9 Received-SPF: pass client-ip=2001:67c:2050:0:465::103; envelope-from=antero@mailbox.org; helo=mout-p-103.mailbox.org 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, 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: -2.81 X-Spam-Score: -2.81 X-Migadu-Queue-Id: 781F610CCD X-Migadu-Scanner: mx11.migadu.com X-TUID: AuxV/vtxSJ5y --=-=-= Content-Type: text/plain Ihor Radchenko writes: > 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 Yes I have assigned copyright to the FSF already. > 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 ? > 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. Fixed in attached patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Move-files-when-using-org-babel-tangle-publish.patch >From 9cc194dcb9bf6825d68aac3118f18ae96b8642a5 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Fri, 17 Nov 2023 16:06:53 +0000 Subject: [PATCH] Move files when using `org-babel-tangle-publish' Fixes `copy-file' error when publishing to the current directory. Don't leave behind the old tangled files when publishing. * lisp/ob-tangle.el (org-babel-tangle-publish): Use `rename-file' instead of `copy-file' on tangled files. --- lisp/ob-tangle.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index b30fd9274..e16b9e42d 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -219,7 +219,9 @@ Return list of the tangled file names." (unless (file-exists-p pub-dir) (make-directory pub-dir t)) (setq pub-dir (file-name-as-directory pub-dir)) - (mapc (lambda (el) (copy-file el pub-dir t)) (org-babel-tangle-file filename))) + ;; Rename files to avoid copying to same file when publishing to ./ + (mapc (lambda (el) (rename-file el pub-dir t)) + (org-babel-tangle-file filename))) ;;;###autoload (defun org-babel-tangle (&optional arg target-file lang-re) -- 2.41.0 --=-=-=--