speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Consider $XDG_RUNTIME_DIR when looking for socket file


From: Alain Kalker
Subject: [PATCH] Consider $XDG_RUNTIME_DIR when looking for socket file
Date: Fri, 24 Oct 2014 00:37:57 +0200

The priority list becomes (depending on whether the respective
environment variables are set):

$SPEECHD_SOCK
$XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock
~/.speech-dispatcher/speechd.sock
---
 speechd.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/speechd.el b/speechd.el
index 80148fc..4eec11e 100644
--- a/speechd.el
+++ b/speechd.el
@@ -494,7 +494,12 @@ current voice."
               :remote (or socket-name
                           (or (getenv "SPEECHD_SOCK")
                               (expand-file-name
-                               "~/.speech-dispatcher/speechd.sock")))))
+                              (let ((runtime-dir (getenv "XDG_RUNTIME_DIR")))
+                                (concat
+                                 (if runtime-dir
+                                     (concat runtime-dir "/")
+                                   "~/.")
+                                 "speech-dispatcher/speechd.sock")))))))
             ((eq method 'inet-socket)
              (open-network-stream "speechd" nil host port))
             (t (error "Invalid communication method: `%s'" method)))))
-- 
2.1.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]