emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Dynamic #+INCLUDE content loading when revealing subsection
@ 2016-05-19  7:35 Steve Moreau
  2016-05-19  8:21 ` Rasmus
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Moreau @ 2016-05-19  7:35 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

Hi,

I have a question regarding the include of sub .org files into a main file.
As for now, I know it is possible to do that with

**** include file

#+INCLUDE: "archives.org"

The target can be opened with C-c ' into another buffer (which runs the
command org-edit-special)

Alternatively, is it possible somehow to load the target file *content*
dynamically on revealing the subsection with TAB (as it was part of the
current buffer).
For example, with an unknown tag such as:

**** archives.org
:INCLUDE

Then, revealing this section would load, shift, and insert the archives.org
tree below ****

I may learn, bind the shortcut, or make a macro to do that but I was just
wondering if it already exists or if you could suggest a better way I
didn't think of, especially for the fact that once loaded/revealed, the
buffer is like there was just a single file (which is better for me to
search stuff).

Finally, if it doesn't exist and you think it would be nice to have, would
you please suggest an entry point in the source code to start digging ?

Thanks.
Have a nice day!

[-- Attachment #2: Type: text/html, Size: 1568 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Dynamic #+INCLUDE content loading when revealing subsection
  2016-05-19  7:35 Dynamic #+INCLUDE content loading when revealing subsection Steve Moreau
@ 2016-05-19  8:21 ` Rasmus
  0 siblings, 0 replies; 2+ messages in thread
From: Rasmus @ 2016-05-19  8:21 UTC (permalink / raw)
  To: emacs-orgmode

Hi Steve,

Steve Moreau <moreau.steve@free.fr> writes:

> Finally, if it doesn't exist and you think it would be nice to have, would
> you please suggest an entry point in the source code to start digging ?

It does not exists.  To load all included file into your buffer you can
use ‘org-export-expand-include-keyword’, but it’s a one-way import(!).

What I think you are talking about is combining two files into a single
buffer, dynamically.  I presume that when one clicks "save" the changes in
the surrounding regions 1 and 3 are to be saved into file 1 and the
changes in region 2 are to be saved into file 2.  But what if you add
lines to the bottom of region 2?  How would Emacs know to which file it
belongs?  You’d need some sort of delimiters.  Maybe a couple of (visual)
markers would be enough.

Anyway, such infrastructure should be part of Emacs-core IMO.  If it
exists, you can try to incorporate it into Org.  See
‘org-export-expand-include-keyword’ to familiarize yourself with the
current implementation.

Hope it helps,
Rasmus

-- 
Governments should be afraid of their people

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-19  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19  7:35 Dynamic #+INCLUDE content loading when revealing subsection Steve Moreau
2016-05-19  8:21 ` Rasmus

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