GNU bug report logs - #41707
[PATCH] Try $TMPDIR if $XDG_RUNTIME_DIR has no socket

Previous Next

Package: emacs;

Reported by: Adam Edge <baronedge <at> airmail.cc>

Date: Thu, 4 Jun 2020 13:58:01 UTC

Severity: normal

Tags: patch

Merged with 33847

Found in version 27.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Adam Edge <baronedge <at> airmail.cc>
Cc: 41707 <at> debbugs.gnu.org
Subject: bug#41707: [PATCH] Try $TMPDIR if $XDG_RUNTIME_DIR has no socket
Date: Wed, 05 Aug 2020 18:30:10 +0200
Adam Edge <baronedge <at> airmail.cc> 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




This bug report was last modified 3 years and 226 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.