From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: transcluding some org-elements in multiple places Date: Wed, 14 Dec 2016 11:55:44 -0500 Message-ID: References: <3d4bfe3d30ae4c5a8be905fa6b15f350@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87shpx5aov.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHCrl-0007Ym-Qc for emacs-orgmode@gnu.org; Wed, 14 Dec 2016 11:57:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHCrg-0004iN-KX for emacs-orgmode@gnu.org; Wed, 14 Dec 2016 11:57:17 -0500 Received: from mail-qt0-f179.google.com ([209.85.216.179]:33327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHCrg-0004eW-G5 for emacs-orgmode@gnu.org; Wed, 14 Dec 2016 11:57:12 -0500 Received: by mail-qt0-f179.google.com with SMTP id p16so28597662qta.0 for ; Wed, 14 Dec 2016 08:56:49 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: David Talmage Cc: Org Mode Mailing List David Talmage writes: > On Fri, Dec 9, 2016 at 11:28 AM, Eric S Fraga wrote: > >> On Friday, 9 Dec 2016 at 15:29, John Kitchin wrote: >> > Hi all, >> > >> > I have an idea for how I could transclude "copies" or links to >> >> [...] >> >> > Any thoughts? Do you see any potential issues? >> >> Potentially very interesting and useful idea. Some thoughts/issues: >> >> > I'm interested in this, too. In my lab notebook org file, I have a section > that should be put into its own file and either linked or transcluded in > several places. Transclusion would be better because I could see the text > without following a link. It suits my lazy nature. ;-) It turns out to be pretty easy to see the text; that can be done with a simple overlay. What is not easy, is to be able to edit the text, or use the text with org-machinery, e.g. org-map-entries. The text in the overlay is not visible to the org-machinery, so you can not get properties, edit it, etc... Editing could be made possible with a special buffer, but it doesn't seem likely that you can make the overlay display work with many org-functions. I did have some success making bi-directional editing possible with modification-hooks on an overlay on the copied text, but it is tricky to do and I ran into some other difficulties I have not been able to get past. 1. having a transcluded headline at a different level than the source. E.g. I want to group headlines under a heading in one document, but they are all first level headings in another document. 2. having an org-id in more than one location confuses org-id and causes some issues. This suggests you might want some kind of transcluded id, that is different than the source id. > > >> ... >> >> - what about more than level of indirection: link to a trancluded >> headline which transcludes to another etc. What is shown? Is there a >> performance hit? >> >> > It seems to me that transclusion should be transitive. A transcluded org > file should be able to transclude other org files. It should be > transclusion all the way down. > > It also seems to me that org-mode transclusion must detect cycles so that > it does not infinitely transclude documents. that would be a good idea! > > - what happens if the destination moves or gets deleted? the link to >> it, which looked like something "complete" is now meaningless. This >> could be quite confusing. This is probably the most serious issue. >> > > How does org-mode handle broken links now? That's probably the right way > to handle broken transclusion. > > > >> - the table aspect is almost a "view" on a database which is really >> appealing but would benefit from a fully defined syntax a la sql? >> Would table formulas work as expected from the view of the contents? >> >> > Why wouldn't table formulas work? Transclusion is/could be/should be just > another way to put org-mode formatted text into an org-mode buffer. > > ... >> >> - could we have "read-only" views? I may not want the original touched. >> > > Perhaps that would be property of the transcluded document. > > > >> - how does an export work? On the view or the actual contents? >> >> > Export works on the view. -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu