Reuben Thomas writes: > > Given my previous error of reasoning, I'm submitting the above for your consideration before I prepare a patch! Sorry I didn't get around to looking at this before you wrote a patch, but I think you're overthinking this. AFAICT, your first fix (in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24745#5) was right. Here's a patch with some tests, let me know if I missed any cases.