From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#41707: [PATCH] Try $TMPDIR if $XDG_RUNTIME_DIR has no socket Date: Wed, 05 Aug 2020 18:30:10 +0200 Message-ID: <87y2mthx7x.fsf@gnus.org> References: <20200604130500.438983-1-baronedge@airmail.cc> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22210"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41707@debbugs.gnu.org To: Adam Edge Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 05 18:31:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3MJr-0005hX-Vh for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Aug 2020 18:31:12 +0200 Original-Received: from localhost ([::1]:33700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3MJr-0000VI-0Z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Aug 2020 12:31:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3MJi-0000Tf-MR for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2020 12:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3MJi-0002TN-Bi for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2020 12:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k3MJi-0006lI-0w for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2020 12:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Aug 2020 16:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41707 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41707-submit@debbugs.gnu.org id=B41707.159664503225944 (code B ref 41707); Wed, 05 Aug 2020 16:31:01 +0000 Original-Received: (at 41707) by debbugs.gnu.org; 5 Aug 2020 16:30:32 +0000 Original-Received: from localhost ([127.0.0.1]:52081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3MJE-0006kO-G2 for submit@debbugs.gnu.org; Wed, 05 Aug 2020 12:30:32 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:43422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3MJA-0006k4-S1 for 41707@debbugs.gnu.org; Wed, 05 Aug 2020 12:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=09jG3wZQaqrTu55ciLFLfj4tRhyNW3nHUnEoKqZEcC8=; b=O3Vqc7KmCXJZ72+dg8ytnWMgZ8 sbhKqsXlOOoEU7qj7Wyz6mu77JdAILy7HuBqb74oDl2TMBMeWaPVgI3bvxomHjI1zIznx56dRZRG2 3EFKwaYTuG/09Qwqm57/BSgWJ8LygYVI63wQ42Gsmg+7JM49SiTsUbzJoM2HBKs8TDc0=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3MIu-0006df-2S; Wed, 05 Aug 2020 18:30:22 +0200 In-Reply-To: <20200604130500.438983-1-baronedge@airmail.cc> (Adam Edge's message of "Thu, 4 Jun 2020 16:05:00 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184117 Archived-At: Adam Edge writes: > Emacsclient currently checks whether $XDG_RUNTIME_DIR exists in > the environment, and if it does, it uses that as a base for the > socket directory. However, Emacs seems to still use $TMPDIR > when the daemon is started (both via emacs --daemon and > M-x start-server). This commit makes Emacsclient first check > whether the socket exists in $XDG_RUNTIME_DIR, and if it doesn't, > fall back to $TMPDIR. As far as I can see, Emacs uses the XDG directory: ;; We do not use `temporary-file-directory' here, because emacsclient ;; does not read the init file. (defvar server-socket-dir (if internal--daemon-sockname (file-name-directory internal--daemon-sockname) (and (featurep 'make-network-process '(:family local)) (let ((xdg_runtime_dir (getenv "XDG_RUNTIME_DIR"))) (if xdg_runtime_dir (format "%s/emacs" xdg_runtime_dir) (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))))) "The directory in which to place the server socket. If local sockets are not supported, this is nil.") If your Emacs doesn't, then that seems like a bug that should be fixed, instead of changing emacsclient to check both directories? Or perhaps you're running a different version of Emacs and emacsclient? That often has problems and isn't recommended. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no