I'm reading code from one of the big open source framework and finding it hard to organize notes alongside the code. I haven't found a good way to take notes alongside the code I'm reading so I can later come back and review it.<p>My preferred way of doing it in the past has been printing out the code and writing notes alongside it in the margins but I've stopped doing that as it keeps wasting a lot of printer paper and ink.<p>I'm curious if anybody else has taken notes alongside code and how they are doing it, because I feel like there isn't a good way of doing it that I know of yet.<p>I've also tried using org-mode in Emacs and markdown but found that a lot of editors grey out the code making it harder to see, and the whole point is to see the code since I'm reading the code and it doesn't seem worth the effort to copy the file over to Emacs if it looks hideous. Also, I tried downloading the repository (written in C#) and opening it in Visual Studio in hopes to take notes in the form of code comments and I realized that it requires a lot of work and installations to even get the repo to compile and since I'm only wanting to read the code and take notes I don't want to go to that effort and without getting it to compile VS makes most of the code go red with bothersome error squiggles everywhere.<p>How do you take notes alongside code? Is there a good way out there that tailors to reading code and taking notes?
I use org mode.<p>If you `(setq org-src-fontify-natively t)` in your org-mode hook it will render code blocks with that language's display settings, which helps a lot.<p>For two side-by-side buffers, left for code right for notes:<p>* left: `M-x clone-indirect-buffer`<p>* either: `M-x scroll-all-mode`<p>* right: `M-x fixme-mode`[1]<p>The idea is that you abuse the highlighting of FIXME/TODO comments (in the right buffer only) and put your notes there. Scrolling is synced so both buffers are always looking at the same view. It's a bit of a kludge but has the advantage over org-mode that it's easier to add the notes.<p>EDIT: If you cared enough about it you could write a simple major mode for the right pane that highlights all comments[2] so you don't need the FIXME prefix. As a bonus you could also grey out the actual code.<p>[1] <a href="https://www.emacswiki.org/emacs/FixmeMode" rel="nofollow">https://www.emacswiki.org/emacs/FixmeMode</a><p>[2] <a href="http://ergoemacs.org/emacs/elisp_comment_coloring.html" rel="nofollow">http://ergoemacs.org/emacs/elisp_comment_coloring.html</a>