Mattias, thanks for going through the Emacs manual and looking for mistakes in this area. I know it was a pain to do that, since I did something similar in parallel and it was painful for me. I used your patch to crosscheck with my draft (finding omissions on both sides) and installed the resulting patch (attached) into the emacs-27 branch. This patch should address the points that Eli raised. That is, it adds explanations of the issue (both in the intro and the reference manual, since the issue also infects the intro), and it attempts to change examples only when the changes are needed to avoid undefined behavior in Emacs Lisp. I also kept the changes from '< to #'< that were in your patch since that's good style.