From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IKc5Ngbk6mC+XwAAgWs5BA (envelope-from ) for ; Sun, 11 Jul 2021 14:28:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iL7wMQbk6mCvPQAA1q6Kng (envelope-from ) for ; Sun, 11 Jul 2021 12:28:54 +0000 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 005FB2A9D6 for ; Sun, 11 Jul 2021 14:28:54 +0200 (CEST) Received: from localhost ([::1]:42410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2YZo-0001hf-2x for larch@yhetil.org; Sun, 11 Jul 2021 08:28:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2YZP-0001hS-Kt for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 08:28:27 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:35431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2YZO-0003DB-0n for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 08:28:27 -0400 Received: by mail-wm1-x32a.google.com with SMTP id k31-20020a05600c1c9fb029021727d66d33so7966888wms.0 for ; Sun, 11 Jul 2021 05:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=RIwspGGCkKP7ryPU9IQ7g5m/UZS3O/Ut7CEVqmGIMfI=; b=SAehU2sVOcxf6lGdE9E1+ue9U5DyWCoUzHpdy7peCV/qswv8CDMT7q+Zqa/r/dprSw TXQcUcqCXByRfcy1bwBQ2aXUq5ddX4jPW5TwFhdGGE/yVY36LLPinSla6yoV4mdVcCYy CmXdxGTFP8lNjddWiI1CUXf//0Y/oPw1xnxnYGJcibO1Y42/SjnKLUyYGmR3z41r3qj1 mKno4ZY2sN9yzOn+dsNTWhoBaPAWu4jylY+xNxuy9mp3MFOFajFNoSv/IGYQoOCOpDGo 5CiT69eOek3U0uClky+Lv0zp8AsRyKOTcztM8d5k6KqNiNp6Nd+evlufqXp4GvpI5MjH wnAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=RIwspGGCkKP7ryPU9IQ7g5m/UZS3O/Ut7CEVqmGIMfI=; b=L4Q5h1dI56Va+7c1POqbxop8Zzon6kD+pEcBHMW3gYQLyYxZ26JJ3w56VnKmYrKFk1 hQZHd0uQdYBOuFGyj+UzAY1VqlNnDWFpLLhK/dSfwogx4XhXW5z9jW5L/eGJEfQW0kRc IFDqxwaXiXkpJacZWKGeZJBfp5oCADlTI8DdrjsUKqaZGm69D30QnOQ+wzvcDroTchWP 7QbKP1ckky3UoQIYmS5CRTjtFXHq0g6Wiy72d113Mrdg3MA+l0Q6EjSnUnTl5aaJBoZ5 0Lfp2fgNjaFayCcgeEbJQxHhSk7C6r0oSQfyoiQVJF8i270C2D6Fai51fw0Wnt8bjPaQ 6Xlg== X-Gm-Message-State: AOAM531kfCXa0KuMojj94Z6otfI2ak+tAEjIWg/q7bgRpg4ymk//a16N r7GPiNgsfushdtV3b7OxZQaICd5SwWs= X-Google-Smtp-Source: ABdhPJztJ+fJzZr1I162mMAjmwOa9zO1yShxyTqrZO7gYnvdNmS/FG6O2JcOUqECudFvv1B06kl6Dg== X-Received: by 2002:a7b:c5c8:: with SMTP id n8mr9218137wmk.124.1626006504742; Sun, 11 Jul 2021 05:28:24 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id n5sm10853492wri.31.2021.07.11.05.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jul 2021 05:28:23 -0700 (PDT) From: Ihor Radchenko To: Rodrigo Morales Subject: [PATCH] Re: [bug] Setting org-id-link-to-org-use-id to t creates IDs properties when tangling In-Reply-To: <87tul2ihhy.fsf@utec.edu.pe> References: <87tul2ihhy.fsf@utec.edu.pe> Date: Sun, 11 Jul 2021 20:28:25 +0800 Message-ID: <87h7h1kpau.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=yantar92@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626006534; 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=RIwspGGCkKP7ryPU9IQ7g5m/UZS3O/Ut7CEVqmGIMfI=; b=shcQQbLVZZJexCX3g1X13ROhjmJYaIo3bwVb8Nl/gfroiQn6xkWzeRPWipNjWZlFoGvQj3 RonVoqwGIDdvVHv0YfFvNywcwhQVlikA8PsjHoH0Yq8W+DD2xS+0/sjn5OkPYg8nlAGJAF xXT7NrFHO4wNyb6WrmJvMRMPDjeAnQRGoQWX8Xu/UyqMkVNGye3lHtm6K9HXuhRPyRmb+s IKL2SlYqaQik8zmHDW0e4y3h0bUkl8l01uhR4PDAOmlQexIv4FrQ19R4FhOk/VsPWEy1Kp Hr+Dc5A/2qfUYdR8otKlIWWYHtb4/K+8dlrKQxtQSTcjc+NXVXaxiVlAxicCgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626006534; a=rsa-sha256; cv=none; b=l19fQsLjM08g5ywULAD3TyipFWMWHD90oZP1Q1NgTUxlS1zYNrTvn35VQjmE8lsiVA2eld UjXxliTocNQfizsfQvZmVorA8l6dokUfTQc/TE7pRhMaolH1P9VJz7mYrr+Z7Oo/o8vS1n fAxvrKR5uIpG1AxBz88UkPP+POYS9YA+15jon5+VDm6pp2M004yhe17kiwxEfFIOuMGByK ElFEsCv8pviIMemgGK/qPY1pIuThzxQfkAlQwDUg685lB6hhKCx9HIfI0WdSU5n03VdPnS ql9Pl+nVW0293GfVOgcYjdr1z92yyI3WC0zIvnHs7fFA5nQEnbzarNangfoSnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SAehU2sV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SAehU2sV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 005FB2A9D6 X-Spam-Score: -2.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: jcWeiQ8qqPnO --=-=-= Content-Type: text/plain Rodrigo Morales writes: > * The issue > > When setting org-id-link-to-org-use-id to t, an :ID: property is created > for each headline that contain at least one code block that is > tangled. Confirmed The fix is attached. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Avoid-creating-ID-property-during-tangling.patch >From 0ed6b52b8ded461ad6d172b9c2d49fd36d5df129 Mon Sep 17 00:00:00 2001 Message-Id: <0ed6b52b8ded461ad6d172b9c2d49fd36d5df129.1626006467.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sun, 11 Jul 2021 20:25:21 +0800 Subject: [PATCH] Avoid creating ID property during tangling * lisp/ob-tangle.el (org-babel-tangle-single-block, org-babel-tangle-comment-links): Suppress org-id-link-to-org-use-id during tangling. The links used during tangle process are transient and do not really need to use ID. Using ID may create unexpected edits in the tangled Org buffer when org-id-link-to-org-use-id is set to t. Fixes [1]. [1] https://orgmode.org/list/9eb31da73b12fcaf6820484834cc8cd3@libre.brussels/T/#t --- lisp/ob-tangle.el | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 2f60ef9a4..cec658f66 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -420,7 +420,14 @@ (defun org-babel-tangle-single-block (block-counter &optional only-this-block) (extra (nth 3 info)) (coderef (nth 6 info)) (cref-regexp (org-src-coderef-regexp coderef)) - (link (let ((l (org-no-properties (org-store-link nil)))) + (link (let* ( + ;; The created link is transient. Using ID is + ;; not necessary, but could have side-effects if + ;; used. An ID property may be added to + ;; existing entries thus creatin unexpected file + ;; modifications. + (org-id-link-to-org-use-id nil) + (l (org-no-properties (org-store-link nil)))) (and (string-match org-link-bracket-re l) (match-string 1 l)))) (source-name @@ -506,7 +513,13 @@ (defun org-babel-tangle-comment-links (&optional info) (number-to-string (line-number-at-pos)))) ("file" . ,(buffer-file-name)) - ("link" . ,(org-no-properties (org-store-link nil))) + ("link" . ,(let (;; The created link is transient. Using ID is + ;; not necessary, but could have side-effects if + ;; used. An ID property may be added to + ;; existing entries thus creatin unexpected file + ;; modifications. + (org-id-link-to-org-use-id nil)) + (org-no-properties (org-store-link nil)))) ("source-name" . ,name)))))) (list (org-fill-template org-babel-tangle-comment-format-beg link-data) (org-fill-template org-babel-tangle-comment-format-end link-data)))) -- 2.31.1 --=-=-=--