Amit added the patch and we both tested it and confirmed the fix works here, too.

This is the first emacs bug I've submitted (after using it for 10 years) and am
amazed at the bug-fix responsiveness.  Great work!

-Doug

Jerry James wrote:
APPROVE COMMIT 21.5

Doug Kramer <doog@google.com> wrote:
  
Wow, thanks, Jerry, for the speedy work.  Amit is the one who could try
building with this patch --
I don't have the sources or a build environment.  I'd be happy to test a
binary.
    

I've tested the patch some more and XEmacs behaves as I expect in all
the scenarios I dreamed up.  If you or Amit find any further problems,
please let us know.

I have committed this patch.