all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* temporary inclusion of a read-only file / inline element into orgmode buffer
@ 2021-01-06 17:47 HJ
  2021-01-06 20:18 ` Tom Gillespie
  0 siblings, 1 reply; 3+ messages in thread
From: HJ @ 2021-01-06 17:47 UTC (permalink / raw)
  To: emacs-orgmode


   Hello,

    I was wondering whether anyone here knows how to effect a temporary 
inclusion of a file into an org file. What I mean:

    I would like to use orgmode to keep a documentation / devops 
document. That document will contain commands ( with lots of 
start_src...end_src...results blocks), where such commands usually 
produce small results (20-60 lines), which are to be included inside the 
document. But, on occasion, the command will produce 2,000,000+ lines of 
output. Practically this is a difference that requires a different 
storage approach, yet semantically inside orgmode I would like to 
experience as little difference as possible.

   The question is whether anyone knows of a way to keep the small 
outputs "inline", but have the option of automagically store the large 
output inside a separate file (this file may be treated as a read-only 
file), but still be able to operate on it as if it was not an external 
file but an part of the current org file. Perhaps based on a toggle 
command, one could say "include all "external" files inside for a minute 
while I make my searches, and then purge the read-only "external" files 
out of current buffer to keep emacs small and speedy.

   This might be similar in concept to "inline images" - they are a 
display of read-only file into portion of the buffer - except that no 
searches and other text operations can be performed on it.

   Related question: Imagine you are browsing a document which contains 
an headline with an inline element (like an image or said large number 
of output lines) which is expensive to obtain and display. Is there a 
way to say to emacs to delay the loading of this expensive / huge 
resource until e.g. 5 seconds passes or I press F6 or something to 
indicate that I am willing to pay (money, time, memory resources) to 
have the inline item displayer?

   Any ideas or pointers please?

    Thank you!!

    - HJ

PS: I dare not ask whether such dynamic  inclusion / exclusion could be 
performed on a read-write file as well, but if anyone dares to venture 
out on this question, it would be most welcome. This could expand (my) 
horizons of orgmode's usability!



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

* Re: temporary inclusion of a read-only file / inline element into orgmode buffer
  2021-01-06 17:47 temporary inclusion of a read-only file / inline element into orgmode buffer HJ
@ 2021-01-06 20:18 ` Tom Gillespie
  2021-01-07  4:35   ` Christopher Miles
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Gillespie @ 2021-01-06 20:18 UTC (permalink / raw)
  To: HJ; +Cc: emacs-orgmode

Check out org-transclusion, it covers some of the use cases you
describe or could be used to implement them. The issue with giant
results, especially those that have very long lines, is more
challenging, but being able to specify that different output streams
should go to files instead of results might be a start, or having them
go to a file and having process do the equivalent of tail on the file
to continually update the results stream of the buffer would be really
useful (if it could be done without disrupting other editing flows.
The shortest path to splitting file vs buffer would probably be to
decorate org-bable-insert-result (in ob-core.el) to detect the size of
the result and write the full result to a separate buffer if it is
beyond the limit you set. Best,
Tom

https://github.com/nobiot/org-transclusion


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

* Re: temporary inclusion of a read-only file / inline element into orgmode buffer
  2021-01-06 20:18 ` Tom Gillespie
@ 2021-01-07  4:35   ` Christopher Miles
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Miles @ 2021-01-07  4:35 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: emacs-orgmode@gnu.org, HJ

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


Tom Gillespie writes:

> Check out org-transclusion, it covers some of the use cases you
> describe or could be used to implement them. The issue with giant
> results, especially those that have very long lines, is more
> challenging, but being able to specify that different output streams
> should go to files instead of results might be a start, or having them
> go to a file and having process do the equivalent of tail on the file
> to continually update the results stream of the buffer would be really
> useful (if it could be done without disrupting other editing flows.
> The shortest path to splitting file vs buffer would probably be to
> decorate org-bable-insert-result (in ob-core.el) to detect the size of
> the result and write the full result to a separate buffer if it is
> beyond the limit you set. Best,
> Tom
>
> https://github.com/nobiot/org-transclusion

This package is interesting, I want to use it in my package org-link-beautify
for previewing text file etc.

https://github.com/stardiviner/org-link-beautify

-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-01-07  4:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-06 17:47 temporary inclusion of a read-only file / inline element into orgmode buffer HJ
2021-01-06 20:18 ` Tom Gillespie
2021-01-07  4:35   ` Christopher Miles

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.