From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Moreau Subject: Dynamic #+INCLUDE content loading when revealing subsection Date: Thu, 19 May 2016 09:35:53 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c03d9a2ac3fe05332d064d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3IUu-0000Aw-Kk for emacs-orgmode@gnu.org; Thu, 19 May 2016 03:36:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3IUs-0007A3-Dl for emacs-orgmode@gnu.org; Thu, 19 May 2016 03:35:55 -0400 Received: from mail-yw0-x22a.google.com ([2607:f8b0:4002:c05::22a]:36673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3IUs-00079y-8q for emacs-orgmode@gnu.org; Thu, 19 May 2016 03:35:54 -0400 Received: by mail-yw0-x22a.google.com with SMTP id x189so69902788ywe.3 for ; Thu, 19 May 2016 00:35:53 -0700 (PDT) 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: emacs-orgmode@gnu.org --001a11c03d9a2ac3fe05332d064d Content-Type: text/plain; charset=UTF-8 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! --001a11c03d9a2ac3fe05332d064d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I have a qu= estion regarding the include of sub .org files into a main file.
A= s for now, I know it is possible to do that with

**** include file<= br>
#+INCLUDE: "archives.org&qu= ot;

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

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

**** archives.org=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 :INCLUDE

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

I may learn, bind the shortcut, or mak= e a macro to do that but I was just wondering if it already exists or if yo= u 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!
--001a11c03d9a2ac3fe05332d064d-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Dynamic #+INCLUDE content loading when revealing subsection Date: Thu, 19 May 2016 10:21:17 +0200 Message-ID: <877feqfog2.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3JD6-0000OL-37 for emacs-orgmode@gnu.org; Thu, 19 May 2016 04:21:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3JD1-0000cc-QU for emacs-orgmode@gnu.org; Thu, 19 May 2016 04:21:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:51550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3JD1-0000bq-Jp for emacs-orgmode@gnu.org; Thu, 19 May 2016 04:21:31 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b3JCt-0004O3-Ht for emacs-orgmode@gnu.org; Thu, 19 May 2016 10:21:23 +0200 Received: from ip-178-203-232-77.hsi10.unitymediagroup.de ([178.203.232.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 May 2016 10:21:23 +0200 Received: from rasmus by ip-178-203-232-77.hsi10.unitymediagroup.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 May 2016 10:21:23 +0200 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: emacs-orgmode@gnu.org Hi Steve, Steve Moreau 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