From: Neil T. Dantam <ntd@gatech.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Detachable shells in Emacs?
Date: Fri, 07 Sep 2012 22:08:15 -0400 [thread overview]
Message-ID: <k2e9af$6s0$1@ger.gmane.org> (raw)
In-Reply-To: <bp8627pbnvh.fsf@usca1uw-JZWWPM1.sanmateo.corp.akamai.com>
> I work from home occasionally, and so I'd like to be able to leave
> Emacs running at the office and resume working on it remotely, on my
> laptop, over an ssh tunnel. But when I try to create a frame on my
> laptop's display, using "localhost:10.0" as the display, I get "X11
> connection rejected because of wrong authentication."
Likely, the XAUTHORITY used by emacs does not know how to talk to the
X connection forward by ssh. I've had this problem when GDM makes
some random XAUTHORITY file under /var, which emacs will also use,
while SSH puts everything in ~/.Xauthority. The following script is
what I use to forward emacs frames through SSH:
#!/bin/sh
#### Create a new emacs frame on $DISPLAY, setting xauthority properly
### Merge the xauth entry for $DISPLAY into emacs's xauthority
# scrub out localhost from display, or xauth doesn't list it
SCRUBBED_DISPLAY=`echo $DISPLAY | sed -e 's/^localhost:/:/'`
if [ -n "$SCRUBBED_DISPLAY" ]; then
CURRENT_XAUTH=`xauth list $SCRUBBED_DISPLAY`
emacsclient -e "(shell-command \"xauth add $CURRENT_XAUTH\")" > /dev/null
fi
### New emacs frame
exec emacsclient -e "(make-frame-on-display \"$DISPLAY\")"
-ntd
next prev parent reply other threads:[~2012-09-08 2:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-25 23:47 Detachable shells in Emacs? Sean McAfee
2012-08-26 0:05 ` Pascal J. Bourguignon
2012-09-07 20:04 ` Sean McAfee
2012-09-08 2:08 ` Neil T. Dantam [this message]
2012-09-14 0:56 ` Sean McAfee
2012-08-26 2:02 ` Stefan Monnier
2012-08-27 19:09 ` Neal Becker
[not found] ` <mailman.7694.1346094589.855.help-gnu-emacs@gnu.org>
2012-08-27 19:47 ` Lowell Gilbert
2012-09-09 16:06 ` David Combs
2012-09-11 17:56 ` Lowell Gilbert
2012-08-28 3:58 ` Barry Margolin
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='k2e9af$6s0$1@ger.gmane.org' \
--to=ntd@gatech.edu \
--cc=help-gnu-emacs@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.