[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/xelb cd67b51 11/42: Set the `display` slot of `xcb:conn
From: |
Chris Feng |
Subject: |
[elpa] externals/xelb cd67b51 11/42: Set the `display` slot of `xcb:connection` in `xcb:connect-to-socket` |
Date: |
Thu, 17 Sep 2015 23:16:41 +0000 |
branch: externals/xelb
commit cd67b515c591222d386fa0725596a83ba3d72db4
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Set the `display` slot of `xcb:connection` in `xcb:connect-to-socket`
The slot value is guessed from the socket name, which is not always
accurate.
---
xcb.el | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/xcb.el b/xcb.el
index ac31c92..e1a1d30 100644
--- a/xcb.el
+++ b/xcb.el
@@ -137,17 +137,26 @@ SCREEN."
(defun xcb:connect-to-socket (&optional socket auth-info)
"Connect to X server with socket SOCKET and authentication info AUTH-INFO."
(unless (or socket x-display-name) (error "[XELB] No X display available"))
- (unless socket (setq socket (concat "/tmp/.X11-unix/X"
- (replace-regexp-in-string
- ".*:\\([^\\.]+\\)\\(\\..*\\)?" "\\1"
- x-display-name))))
- (let* ((process (make-network-process :name "XELB" :remote socket))
- (auth (if auth-info auth-info (make-instance 'xcb:auth-info)))
- (connection (make-instance 'xcb:connection
- :process process
- :auth-info auth :socket socket)))
- (xcb:-connect connection)
- connection))
+ (let (display)
+ (if socket
+ ;; As there is no general way to deduce the display name from an X11
+ ;; socket, we assume a standard SOCKET name and hope for the best.
+ (setq display
+ (concat ":" ;local
+ (replace-regexp-in-string "^.*?\\([0-9.]+\\)$" "\\1"
+ socket)))
+ (setq display x-display-name
+ socket (concat "/tmp/.X11-unix/X"
+ (replace-regexp-in-string
+ ".*:\\([^\\.]+\\)\\(\\..*\\)?" "\\1"
+ x-display-name))))
+ (let* ((process (make-network-process :name "XELB" :remote socket))
+ (auth (if auth-info auth-info (make-instance 'xcb:auth-info)))
+ (connection (make-instance 'xcb:connection
+ :process process :display display
+ :auth-info auth :socket socket)))
+ (xcb:-connect connection)
+ connection)))
(cl-defmethod xcb:-connect ((obj xcb:connection))
"Connect to X server."
- [elpa] branch externals/xelb created (now f5a7ca9), Chris Feng, 2015/09/17
- [elpa] externals/xelb 2d78724 03/42: Fix shift bit for converting from keysym to Emacs event, Chris Feng, 2015/09/17
- [elpa] externals/xelb e665cb3 05/42: Update xcb-randr.el, Chris Feng, 2015/09/17
- [elpa] externals/xelb 87ebff4 06/42: Fix for 32bit platform, Chris Feng, 2015/09/17
- [elpa] externals/xelb 1916894 07/42: Fix integer overflow on 32-bit platform, Chris Feng, 2015/09/17
- [elpa] externals/xelb c042d3f 08/42: Provide more verbose message when connection failed or auth required, Chris Feng, 2015/09/17
- [elpa] externals/xelb 6a7bccc 09/42: Disable concurrency of events, Chris Feng, 2015/09/17
- [elpa] externals/xelb 11005f2 10/42: Fix ch11ng/exwm#16 (cursor size not matching), Chris Feng, 2015/09/17
- [elpa] externals/xelb cd67b51 11/42: Set the `display` slot of `xcb:connection` in `xcb:connect-to-socket`,
Chris Feng <=
- [elpa] externals/xelb 23cb30b 12/42: Fix an emacsclient bug, Chris Feng, 2015/09/17
- [elpa] externals/xelb 946d3ed 14/42: Fix keyboard mapping update problem, Chris Feng, 2015/09/17
- [elpa] externals/xelb 76246b4 13/42: Check `length` slot in `xcb:icccm:-GetProperty~reply`, Chris Feng, 2015/09/17
- [elpa] externals/xelb bf39d9b 15/42: allow key mappings without mode switch or NumLock keys, Chris Feng, 2015/09/17
- [elpa] externals/xelb 518b17a 16/42: Merge branch 'pipcet-no-num-lock', Chris Feng, 2015/09/17
- [elpa] externals/xelb 4e42bf2 04/42: Cleanup code, Chris Feng, 2015/09/17
- [elpa] externals/xelb 1cea22d 20/42: Provide a way to disable auto-padding, Chris Feng, 2015/09/17
- [elpa] externals/xelb 247d6d2 17/42: Make the manipulation of message cache more robust, Chris Feng, 2015/09/17
- [elpa] externals/xelb 677623a 19/42: Disable auto-padding for xcb-xim, Chris Feng, 2015/09/17
- [elpa] externals/xelb 7c194e7 21/42: Don't assume key events are numbers; they can be symbols., Chris Feng, 2015/09/17