emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] mirror text in same/other org buffer


From: Xebar Saram
Subject: Re: [O] mirror text in same/other org buffer
Date: Thu, 23 Nov 2017 08:16:53 +0200

thx!

that works well for me :D

best and happy holidays :)

Z

On Wed, Nov 22, 2017 at 1:40 PM, Kaushal Modi <address@hidden> wrote:
On Wed, Nov 22, 2017, 4:55 AM Xebar Saram <address@hidden> wrote:
Hi alll

Hello

Im looking for a way to to mirror/auto populate a section of text in another location in the same org buffer and/or other org file.

for example, i manage my config files in org mode for multiple machines. i want to have a section like this

#+BEGIN_SRC conf :mkdirp yes :tangle ~/machine A
CODE
#+END_SRC
where the same content of CODE is mirroed/auto generated in another code block for machine B

#+BEGIN_SRC conf :mkdirp yes :tangle ~/machine B
CODE
#+END_SRC

is this in anyway possible?

You cannot have real-time mirroring of content in the Org file itself. 

But you can implement that DRY model by using Noweb references (See the "Noweb reference syntax" node in the Org manual). 

You can put the CODE in a separate src block with :noweb-ref set to foo, and then wherever in other code blocks you want to mirror that, you simply put <<foo>>. 

As I said you won't see the mirroring happen live in the Org buffer. But you will see the mirroring done in the exported files. 

PS: For non-code mirroring (in exported files), there's also do:

  #+INCLUDE: "./can-be-same-file.org::#CUSTOM_ID" :only-contents t

(See the "Include files" node in the Org manual for more.)

--

Kaushal Modi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]