org-tanglesync.el
org-tanglesync.el copied to clipboard
Update sync method to utilise existing org framework
There should be an easy way during watch-mode to convert a buffer to an org-edit-src-mode buffer and set the tangle source to the right conf file and tangle block.
The user could then do C-c ' to exit the buffer and go back to the conf, or save as normal (though killing the buffer might present some issues...)
Right now, the method literally copies and pastes, but this is not elegant.
If I want to get this functionality later merged into org-mode, I need to use the existing framework.
Some specifics that might be of interest when the org-edit-src-mode
is activated in a tangled buffer:
-
org-src--beg-marker
- a#<marker>
type that has the character just inside the block at the top -
org-src--end-marker
- a#<marker>
type that has the character just inside the block at the bottom -
org-src--from-org-mode
- is set to"org-mode"
-
org-src--src-type
- is set to"src-block
-
org-src--overlay
- is set to#<overlay at posX and posY in File >
where posX is equal to the beg-marker, and posY is the end-marker, and File is the name of the source org file. -
org-src--babel-info
- is the original contents of the buffer before modification along with header arguments -
org-src--allow-write-back
- is set tot
when called within the org-buffer and#[0 "Àed\"" [org-escape-code-in-region] 3]
inside the src-mode, which I have no idea about....