emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: transcluding some org-elements in multiple places
Date: Fri, 09 Dec 2016 10:29:15 -0500	[thread overview]
Message-ID: <m2wpf93yus.fsf@andrew.cmu.edu> (raw)

Hi all,

I have an idea for how I could transclude "copies" or links to
org-elements in multiple places and keep them up to date. A prototypical
example of this is I have a set of org-contacts in one place, and I want
to create a new list of people for a committee in a new place made of
"copies" of the contact headlines. But I do not really want to duplicate
the headlines, and if I modify one, I want it reflected in the other
places. I do not want just links to those contacts, because then I can
not do things with org-map-entries, and other org-machinery which needs
the actual headlines/properties present. Another example might be I want
a table in two places, but the contents of them should stay
synchronized, ditto for a code block.

This idea was inspired by https://github.com/gregdetre/emacs-freex.

The idea starts with creating (wait for it...) a new link ;) In a
document where I want to transclude a headline, I would enter something like:

[[transclude:some-file.org::*headline title]]

Then, I would rely on the font-lock system to replace that link with the
headline and its contents (via the :activate-func link property), and to
put an overlay on it with a bunch of useful properties, including
modification hooks that would update the source if I change the the
element in this document, and some visual indication that it is
transcluded (e.g. light gray background/tooltip).

I would create a kill-buffer hook function that would replace that
transcluded content with the original link. A focus-in hook function
would make sure the transcluded content is updated when you enter the
frame. So when the file is not open, there is just a transclude link
indicating what should be put there, and when it is open, the overlay
modification hooks and focus hook should ensure everything stays
synchronized (as long as external processes are not modifying the
contents).

It seems like this could work well for headlines, and named tables, src
blocks, and probably any other element that can be addressed by a
name/ID.

Any thoughts? Do you see any potential issues?




-- 
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

             reply	other threads:[~2016-12-09 15:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 15:29 John Kitchin [this message]
2016-12-16  0:26 ` transcluding some org-elements in multiple places Matt Price
2016-12-16 16:51   ` Matt Price
     [not found] <3d4bfe3d30ae4c5a8be905fa6b15f350@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-12-09 16:28 ` Eric S Fraga
2016-12-14 15:55   ` David Talmage
2016-12-14 16:55     ` John Kitchin
2017-01-05 13:26       ` Matt Price
2017-01-05 16:37         ` John Kitchin
     [not found]           ` <CAN_Dec8C386-+mNODfrXZkMpoRt30xEUkjSMCZDOhpi-ydRDeg@mail.gmail.com>
     [not found]             ` <m2zij5qbci.fsf@Johns-MacBook-Air.local>
2017-01-06  2:17               ` Matt Price
2017-01-06  2:19                 ` John Kitchin
2017-01-06 14:30                   ` Matt Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2wpf93yus.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).