Hacker News new | past | comments | ask | show | jobs | submit login

I actually just started dong this a few days ago and I’m loving it so far. I have it configured so that every time I save, emacs runs org-tangle and all my code ends up in the proper directories but I never have to touch it there, I can just stay in org mode and keep different ‘files’ of code in different collapsible sections making moving around much easier!



Look at org-babel-detangle and have your mind blown[0].

[0] Mostly, the current implementation works only with source blocks that are linearly added one after the other and don't use the <<noweb reference>> in code blocks.


I had a similar setup, but ended up coding a toggle for it, as it can get rather long as your source grows. In case you find it useful:

        ;; Tangle Org files when we save them
    (defun toggle-org-tangle-on-save()
      (interactive)
      (if (bound-and-true-p org-tangle-on-save)
          (setq-local org-tangle-on-save nil)
        (setq-local org-tangle-on-save t))
      (message (if org-tangle-on-save "Enabled tangling on save" "Disabled tangling on save")))




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: