Matt Armstrong writes: > I've got a patch to fix and will post it once I get a bug number. ...attached and also at the scratch/matta/for_stefan branch at https://git.sr.ht/~matta/emacs (log link: https://git.sr.ht/~matta/emacs/log/scratch/matta/for_stefan) I am not happy with adding a new arg to 'overlays_in', but it appears we really do have three distinct "modes" that can't be covered by simply passing a half-open [beg,end) range. It isn't an issue on master because 'overlays_at' doesn't call 'overlays_in' there. The fact that the code wasn't shared probably allowed this subtle behavior difference to slip through -- who knows if any callers rely on this.