From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: emacsclient and XAUTHORITY variable Date: Sun, 2 Aug 2015 23:49:08 +0200 Message-ID: <21950.36948.623458.877642@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1438552187 20794 80.91.229.3 (2 Aug 2015 21:49:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 21:49:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 02 23:49:38 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZM18T-0007NM-LK for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 23:49:37 +0200 Original-Received: from localhost ([::1]:56888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM18S-0005aQ-TA for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 17:49:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM18G-0005a8-WF for emacs-devel@gnu.org; Sun, 02 Aug 2015 17:49:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM18D-0007OR-Qy for emacs-devel@gnu.org; Sun, 02 Aug 2015 17:49:24 -0400 Original-Received: from a1www.kph.uni-mainz.de ([134.93.134.1]:34315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM18D-0007NN-IF for emacs-devel@gnu.org; Sun, 02 Aug 2015 17:49:21 -0400 Original-Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1www.kph.uni-mainz.de (8.14.9/8.14.7) with ESMTP id t72Ln9pG007623 for ; Sun, 2 Aug 2015 23:49:09 +0200 Original-Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.8/8.14.2) with ESMTP id t72Ln9VD025456; Sun, 2 Aug 2015 23:49:09 +0200 Original-Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.8/8.14.8/Submit) id t72Ln8vM025452; Sun, 2 Aug 2015 23:49:08 +0200 X-Mailer: VM 8.2.0b under 24.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 134.93.134.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188306 Archived-At: The following came up in https://bugs.gentoo.org/555346 where a user complained that the XAUTHORITY variable in emacsclient's environment wouldn't be honoured. I closed that Gentoo bug report, arguing that "[...] the emacs daemon needs to read X authentication information from the ~/.Xauthority file. Storing this information in a different place and pointing XAUTHORITY to it won't work, because the daemon cannot see this XAUTHORITY variable in its environment." Thinking about it again, I wonder if this wasn't a premature conclusion. Creating a frame with emacsclient and calling (getenv "XAUTHORITY" (selected-frame)) in the newly created frame shows that XAUTHORITY (or in fact, any variable from emacsclient's environment) will be passed on to the frame's "environment" parameter. So Emacs has all information which is necessary, and I wonder if this couldn't be passed to the Xau library before opening the X display for the new frame? There is also bug http://debbugs.gnu.org/1467 which seems to be related. Ulrich