[elpa] externals/xelb 28c0579: Avoid using the global value `x-display-name'

2016-03-24 Thread Chris Feng
branch: externals/xelb
commit 28c0579ff4f74a256f3fe8e6462b6c507848cec6
Author: Chris Feng 
Commit: Chris Feng 

Avoid using the global value `x-display-name'

* xcb.el (xcb:connect-to-display-with-auth-info, xcb:connect-to-socket):
Use the frame parameter 'display' instead of `x-display-name' since the
latter can be cleared by e.g. launching an emacsclient.
---
 xcb.el |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xcb.el b/xcb.el
index 3fd6a99..941d248 100644
--- a/xcb.el
+++ b/xcb.el
@@ -122,7 +122,7 @@ equal.  Otherwise a negative value would be returned."
 
 (defun xcb:connect-to-display-with-auth-info (&optional display auth _screen)
   "Connect to X server with display DISPLAY, auth info AUTH on screen _SCREEN."
-  (unless display (setq display x-display-name))
+  (unless display (setq display (frame-parameter nil 'display)))
   (unless display (error "[XELB] No X display available"))
   (let* ((tmp (xcb:parse-display display))
  (host (cdr (assoc 'host tmp)))
@@ -152,7 +152,8 @@ equal.  Otherwise a negative value would be returned."
 
 (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 (or socket (frame-parameter nil 'display))
+(error "[XELB] No X display available"))
   (let (display)
 (if socket
 ;; As there is no general way to deduce the display name from an X11
@@ -161,11 +162,11 @@ equal.  Otherwise a negative value would be returned."
   (concat ":"   ;local
   (replace-regexp-in-string "^.*?\\([0-9.]+\\)$" "\\1"
 socket)))
-  (setq display x-display-name
+  (setq display (frame-parameter nil 'display)
 socket (concat "/tmp/.X11-unix/X"
(replace-regexp-in-string
 ".*:\\([^\\.]+\\)\\(\\..*\\)?" "\\1"
-x-display-name
+display
 (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



[elpa] externals/exwm fa204e1: Fix emacsclient issues

2016-03-24 Thread Chris Feng
branch: externals/exwm
commit fa204e136718e106a87414dd145d16748d5b7262
Author: Chris Feng 
Commit: Chris Feng 

Fix emacsclient issues

* exwm-layout.el (exwm-layout--on-minibuffer-setup)
(exwm-layout--on-echo-area-change):
* exwm-workspace.el (exwm-workspace--on-minibuffer-setup)
(exwm-workspace--on-minibuffer-exit, exwm-workspace--on-echo-area-dirty)
(exwm-workspace--on-echo-area-clear):
Exclude non-graphical frames.

* exwm.el (exwm--server-eval-at): Avoid using `x-dispaly-name'.
---
 exwm-layout.el|   15 +--
 exwm-workspace.el |   21 ++---
 exwm.el   |2 +-
 3 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index 095e461..c392ff9 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -353,16 +353,19 @@ selected by `other-buffer'."
 
 (defun exwm-layout--on-minibuffer-setup ()
   "Refresh layout when minibuffer grows."
-  (run-with-idle-timer 0.01 nil ;FIXME
-   (lambda ()
- (when (< 1 (window-height (minibuffer-window)))
-   (exwm-layout--refresh
-  ;; Set input focus on the Emacs frame
-  (x-focus-frame (window-frame (minibuffer-selected-window
+  (when (frame-parameter nil 'exwm-outer-id)
+(run-with-idle-timer 0.01 nil ;FIXME
+ (lambda ()
+   (when (< 1 (window-height (minibuffer-window)))
+ (exwm-layout--refresh
+;; Set input focus on the Emacs frame
+(x-focus-frame (window-frame (minibuffer-selected-window)
 
 (defun exwm-layout--on-echo-area-change (&optional dirty)
   "Run when message arrives or in `echo-area-clear-hook' to refresh layout."
   (when (and (current-message)
+ ;; Exclude non-graphical frames.
+ (frame-parameter nil 'exwm-outer-id)
  (or (cl-position ?\n (current-message))
  (> (length (current-message))
 (frame-width exwm-workspace--current
diff --git a/exwm-workspace.el b/exwm-workspace.el
index d8e84f3..8dd6284 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -531,7 +531,9 @@ The optional FORCE option is for internal use only."
 
 (defun exwm-workspace--on-minibuffer-setup ()
   "Run in minibuffer-setup-hook to show the minibuffer and its container."
-  (unless (> -1 (minibuffer-depth))
+  (when (and (= 1 (minibuffer-depth))
+ ;; Exclude non-graphical frames.
+ (frame-parameter nil 'exwm-outer-id))
 (add-hook 'post-command-hook #'exwm-workspace--update-minibuffer)
 (exwm-workspace--show-minibuffer)
 ;; Set input focus on the Emacs frame
@@ -539,7 +541,9 @@ The optional FORCE option is for internal use only."
 
 (defun exwm-workspace--on-minibuffer-exit ()
   "Run in minibuffer-exit-hook to hide the minibuffer container."
-  (unless (> -1 (minibuffer-depth))
+  (when (and (= 1 (minibuffer-depth))
+ ;; Exclude non-graphical frames.
+ (frame-parameter nil 'exwm-outer-id))
 (remove-hook 'post-command-hook #'exwm-workspace--update-minibuffer)
 (exwm-workspace--hide-minibuffer)))
 
@@ -548,6 +552,8 @@ The optional FORCE option is for internal use only."
 (defun exwm-workspace--on-echo-area-dirty ()
   "Run when new message arrives to show the echo area and its container."
   (when (and (not (active-minibuffer-window))
+ ;; Exclude non-graphical frames.
+ (frame-parameter nil 'exwm-outer-id)
  (or (current-message)
  cursor-in-echo-area))
 (exwm-workspace--update-minibuffer t)
@@ -561,11 +567,12 @@ The optional FORCE option is for internal use only."
 
 (defun exwm-workspace--on-echo-area-clear ()
   "Run in echo-area-clear-hook to hide echo area container."
-  (unless (active-minibuffer-window)
-(exwm-workspace--hide-minibuffer))
-  (when exwm-workspace--display-echo-area-timer
-(cancel-timer exwm-workspace--display-echo-area-timer)
-(setq exwm-workspace--display-echo-area-timer nil)))
+  (when (frame-parameter nil 'exwm-outer-id) ;Exclude non-graphical frames.
+(unless (active-minibuffer-window)
+  (exwm-workspace--hide-minibuffer))
+(when exwm-workspace--display-echo-area-timer
+  (cancel-timer exwm-workspace--display-echo-area-timer)
+  (setq exwm-workspace--display-echo-area-timer nil
 
 (declare-function exwm-manage--unmanage-window "exwm-manage.el")
 
diff --git a/exwm.el b/exwm.el
index e60b341..ac10247 100644
--- a/exwm.el
+++ b/exwm.el
@@ -557,7 +557,7 @@
   (start-process exwm--server-name
  nil
  (car command-line-args) ;The executable file
- "-d" x-display-name
+ "-d" (frame-parameter nil 'display)
  "-Q"
  (concat "--daemon=" exwm--server-name)
  "--e