all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Adam Edge <baronedge@airmail.cc>
Cc: 41707@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	[thread overview]
Message-ID: <87y2mthx7x.fsf@gnus.org> (raw)
In-Reply-To: <20200604130500.438983-1-baronedge@airmail.cc> (Adam Edge's message of "Thu, 4 Jun 2020 16:05:00 +0300")

Adam Edge <baronedge@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





      reply	other threads:[~2020-08-05 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 13:05 bug#41707: [PATCH] Try $TMPDIR if $XDG_RUNTIME_DIR has no socket Adam Edge
2020-08-05 16:30 ` Lars Ingebrigtsen [this message]

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=87y2mthx7x.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=41707@debbugs.gnu.org \
    --cc=baronedge@airmail.cc \
    /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.