From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QPk5KMAQAWIq8AAAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 13:29:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id PhXqIMAQAWK6dwEAG6o9tA (envelope-from ) for ; Mon, 07 Feb 2022 13:29:52 +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 40DE9469EA for ; Mon, 7 Feb 2022 13:29:52 +0100 (CET) Received: from localhost ([::1]:59372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH39T-0002T4-DX for larch@yhetil.org; Mon, 07 Feb 2022 07:29:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH36B-0000YI-J1 for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 07:26:27 -0500 Received: from [2a00:1450:4864:20::529] (port=44545 helo=mail-ed1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nH36A-0002I3-2s for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 07:26:27 -0500 Received: by mail-ed1-x529.google.com with SMTP id bx2so13291885edb.11 for ; Mon, 07 Feb 2022 04:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LG1gxSh6Q6CDsatwPUgXzEASGvOI312wNijG2vgDJ08=; b=U+CUaq3KnPN4H+9rBWFQZj5MVB1sUOEYe81o8NDe9SAQsEEBXUgJLqfNnMgRXLYZuz y+IVaim43ZLgCQoJv5hv/LPUzmShJY5laXrN4YsoAXrJZAzoyaFa3t02/t/CgZTkL/o7 siuF3LbLNzYDDBBWtvXw4xE5OdPBYhIU/4+3BztEBtNccuwkYFu7yTjY7q3vNdAcMSaw U2jiHgPEFGWySUwn8f57Blfg9VSjoVI1w4Lmvch7aP8bFdSuuMKeGSSbwIxVOy9j7xhc D8kH9XM2YICwUY1Bh5a9+fBJfteo/SKHuqIi0KIlcqHZYdjZX4cDl0i2fLBZ2a+Jt2k+ +oCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LG1gxSh6Q6CDsatwPUgXzEASGvOI312wNijG2vgDJ08=; b=Jwzi5VccyB9ROCftj9eG5uunujOQi/59bxeeL3wlekobOGSSTi97MbqEZ+9SrOixHd 5QXFUc9L91IJuYOiXJWNlimMXZhVnH3xvgRIALO6wkrohc8GxTbCPcCqY6CrerfdE6MN bRpDDA3+9hO758/nqa/RWHgbeUZKAwQerOxpKT7xB9qPAO7BofUQLo4ciOf/RzPOj4a7 WFqieFXAjCon6jRFSYce3Wr4zPiolb614CUoWBNRLXFi6S8RmO5flpxge7+7Q1toPAlx N9xoJuBEmHQ3Rfx5rb5jqJQj9QvNyc4/v6ng8H3QcubT1A6zDKyqtq0mfqUpSGzMMy88 kozA== X-Gm-Message-State: AOAM531Kfk1C5FsFXbI4Xn7XItfZUOX2/ovNH5b4DtMChtUEA3BVBOUV YH/x2upE3VHWWvtv2kRqDJOEdph7cFZenA== X-Google-Smtp-Source: ABdhPJzS5tpi8+qlqLE4nlYUhEnW4m2TZlAc60hnaoyQxcX2WLhwkfi0VpeK9/Xs+53FecBCXWQ+rA== X-Received: by 2002:a05:6402:5212:: with SMTP id s18mr13782943edd.379.1644236784175; Mon, 07 Feb 2022 04:26:24 -0800 (PST) Received: from localhost ([91.210.107.150]) by smtp.gmail.com with ESMTPSA id m25sm2477837edr.104.2022.02.07.04.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 04:26:23 -0800 (PST) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [RFC PATCH 1/2] org-babel-tangle-single-block: Do not create comment link when not requested Date: Mon, 7 Feb 2022 20:31:14 +0800 Message-Id: <0f17f3041df08edd9508fdf8e5519f6aa1ecca43.1644236545.git.yantar92@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::529 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=yantar92@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Ihor Radchenko Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644236992; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=LG1gxSh6Q6CDsatwPUgXzEASGvOI312wNijG2vgDJ08=; b=A4T1Fghc8RpE2BF/SSXWAyAn+U1naUa3fCUy7PbXRKD8MP68E0OznbC3tKyHrgibr37daY M8pfjJ76P3Q1/TOzfM0rBsGJZy20TyAr/nTACQFgDp1KdmY8lizZQcbueOTH93vP3uau8W bq7Q/gXJofG9ALHWomuHAkzDwn/b6yxKdLhL/Fnr9VseTWXKLg0AmGE1+BL0Z6abn3huvy bPtgYPTXg4Mqk7hksomjsuYIj5hdwFotbjF4qyHVU7WBtLAilv65z54a9cDkH6R/qklXfN oCVrSLhuEcNTPuQJEpMqaeNszYQom/M1fobWf6jmBtnfNI8jCgYTw7WfngeIfQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644236992; a=rsa-sha256; cv=none; b=G0uJeTJdjxG/7JSIjNszx1E+eaX4Q9lxw0NYIijFrLMDPL7R3W7x4A/aYR1PXsr0k41PBB PCkJLN8Io1eimyE2mafBWcedMBr8WcJko02Y8Q8DFO4gjwMIgoCMOHYrdOPYt7OcibeG+N fNXNKtwG17xHrwiJvux/bytsgTt1G88ESV4tNYs7jl+6qnacYxzsQH3vmgCbbqaNw4oMSG h5rwNB47oY7KJESv63vO4dmAPzbr/JiOZ7pTUJuYIed01Rv5O5v0CD5upbqJtt5Nm1PA/R kXNY3K6pcaG9GRCFPSNFzYPF9kG8tdwx9WHYrUO+36iOPQqKaPF0f3YZY2WiZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U+CUaq3K; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -2.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U+CUaq3K; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: 40DE9469EA X-Spam-Score: -2.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: aXsmf2ZPU82Z * lisp/ob-tangle.el (org-babel-tangle-single-block): Do not spend extra time creating link to source block when :comments is set to "no". --- lisp/ob-tangle.el | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 7ae319d4f..85356d537 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -472,16 +472,20 @@ (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* ( - ;; 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)))) + (link (if (string= "no" (cdr (assq :comments params))) "" + (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 creating unexpected + ;; file modifications. + (org-id-link-to-org-use-id nil) + (l (org-no-properties + (cl-letf (((symbol-function 'org-store-link-functions) + (lambda () nil))) + (org-store-link nil))))) + (and (string-match org-link-bracket-re l) + (match-string 1 l))))) (source-name (or (nth 4 info) (format "%s:%d" -- 2.34.1