emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS trunk emacsclient: X11 connection rejected


From: Stefan Monnier
Subject: Re: CVS trunk emacsclient: X11 connection rejected
Date: Fri, 26 Oct 2007 01:24:23 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> With Emacs 22, and two GNU/Linux hosts with a common (NFS)
> file-system, I can do this:

>> From an X-session running on host1:

host1> emacs -Q -f server-start &
host1> ssh host2
host2> ssh host1 emacsclient --no-wait $PWD/README

> which visits the README file in the Emacs running on host1. I often
> find this convenient, because I often ssh between various machines and
> want to have a single Emacs instance. (The "emacsclient" part is
> hidden inside an "emacs" wrapper script that Does The Right Thing
> according to the situation.)

> If I try the same thing with the CVS trunk, then I get the following
> error when trying to run emacsclient:

>   X11 connection rejected because of wrong authentication.
>   *ERROR*: Connection lost to X server `localhost:10.0'

It's strange you get such an error: it seems to indicate that SSH did do X11
forwarding, proiperly set the $DISPLAY envvar, but somehow the corresponding
Xauth key didn't get to ~/.Xauthority file, or else your Emacs server
somehow fails to find this key (maybe it doesn't re-read the .Xauthority
file?).  Could you investigate a bit more?

> Is this a multi-tty side-effect, and is there any way around this? Or
> should I be doing this a different way now?

> (A common file-system is not necessary to see this, you can call
> emacsclient to edit eg /tmp/foo.)

It's a change introduced by the multi-tty code.  You can override it in
various ways, such as:

   ssh host1 emacsclient --display :0 --no-wait $PWD/README
or
   ssh host1 DISPLAY= emacsclient --no-wait $PWD/README

Basically, in Emacs-22 I added the "--display" arg to emacsclient, but made
it default to "nothing" rather than to "$DISPLAY", so you had to use
"--display $DISPLAY" if you wanted to display frames on the current display.
In the multi-tty code, the default has been changed to "$DISPLAY".

My choice for the behavior in Emacs-22 was based on the desire to preserve
the existing behavior.  I'm not sure which of the two is best, but the new
behavior should work about as well usually and better in cases where you use
several different X11 displays on different machines.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]