Bhaskar Chowdhury has an informative video on the annotation package for Emacs. The idea is that often you’d like to add notes to a file without corrupting the file itself. For example, you might want to add explanatory notes to some source code but you obviously can’t just spew arbitrary text into the code. Even comments don’t necessarily work because it might not be your code and maybe you don’t even have write access to it.
The annotate package is the answer to this conundrum. You can make notes and they appear in the file but the actual text is kept in another file. It works pretty much the way you think it would: the annotation file has the annotations along with the file and line to which they apply.
Chowdhury’s video demonstrates the main functions that let you add, delete, search for, and list annotations. It’s a good introduction to the package. If you think you might have a need for something like this, you should definitely spend a few minutes with the video. It’s less than 6 minutes long so it’s a small investment in time.
The annotation package is not built in so you have to load it from Melpa but that’s simply enough even if you just want to try it out.