BTW, I have also tried just changing the XAUTHORITY environment
variable in the XEmacs process, so that it points to the temporary
xauth file that ssh created. That doesn't work for some reason--I
still get errors about "X11 connection rejected because of wrong
authentication." And it's more fragile than the approach I'm
suggesting, because XAUTHORITY needs to be reset to the original value
once XEmacs no longer needs to connect to the ssh/X proxy server.