all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: CVS trunk emacsclient: X11 connection rejected
Date: Fri, 26 Oct 2007 01:24:23 -0400	[thread overview]
Message-ID: <jwvsl3ybgue.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <dx1wbiae14.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu\, 25 Oct 2007 20\:57\:27 -0400")

> 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	other threads:[~2007-10-26  5:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26  0:57 CVS trunk emacsclient: X11 connection rejected Glenn Morris
2007-10-26  5:24 ` Stefan Monnier [this message]
2007-10-27  0:44   ` Glenn Morris
2007-10-27  2:16     ` Stefan Monnier
2007-10-27  2:43       ` Glenn Morris
2007-10-27  3:04         ` Stefan Monnier
2007-10-27  3:33           ` Glenn Morris
2007-10-27 19:51             ` Stefan Monnier
2007-10-29 17:57               ` Glenn Morris
2007-10-29 18:02                 ` Glenn Morris
2007-10-29 19:16                 ` Stefan Monnier
2007-10-29 20:25                   ` Glenn Morris
2007-10-29 21:01               ` Stefan Monnier
2007-10-29 22:03                 ` Glenn Morris
2007-10-30  2:01                   ` Stefan Monnier
2007-10-26  5:41 ` Jan Djärv
2007-10-27  0:47   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvsl3ybgue.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.