From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0Pe/GIpySmQYzwAASxT56A (envelope-from ) for ; Thu, 27 Apr 2023 15:03:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SC2fGIpySmRoHwEA9RJhRA (envelope-from ) for ; Thu, 27 Apr 2023 15:03:06 +0200 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 0538E2AC13 for ; Thu, 27 Apr 2023 15:03:06 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ps1GF-0008Pj-3n; Thu, 27 Apr 2023 09:02:12 -0400 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 1ps1G2-0008P7-S4 for emacs-orgmode@gnu.org; Thu, 27 Apr 2023 09:02:00 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ps1G0-0006bh-Vp for emacs-orgmode@gnu.org; Thu, 27 Apr 2023 09:01:58 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4efefbd2c5eso5978638e87.0 for ; Thu, 27 Apr 2023 06:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682600513; x=1685192513; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=JCOTd6Kfq8g9Gx2gmUtOuMCNA2SXFwATXqX/t1fEix8=; b=oTCCmHAdGGvTJXZIF6LEFSll750wkxOEgxHJajA8c7CzsjARjrhsmRbDFpac/TR9N3 9vou9Yd/qVRi06hWo1HgUcrjRNof+fT/BLfbTs5EEMc4ND4HqDUH30Nw0D5Guv5Rjd/y SNTjQ4oiE+5sne/NM9Y8HHNDG+IbUtZ8W7dfGh110RkD6BNlvaothwyk/FTW/9mqKmH8 Dt7TKvglpYZHKABuxlr0jw58u8qaCs5Z1JGTmuBHjTMYqMsFYDu5MkIPz5ZTZtYwTPcw kp1wcbmYvqtfYeSSIQlcgJNtX3nXiPxi1M830xoJE+PXfX2HzNLnndRrXF3vxGTMPCqn iw8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682600513; x=1685192513; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JCOTd6Kfq8g9Gx2gmUtOuMCNA2SXFwATXqX/t1fEix8=; b=d0frm6SW3bW1BiSWuNAenwMbeUPI/EVxCdtiM2RjmWogOe7UYvHV0HjGNy+Pp58NG/ 0U4ksr6Hc+SsNlVS/q/x74AN2WkAST4MhcbUujCl5Zwe12z6PUDV6l0vqEIHdPe4Myrb NmXaEpkQLT7QMwI3efp3hzWXX0TFHaNeRxA89twBXPoKhZnHqU0paoJ1XLKE+RVsx8CG 9b7TZtP00YlzW0+cH6R+OeUGo1scZ/KClIabzuclJ4YJwxyXy5OQVXfps7U1OeG0yXtU QyUN+SCjhrYb9gqe/GZBgBfPzFaRC5WGGYP++zNdXtOHKZJARV5WNAUURrFHo/KjSiLn UhJA== X-Gm-Message-State: AC+VfDw1BMwNz4Wg5684wApvVELkvs63u3xNibg7QMRkmRIR/vs5Li/I oksEcq1Qpl8Hr98IzcTfeJwpH28SaPbfMS6cXT3cOIo50Ug= X-Google-Smtp-Source: ACHHUZ5JvaAhuK5XAwqEQW1jVVVe+wGwUYJ9r7N6mO4Q/9tXDxvBl5T5zXkpx9Fr1kyaHz7O7lYRMbf8Et18gMti7Dk= X-Received: by 2002:ac2:54b5:0:b0:4d5:a689:7f9d with SMTP id w21-20020ac254b5000000b004d5a6897f9dmr561425lfk.57.1682600512609; Thu, 27 Apr 2023 06:01:52 -0700 (PDT) MIME-Version: 1.0 References: <87edo5o7n8.fsf@localhost> In-Reply-To: <87edo5o7n8.fsf@localhost> From: Mehmet Tekman Date: Thu, 27 Apr 2023 15:01:16 +0200 Message-ID: Subject: Re: [ANN] lisp/ob-tangle-sync.el To: emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="000000000000da93fc05fa50f52f" Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=mtekman89@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682600586; a=rsa-sha256; cv=none; b=NpPajxCynUXqyKJttjfl28i/iOTSa1NzC0cScsOettZr3/iMdg0FbTeaYZSfMfdw/MMmrv 7LmkC57Hp+CFJUvp426cPdScGkuWnRV1DucFytCvDmOwX92ytQnCUWh40zzCLj83TmM5Bi ZazMZEgNZOh2JJnbH0g4te5rcGHL0vsJXAfSCFWNG+vNw8JslR3SeZNF4InfiJ5QCEj2DA LU3hfAM0G8Yk2Q/OH5w5vBc51bqa+yOdchMpv2rYMcWKqNcD86tkjw/daLYGYYSAkP/VNx h+jL6MXgVb6GifD0QimwZASg300ySG61pDGOPtKfhrw8fDKH5YgL6qV9XgDhRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=oTCCmHAd; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682600586; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=JCOTd6Kfq8g9Gx2gmUtOuMCNA2SXFwATXqX/t1fEix8=; b=Lwb4VFqqsug+yXL1YPdBTExZTNMRlHx0KK+am36M3zcLRGvjhTWqtv6yyZCVJZwSS/41O/ 97cqLgxZNeMKaGHfBTedO2K77oMiT4Q9Atdz7zVqbGwAElQ6RTzy/mLeDpFKnbgD2EbQWa xDvjieDGx+RGYCPFT/ejLLTP+TzseqYN0A9Eor4V9J/Azql4EY6Rkb22lSOfNgZJmNqbEU XpWPOpHGNyrC/zLuFFO4rlSgd8NxoSv30K6DkHdsLEUmcBCqeOUIy7ewhUjmX47ov59PpS yrb676MLG3r0CGnataXo+dYx9DOajAU53v/C03ay2QWeS2sBlsA39PTILnzNDg== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=oTCCmHAd; 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: -3.82 X-Spam-Score: -3.82 X-Migadu-Queue-Id: 0538E2AC13 X-TUID: 6SId0DtswF7z --000000000000da93fc05fa50f52f Content-Type: text/plain; charset="UTF-8" Ihor Radchenko writes: > Do I understand correctly that your package is adding the following new > features: > > 1. Automatically manages balanced > `org-babel-tangle'/`org-babel-detangle' in Org sources and target > buffers. > 2. Attempts to make more fine-grained tangling/detanging functionality > by controlling tangling behaviour on per-src-block basis (via > :tangle-sync skip/pull/export/both) > That is correct > If so, I think that (2) probably belongs to the main babel code > (`org-babel-tangle' and `org-babel-detangle'). Since you are > contributing to Org directly, you are free to modify these functions as > you need. > > Note that your current approach with `org-babel-tangle-sync-synchronize' > will give unexpected results when one edits multiple src blocks or the > corresponding tangled source in multiple places - the :tangle-sync value > is only checked at point and `org-babel-tangle'/`org-babel-detange' is > then called for the whole buffer, not just for the current code block. That's... a really good point. I didn't consider that I'm calling a tangle or detangle function on an entire file based on the =:tangle-sync action= of a single block... which might have different actions in another block for the same file! I've attached a toy.org file which should explain what the desired action would be in such a situation, and I fully agree that I will likely need to modify the current tangle and detangle code so that the sync direction is on a per-block basis, and not per-file. I will work on this a bit more and submit a full patch with this in mind. Best, Mehmet --000000000000da93fc05fa50f52f Content-Type: text/org; charset="US-ASCII"; name="toy.org" Content-Disposition: attachment; filename="toy.org" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lgz4uepu0 IytUSVRMRTogU3luYyBNYW55IEJsb2NrcwojK1BST1BFUlRZOiBoZWFkZXItYXJncy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