From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YLycCkTqf2EDnAAAgWs5BA (envelope-from ) for ; Mon, 01 Nov 2021 14:23:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UNcsBkTqf2GrNQAAbx9fmQ (envelope-from ) for ; Mon, 01 Nov 2021 13:23:16 +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 77C6368B7 for ; Mon, 1 Nov 2021 14:23:15 +0100 (CET) Received: from localhost ([::1]:35768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhXHN-0004NQ-Nh for larch@yhetil.org; Mon, 01 Nov 2021 09:23:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhXGq-0004N2-SZ for emacs-orgmode@gnu.org; Mon, 01 Nov 2021 09:22:40 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:45831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhXGo-0004qL-03 for emacs-orgmode@gnu.org; Mon, 01 Nov 2021 09:22:40 -0400 Received: by mail-pl1-x634.google.com with SMTP id f8so11525424plo.12 for ; Mon, 01 Nov 2021 06:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=hUEmgYdqcNFfqvKtfZ1URUUOSD0+J34ccGp66O+pCfs=; b=JfWlNK3701tsRMJDhC8lP7ErppCRwzSq+qUuTqONK+T8NiDT93QFfXu7BU63+MR3Hk /wEIwFZv6Fr6kGlqW/fPm4pS7aGLJASk2Zbrw/USPvIt0cY6Fc2709RURGHluXJ495Om FmF3iKlqrYHuxIgMU5El95hnGsbTWTYp52AouV7KKsGvwt+okdCNCMRsiYnQYqFbcHL9 Uq6b/15kSQuboVaDiHfQCkBhvZQUkoDwzv93za8eI9EHalqrmVQOgFMeEnT71IOC1Ezt jdpBcxsbp1mcVsBSs3NobnfDwGizTHP+1lbKzEGn4zuwYmZ/tVzFeD5/aYQVbQZvuZs4 KK+Q== 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:in-reply-to:references:date :message-id:mime-version; bh=hUEmgYdqcNFfqvKtfZ1URUUOSD0+J34ccGp66O+pCfs=; b=E8eZhlsgbSaV0tIFv2TdIcgqBGRWPhbdokEK4KN4IOzUDjKrshH9VjW8zifYoWlUdy Q7FmWldN4UhFBVPI34txHja4H8qVojtFygh1henQyr2nULkf5gE6LgMHdcK/cj8U/YcC JtOxh25FikUJ4Ga/oKR0c/zBmnQG/AC6joOruFWUog+kp9S+qORqlrismS84rIUUiHMC dXgOcOt3S28GW09ciVoSaNx/EcdbTTuXzyp0hxdIv0PW/JbLdHGlaDgIUdOu7CmcYQcA jSMhMVnsRlJBZooRhRvDLzj+nsWfCxUHVizaAn5du/O4+LwBQ6S2edI+V3rYnEGxRJux 7h/g== X-Gm-Message-State: AOAM531oeVlNOQPj/D7+MRzIBedPir0t+HW82Nn92sIvWSo8nNA8iaRh lsLX98+DEGTpuxQBazf3nRM7cjpDMWuK0U7m7Wk= X-Google-Smtp-Source: ABdhPJyo55GC+ythJyWIKpVrREru8AWPad8+Cgq74DlJEhiUViFcf54U426WP+P11khyEZgZsyTlwA== X-Received: by 2002:a17:902:9887:b0:13f:7704:425f with SMTP id s7-20020a170902988700b0013f7704425fmr24952343plp.20.1635772956392; Mon, 01 Nov 2021 06:22:36 -0700 (PDT) Received: from localhost ([101.99.64.65]) by smtp.gmail.com with ESMTPSA id a12sm17993212pjq.16.2021.11.01.06.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 06:22:35 -0700 (PDT) From: Ihor Radchenko To: Noboru Ota Subject: Re: Introducing Org-transclusion In-Reply-To: <87sfwgme9s.fsf@nobiot.com> References: <87fssispc2.fsf@nobiot.com> <87h7cysjf2.fsf@localhost> <87sfwgme9s.fsf@nobiot.com> Date: Mon, 01 Nov 2021 21:24:01 +0800 Message-ID: <87v91c9fgu.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=yantar92@gmail.com; helo=mail-pl1-x634.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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode 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=1635772995; 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=hUEmgYdqcNFfqvKtfZ1URUUOSD0+J34ccGp66O+pCfs=; b=R4tfx6UBnDHYmbEJffzKavbtxn4STzRN5AMtbFJOP7yVLoeqd8bz5qcYNyJPNxjBgPMQiP ZA6IJcyX7xahG6zek1pqh94a5fM9CZEfeK6ME4oE779IDr/qll/WxnnydOlGuS4l7Fyusi BufVjqM03pwrzcS+tIJBphMwbTv4GT74WxQMtR94Y5B49g19sqzrKKDSVaE1fF/XymeCrW qkRQhQphzS0QXiCtHoYdXE3kk7FUlgj/FVsfu8nsCY83ZTkJoNuQzFvhTKrQ12zoYX+RZf bwEO9M7Gfg1XSu6qgTMGRhAtHdXk36aLt1UrjCFRYwWJ3OCp0uBqX1gfMaHwGg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635772995; a=rsa-sha256; cv=none; b=LdsuhDwzMXsADCushaAPt1RO02mmG6b5mt5n3XHvbmYWEB/TM+qNhjGrwweX7cWpb+7EuB FAko2j1jg2BXB1qsBBLIROzjDU7D/m8VukJH0hhI3ra5pNIOqOnAvQum5i8SlCIT//hmuU wbKhc/exjW0MPpwJjH4UQ2/4TF4NMVxavVfeaD0D0yLcX8g/2jTOElxO5/zllk5cILXVD+ eNrWkRp7B1R1BPQwgL2R0BGt249mjKrNjWLFyxOo9JOtEaFD2EbWLV9xGPpDXAZYawhmgu nFjulaYBZPXFGr4cLKGx6XzqeunWqFw2aeJB1nJBO6MK/z5Pu6mebVPTOetiXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=JfWlNK37; 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.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=JfWlNK37; 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: 77C6368B7 X-Spam-Score: -2.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: judtsZI/Ypos Noboru Ota writes: >> You have my +100500 to have this package as part of Org :D > > Thank you again :) Is there anything I can/should do to make this > happen? I would be happy to email the whole package as a "patch" for > code review, if this were the way but I feel that might clutter this > mailing list too much with a large amount of text (?) Attached patches is the workflow in this mailing list. Do not worry about cluttering. Clutter is meaningless text, not a patch. We have recommendations about submitting new patches at https://orgmode.org/worg/org-contribute.html Once you submit _something_, core maintainers will be more inclined to jump in and provide their opinion on including the new feature. >> 2. A much faster tangle system. If we can directly transclude and sync >> contents of source blocks with actual programming language buffer, >> C-c ' can trivially support flycheck-mode and provide a more >> IDE-like experience while still benefiting from literate programming >> style. > > It has ":src lang" property and can transclude a specific range of > source code into Org's source block. It is essentially read-only copy of > the original, and you can use "C-c C-c" as a normal Org source block to > execute/evaluate it. I actually had something slightly different in mind. If we have a way to copy and sync text between different places, we can as well compile all the related source blocks into a temporary buffer in the correct prog-mode. Then, C-c ' can simply jump to that buffer with all the code from different source blocks bundled together. Changes in the temporary buffer can then be synced on exit. > For flycheck-mode, I am not sure; I don't use it (I use built-in > flymake). It may be an interesting experiment for me, too. One thing > is that transcluded source blocks are read-only. I think it will > require a bit of work to get the correction to work on both the > transclusion and source buffers. Can be flymake as well. The problem with current implementation of source blocks is that only the code from individual source block is visible for flymake. Imagine the following #+begin_src emacs-lisp (progn (message "A") #+end_src #+begin_src emacs-lisp (message "B")) #+end_src If you open the top source block with C-c ', flymake will report errors because of unmatched parenthesis. The errors will be correct from flymake's perspective because all flymake will see is text in the first source block. However, the code is correct when you tangle the file. If we can have a single buffer with all the source blocks, C-c ' can simply jump to that buffer and narrow to region representing the current source block. flymake will behave correctly because all the code will be present in the buffer. Moreover, the user may widen the buffer conveniently see all the code together. Tangling will be mostly a question of simply saving the temporary buffer. Trnasclusion is required to correctly keep the temporary code buffer and actual Org file in sync. Of course, things like noweb will be tricky. You may need something similar to bi-directional text transformation like implemented in lentic, when changes in text are not simply mirrored, but the text is also transformed when syncing transcluded regions. You implemented something similar in the :level parameter. > Org-transclusion might provide some steps forward for some of the > desired functionality discussed in these threads. Especially for the > "cloning" a body of text across multiple buffers, I have factored out > this part and created a stand-alone library called "Text-clone". It is > available in the same repository at > https://github.com/nobiot/org-transclusion/blob/main/docs/text-clone.md. I noticed that you are using overlays in text-clone. It may potentially cause slowdown in large Org buffers. Of course, it does not mean that org-transclusion should not be accepted. Just something that may be optimised. Best, Ihor