[elpa] externals/exwm updated (4462981 -> 225c68d)

2019-02-06 Thread Chris Feng
ch11ng pushed a change to branch externals/exwm.

  from  4462981   Scan for existing X windows only after running 
`exwm-init-hook'
   new  0f7269c   Add input method support
   new  ec108a6   Cleanup simulation key config issues
   new  97b1fb7   Do the same for `exwm-input-global-keys'
   new  e157282   Merge branch 'ieure/default-simulation-keys' into 
externals/exwm
   new  0dd909a   Stop hiding the minibuffer when a message is being 
displayed
   new  cd7b32d   Hide minibuffer upon receiving any event
   new  225c68d   Merge branch 'retain-echo-area-until-input' of 
https://github.com/medranocalvo/exwm into 
medranocalvo/retain-echo-area-until-input


Summary of changes:
 README.md  |   3 +-
 exwm-config.el |  60 ++--
 exwm-core.el   |   9 +
 exwm-input.el  |  32 +--
 exwm-manage.el |   9 +-
 exwm-randr.el  |  11 +-
 exwm-systemtray.el |   7 +-
 exwm-workspace.el  |  20 +-
 exwm-xim.el| 781 +
 xinitrc|  19 +-
 10 files changed, 875 insertions(+), 76 deletions(-)
 create mode 100644 exwm-xim.el



[elpa] externals/exwm 225c68d 7/7: Merge branch 'retain-echo-area-until-input' of https://github.com/medranocalvo/exwm into medranocalvo/retain-echo-area-until-input

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit 225c68d4ce5fd3c9726b27eb6fc3ab2b223d2ec3
Merge: e157282 cd7b32d
Author: Chris Feng 
Commit: Chris Feng 

Merge branch 'retain-echo-area-until-input' of 
https://github.com/medranocalvo/exwm into 
medranocalvo/retain-echo-area-until-input
---
 exwm-input.el |  9 +++--
 exwm-workspace.el | 20 +++-
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/exwm-input.el b/exwm-input.el
index 04020ac..d0ae4ad 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -140,6 +140,9 @@ defined in `exwm-mode-map' here."
 (defvar exwm-input--update-focus-window nil "The (Emacs) window to be focused.
 This value should always be overwritten.")
 
+(defvar exwm-input--event-hook nil
+  "Hook to run when EXWM receives an event.")
+
 (defvar exwm-workspace--current)
 (declare-function exwm-floating--do-moveresize "exwm-floating.el"
   (data _synthetic))
@@ -430,7 +433,8 @@ ARGS are additional arguments to CALLBACK."
  (setq mode xcb:Allow:ReplayPointer
 (xcb:+request exwm--connection
 (make-instance 'xcb:AllowEvents :mode mode :time xcb:Time:CurrentTime))
-(xcb:flush exwm--connection)))
+(xcb:flush exwm--connection))
+  (run-hooks 'exwm-input--event-hook))
 
 (defun exwm-input--on-KeyPress (data _synthetic)
   "Handle KeyPress event."
@@ -444,7 +448,8 @@ ARGS are additional arguments to CALLBACK."
(exwm-input--on-KeyPress-line-mode obj data))
   (char-mode
(exwm-input--on-KeyPress-char-mode obj data)))
-  (exwm-input--on-KeyPress-char-mode obj
+  (exwm-input--on-KeyPress-char-mode obj)))
+  (run-hooks 'exwm-input--event-hook))
 
 (defun exwm-input--on-CreateNotify (data _synthetic)
   "Handle CreateNotify events."
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 5a84ec9..7832873 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -128,6 +128,7 @@ Please manually run the hook 
`exwm-workspace-list-change-hook' afterwards.")
 (defvar exwm-workspace--workareas nil "Workareas (struts excluded).")
 
 (defvar exwm-input--during-command)
+(defvar exwm-input--event-hook)
 (defvar exwm-layout-show-all-buffers)
 (defvar exwm-manage--desktop)
 (declare-function exwm-input--on-buffer-list-update "exwm-input.el" ())
@@ -1221,7 +1222,18 @@ Please check `exwm-workspace--minibuffer-own-frame-p' 
first."
 input-method-use-echo-area)
   (setq exwm-workspace--display-echo-area-timer
 (run-with-timer exwm-workspace-display-echo-area-timeout nil
-#'exwm-workspace--on-echo-area-clear)
+#'exwm-workspace--echo-area-maybe-clear)
+
+(defun exwm-workspace--echo-area-maybe-clear ()
+  "Eventually clear the echo area container."
+  (exwm--log)
+  (if (not (current-message))
+  (exwm-workspace--on-echo-area-clear)
+;; Reschedule.
+(cancel-timer exwm-workspace--display-echo-area-timer)
+(setq exwm-workspace--display-echo-area-timer
+  (run-with-timer exwm-workspace-display-echo-area-timeout nil
+  #'exwm-workspace--echo-area-maybe-clear
 
 (defun exwm-workspace--on-echo-area-clear ()
   "Run in echo-area-clear-hook to hide echo area container."
@@ -1598,6 +1610,9 @@ applied to all subsequently created X frames."
   (add-hook 'after-make-frame-functions
 #'exwm-workspace--on-after-make-frame)
   (add-hook 'delete-frame-functions #'exwm-workspace--on-delete-frame)
+  (when (exwm-workspace--minibuffer-own-frame-p)
+(add-hook 'exwm-input--event-hook
+  #'exwm-workspace--on-echo-area-clear))
   ;; Switch to the first workspace
   (exwm-workspace-switch 0 t)
   ;; Prevent frame parameters introduced by this module from being
@@ -1619,6 +1634,9 @@ applied to all subsequently created X frames."
#'exwm-workspace--on-after-make-frame)
   (remove-hook 'delete-frame-functions
#'exwm-workspace--on-delete-frame)
+  (when (exwm-workspace--minibuffer-own-frame-p)
+(remove-hook 'exwm-input--event-hook
+ #'exwm-workspace--on-echo-area-clear))
   ;; Hide & reparent out all frames (save-set can't be used here since
   ;; X windows will be re-mapped).
   (setq exwm-workspace--current nil)



[elpa] externals/exwm cd7b32d 2/7: Hide minibuffer upon receiving any event

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit cd7b32d1c203b87d428ea75e5a5e1452d8236742
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Hide minibuffer upon receiving any event

* exwm-input.el (exwm-input--event-hook): New variable.
(exwm-input--on-ButtonPress, exwm-input--on-KeyPress): Run
`exwm-input--event-hook'.
* exwm-workspace.el (exwm-workspace--init, exwm-workspace--exit):
Hide minibuffer upon noticing an event.
---
 exwm-input.el | 9 +++--
 exwm-workspace.el | 7 +++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/exwm-input.el b/exwm-input.el
index c757b09..a7fb16a 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -137,6 +137,9 @@ defined in `exwm-mode-map' here."
 (defvar exwm-input--update-focus-window nil "The (Emacs) window to be focused.
 This value should always be overwritten.")
 
+(defvar exwm-input--event-hook nil
+  "Hook to run when EXWM receives an event.")
+
 (defvar exwm-workspace--current)
 (declare-function exwm-floating--do-moveresize "exwm-floating.el"
   (data _synthetic))
@@ -418,7 +421,8 @@ ARGS are additional arguments to CALLBACK."
 (setq mode (exwm-input--on-ButtonPress-char-mode)
 (xcb:+request exwm--connection
 (make-instance 'xcb:AllowEvents :mode mode :time xcb:Time:CurrentTime))
-(xcb:flush exwm--connection)))
+(xcb:flush exwm--connection))
+  (run-hooks 'exwm-input--event-hook))
 
 (defun exwm-input--on-KeyPress (data _synthetic)
   "Handle KeyPress event."
@@ -432,7 +436,8 @@ ARGS are additional arguments to CALLBACK."
(exwm-input--on-KeyPress-line-mode obj data))
   (char-mode
(exwm-input--on-KeyPress-char-mode obj data)))
-  (exwm-input--on-KeyPress-char-mode obj
+  (exwm-input--on-KeyPress-char-mode obj)))
+  (run-hooks 'exwm-input--event-hook))
 
 (defun exwm-input--on-CreateNotify (data _synthetic)
   "Handle CreateNotify events."
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 0f0d10c..d58758f 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -128,6 +128,7 @@ Please manually run the hook 
`exwm-workspace-list-change-hook' afterwards.")
 (defvar exwm-workspace--workareas nil "Workareas (struts excluded).")
 
 (defvar exwm-input--during-command)
+(defvar exwm-input--event-hook)
 (defvar exwm-layout-show-all-buffers)
 (defvar exwm-manage--desktop)
 (declare-function exwm-input--on-buffer-list-update "exwm-input.el" ())
@@ -1584,6 +1585,9 @@ applied to all subsequently created X frames."
   (add-hook 'after-make-frame-functions
 #'exwm-workspace--on-after-make-frame)
   (add-hook 'delete-frame-functions #'exwm-workspace--on-delete-frame)
+  (when (exwm-workspace--minibuffer-own-frame-p)
+(add-hook 'exwm-input--event-hook
+  #'exwm-workspace--on-echo-area-clear))
   ;; Switch to the first workspace
   (exwm-workspace-switch 0 t)
   ;; Prevent frame parameters introduced by this module from being
@@ -1604,6 +1608,9 @@ applied to all subsequently created X frames."
#'exwm-workspace--on-after-make-frame)
   (remove-hook 'delete-frame-functions
#'exwm-workspace--on-delete-frame)
+  (when (exwm-workspace--minibuffer-own-frame-p)
+(remove-hook 'exwm-input--event-hook
+ #'exwm-workspace--on-echo-area-clear))
   ;; Hide & reparent out all frames (save-set can't be used here since
   ;; X windows will be re-mapped).
   (setq exwm-workspace--current nil)



[elpa] externals/exwm ec108a6 3/7: Cleanup simulation key config issues

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit ec108a61dc38f84a3b290f022929331e97784842
Author: Ian Eure 
Commit: Chris Feng 

Cleanup simulation key config issues

* exwm-input.el (exwm-input-simulation-keys): Original key only has
one option, so probably shouldn’t be a `choice` type; Move the
"User-defined" key value to the top, since that’s the one someone is
most likely to want).

* exwm-config.el (exwm-config-default): Only set custom vars if there
isn’t a saved value for them.
---
 exwm-config.el | 26 ++
 exwm-input.el  |  8 
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/exwm-config.el b/exwm-config.el
index 50f1366..8223633 100644
--- a/exwm-config.el
+++ b/exwm-config.el
@@ -31,7 +31,8 @@
 (defun exwm-config-default ()
   "Default configuration of EXWM."
   ;; Set the initial workspace number.
-  (setq exwm-workspace-number 4)
+  (unless (get 'exwm-workspace-number 'saved-value)
+(setq exwm-workspace-number 4))
   ;; Make class name the buffer name
   (add-hook 'exwm-update-class-hook
 (lambda ()
@@ -52,17 +53,18 @@
 (interactive (list (read-shell-command "$ ")))
 (start-process-shell-command command nil command)))
   ;; Line-editing shortcuts
-  (setq exwm-input-simulation-keys
-'(([?\C-b] . [left])
-  ([?\C-f] . [right])
-  ([?\C-p] . [up])
-  ([?\C-n] . [down])
-  ([?\C-a] . [home])
-  ([?\C-e] . [end])
-  ([?\M-v] . [prior])
-  ([?\C-v] . [next])
-  ([?\C-d] . [delete])
-  ([?\C-k] . [S-end delete])))
+  (unless (get 'exwm-input-simulation-keys 'saved-value)
+(setq exwm-input-simulation-keys
+  '(([?\C-b] . [left])
+([?\C-f] . [right])
+([?\C-p] . [up])
+([?\C-n] . [down])
+([?\C-a] . [home])
+([?\C-e] . [end])
+([?\M-v] . [prior])
+([?\C-v] . [next])
+([?\C-d] . [delete])
+([?\C-k] . [S-end delete]
   ;; Enable EXWM
   (exwm-enable)
   ;; Configure Ido
diff --git a/exwm-input.el b/exwm-input.el
index 4f64d35..04020ac 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -915,8 +915,9 @@ Notes:
 * The predefined examples in the Customize interface are not guaranteed to
   work for all applications.  This can be tweaked on a per application basis
   with `exwm-input-set-local-simulation-keys'."
-  :type '(alist :key-type (choice (key-sequence :tag "Original"))
-:value-type (choice (key-sequence :tag "Move left" [left])
+  :type '(alist :key-type (key-sequence :tag "Original")
+:value-type (choice (key-sequence :tag "User-defined")
+(key-sequence :tag "Move left" [left])
 (key-sequence :tag "Move right" [right])
 (key-sequence :tag "Move up" [up])
 (key-sequence :tag "Move down" [down])
@@ -928,8 +929,7 @@ Notes:
 (key-sequence :tag "Paste" [C-v])
 (key-sequence :tag "Delete" [delete])
 (key-sequence :tag "Delete to EOL"
-  [S-end delete])
-(key-sequence :tag "User-defined")))
+  [S-end delete])))
   :set (lambda (symbol value)
  (set symbol value)
  (exwm-input--set-simulation-keys value)))



[elpa] externals/exwm 0dd909a 1/7: Stop hiding the minibuffer when a message is being displayed

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit 0dd909a11baf3d7d766c1672d726eb59b1474ef2
Author: Adrián Medraño Calvo 
Commit: Adrián Medraño Calvo 

Stop hiding the minibuffer when a message is being displayed

* exwm-workspace.el (exwm-workspace--echo-area-maybe-clear): New
function that postpones hiding the minibuffer when it's displaying
a message.
(exwm-workspace--on-echo-area-dirty): Use it.
---
 exwm-workspace.el | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index 383bf53..0f0d10c 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -1203,7 +1203,18 @@ Please check `exwm-workspace--minibuffer-own-frame-p' 
first."
 input-method-use-echo-area)
   (setq exwm-workspace--display-echo-area-timer
 (run-with-timer exwm-workspace-display-echo-area-timeout nil
-#'exwm-workspace--on-echo-area-clear)
+#'exwm-workspace--echo-area-maybe-clear)
+
+(defun exwm-workspace--echo-area-maybe-clear ()
+  "Eventually clear the echo area container."
+  (exwm--log)
+  (if (not (current-message))
+  (exwm-workspace--on-echo-area-clear)
+;; Reschedule.
+(cancel-timer exwm-workspace--display-echo-area-timer)
+(setq exwm-workspace--display-echo-area-timer
+  (run-with-timer exwm-workspace-display-echo-area-timeout nil
+  #'exwm-workspace--echo-area-maybe-clear
 
 (defun exwm-workspace--on-echo-area-clear ()
   "Run in echo-area-clear-hook to hide echo area container."



[elpa] externals/exwm e157282 6/7: Merge branch 'ieure/default-simulation-keys' into externals/exwm

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit e15728203834ac85a51997366d0a019acef56d6f
Merge: 0f7269c 97b1fb7
Author: Chris Feng 
Commit: Chris Feng 

Merge branch 'ieure/default-simulation-keys' into externals/exwm
---
 exwm-config.el | 60 --
 exwm-input.el  |  8 
 2 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/exwm-config.el b/exwm-config.el
index 50f1366..6635e43 100644
--- a/exwm-config.el
+++ b/exwm-config.el
@@ -31,38 +31,44 @@
 (defun exwm-config-default ()
   "Default configuration of EXWM."
   ;; Set the initial workspace number.
-  (setq exwm-workspace-number 4)
+  (unless (get 'exwm-workspace-number 'saved-value)
+(setq exwm-workspace-number 4))
   ;; Make class name the buffer name
   (add-hook 'exwm-update-class-hook
 (lambda ()
   (exwm-workspace-rename-buffer exwm-class-name)))
-  ;; 's-r': Reset
-  (exwm-input-set-key (kbd "s-r") #'exwm-reset)
-  ;; 's-w': Switch workspace
-  (exwm-input-set-key (kbd "s-w") #'exwm-workspace-switch)
-  ;; 's-N': Switch to certain workspace
-  (dotimes (i 10)
-(exwm-input-set-key (kbd (format "s-%d" i))
-`(lambda ()
-   (interactive)
-   (exwm-workspace-switch-create ,i
-  ;; 's-&': Launch application
-  (exwm-input-set-key (kbd "s-&")
-  (lambda (command)
-(interactive (list (read-shell-command "$ ")))
-(start-process-shell-command command nil command)))
+  ;; Global keybindings.
+  (unless (get 'exwm-input-global-keys 'saved-value)
+(setq exwm-input-global-keys
+  `(
+;; 's-r': Reset (to line-mode).
+([?\s-r] . exwm-reset)
+;; 's-w': Switch workspace.
+([?\s-w] . exwm-workspace-switch)
+;; 's-&': Launch application.
+([?\s-&] . (lambda (command)
+(interactive (list (read-shell-command "$ ")))
+(start-process-shell-command command nil command)))
+;; 's-N': Switch to certain workspace.
+,@(mapcar (lambda (i)
+`(,(kbd (format "s-%d" i)) .
+  (lambda ()
+(interactive)
+(exwm-workspace-switch-create ,i
+  (number-sequence 0 9)
   ;; Line-editing shortcuts
-  (setq exwm-input-simulation-keys
-'(([?\C-b] . [left])
-  ([?\C-f] . [right])
-  ([?\C-p] . [up])
-  ([?\C-n] . [down])
-  ([?\C-a] . [home])
-  ([?\C-e] . [end])
-  ([?\M-v] . [prior])
-  ([?\C-v] . [next])
-  ([?\C-d] . [delete])
-  ([?\C-k] . [S-end delete])))
+  (unless (get 'exwm-input-simulation-keys 'saved-value)
+(setq exwm-input-simulation-keys
+  '(([?\C-b] . [left])
+([?\C-f] . [right])
+([?\C-p] . [up])
+([?\C-n] . [down])
+([?\C-a] . [home])
+([?\C-e] . [end])
+([?\M-v] . [prior])
+([?\C-v] . [next])
+([?\C-d] . [delete])
+([?\C-k] . [S-end delete]
   ;; Enable EXWM
   (exwm-enable)
   ;; Configure Ido
diff --git a/exwm-input.el b/exwm-input.el
index 4f64d35..04020ac 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -915,8 +915,9 @@ Notes:
 * The predefined examples in the Customize interface are not guaranteed to
   work for all applications.  This can be tweaked on a per application basis
   with `exwm-input-set-local-simulation-keys'."
-  :type '(alist :key-type (choice (key-sequence :tag "Original"))
-:value-type (choice (key-sequence :tag "Move left" [left])
+  :type '(alist :key-type (key-sequence :tag "Original")
+:value-type (choice (key-sequence :tag "User-defined")
+(key-sequence :tag "Move left" [left])
 (key-sequence :tag "Move right" [right])
 (key-sequence :tag "Move up" [up])
 (key-sequence :tag "Move down" [down])
@@ -928,8 +929,7 @@ Notes:
 (key-sequence :tag "Paste" [C-v])
 (key-sequence :tag "Delete" [delete])
 (key-sequence :tag "Delete to EOL"
-  [S-end delete])
-(key-sequence :tag "User-defined")))
+  [S-end delete])))
   :set (lambda (symbol value)
  (set symbol value)
  (exwm-input--set-simulation-keys value)))



[elpa] externals/exwm 97b1fb7 4/7: Do the same for `exwm-input-global-keys'

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit 97b1fb7c13ad7505ffe144f15875b366f1619f29
Author: Chris Feng 
Commit: Chris Feng 

Do the same for `exwm-input-global-keys'
---
 exwm-config.el | 34 +++---
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/exwm-config.el b/exwm-config.el
index 8223633..6635e43 100644
--- a/exwm-config.el
+++ b/exwm-config.el
@@ -37,21 +37,25 @@
   (add-hook 'exwm-update-class-hook
 (lambda ()
   (exwm-workspace-rename-buffer exwm-class-name)))
-  ;; 's-r': Reset
-  (exwm-input-set-key (kbd "s-r") #'exwm-reset)
-  ;; 's-w': Switch workspace
-  (exwm-input-set-key (kbd "s-w") #'exwm-workspace-switch)
-  ;; 's-N': Switch to certain workspace
-  (dotimes (i 10)
-(exwm-input-set-key (kbd (format "s-%d" i))
-`(lambda ()
-   (interactive)
-   (exwm-workspace-switch-create ,i
-  ;; 's-&': Launch application
-  (exwm-input-set-key (kbd "s-&")
-  (lambda (command)
-(interactive (list (read-shell-command "$ ")))
-(start-process-shell-command command nil command)))
+  ;; Global keybindings.
+  (unless (get 'exwm-input-global-keys 'saved-value)
+(setq exwm-input-global-keys
+  `(
+;; 's-r': Reset (to line-mode).
+([?\s-r] . exwm-reset)
+;; 's-w': Switch workspace.
+([?\s-w] . exwm-workspace-switch)
+;; 's-&': Launch application.
+([?\s-&] . (lambda (command)
+(interactive (list (read-shell-command "$ ")))
+(start-process-shell-command command nil command)))
+;; 's-N': Switch to certain workspace.
+,@(mapcar (lambda (i)
+`(,(kbd (format "s-%d" i)) .
+  (lambda ()
+(interactive)
+(exwm-workspace-switch-create ,i
+  (number-sequence 0 9)
   ;; Line-editing shortcuts
   (unless (get 'exwm-input-simulation-keys 'saved-value)
 (setq exwm-input-simulation-keys



[elpa] externals/exwm 0f7269c 5/7: Add input method support

2019-02-06 Thread Chris Feng
branch: externals/exwm
commit 0f7269c4ec666eb8bcf2616abbb5af46087cbdea
Author: Chris Feng 
Commit: Chris Feng 

Add input method support

; The code is basically refactored from
; https://github.com/ch11ng/exim to get better maintenance.

* exwm-xim.el: New module making Emacs's builtin input methods usable
for interacting with X windows.

* exwm-core.el (exwm--intern-atom): New function for intern X11 atoms.
* exwm-input.el (exwm-input--init):
* exwm-manage.el (exwm-manage--init): Use it.
---
 README.md  |   3 +-
 exwm-core.el   |   9 +
 exwm-input.el  |  15 +-
 exwm-manage.el |   9 +-
 exwm-randr.el  |  11 +-
 exwm-systemtray.el |   7 +-
 exwm-xim.el| 781 +
 xinitrc|  19 +-
 8 files changed, 812 insertions(+), 42 deletions(-)

diff --git a/README.md b/README.md
index 103948c..6d7e0dd 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,8 @@ It features:
 + Dynamic workspace support
 + ICCCM/EWMH compliance
 + (Optional) RandR (multi-monitor) support
-+ (Optional) Built-in system tray
++ (Optional) Builtin system tray
++ (Optional) Builtin input method
 
 Please check out the
 [screenshots](https://github.com/ch11ng/exwm/wiki/Screenshots)
diff --git a/exwm-core.el b/exwm-core.el
index e13a319..9b6877b 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -131,6 +131,15 @@ Nil can be passed as placeholder."
  (if height xcb:ConfigWindow:Height 0))
  :x x :y y :width width :height height)))
 
+(defun exwm--intern-atom (atom)
+  "Intern X11 ATOM."
+  (slot-value (xcb:+request-unchecked+reply exwm--connection
+  (make-instance 'xcb:InternAtom
+ :only-if-exists 0
+ :name-len (length atom)
+ :name atom))
+  'atom))
+
 (defmacro exwm--defer (secs function &rest args)
   "Defer the execution of FUNCTION.
 
diff --git a/exwm-input.el b/exwm-input.el
index a44bd93..4f64d35 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -542,9 +542,9 @@ instead."
 (exwm-input--update-global-prefix-keys)))
 
 ;; Putting (t . EVENT) into `unread-command-events' does not really work
-;; as documented for Emacs < 27.
+;; as documented for Emacs < 26.2.
 (eval-and-compile
-  (if (< emacs-major-version 27)
+  (if (string-version-lessp emacs-version "26.2")
   (defsubst exwm-input--unread-event (event)
 (setq unread-command-events
   (append unread-command-events (list event
@@ -909,7 +909,7 @@ Notes:
 * Setting the value directly (rather than customizing it) after EXWM
   finishes initialization has no effect.
 * Original-keys consist of multiple key events are only supported in Emacs
-  27 and later.
+  26.2 and later.
 * A minority of applications do not accept simulated keys by default.  It's
   required to customize them to accept events sent by SendEvent.
 * The predefined examples in the Customize interface are not guaranteed to
@@ -1035,14 +1035,7 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key 
sequences."
   (make-instance 'xcb:ewmh:set-_NET_WM_NAME
  :window exwm-input--timestamp-window
  :data "EXWM: exwm-input--timestamp-window"))
-  (let ((atom "_TIME"))
-(setq exwm-input--timestamp-atom
-  (slot-value (xcb:+request-unchecked+reply exwm--connection
-  (make-instance 'xcb:InternAtom
- :only-if-exists 0
- :name-len (length atom)
- :name atom))
-  'atom)))
+  (setq exwm-input--timestamp-atom (exwm--intern-atom "_TIME"))
   ;; Initialize global keys.
   (dolist (i exwm-input-global-keys)
 (exwm-input--set-key (car i) (cdr i)))
diff --git a/exwm-manage.el b/exwm-manage.el
index 759ec0b..b41512c 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -715,14 +715,7 @@ border-width: %d; sibling: #x%x; stack-mode: %d"
   "Initialize manage module."
   ;; Intern _MOTIF_WM_HINTS
   (exwm--log)
-  (let ((atom-name "_MOTIF_WM_HINTS"))
-(setq exwm-manage--_MOTIF_WM_HINTS
-  (slot-value (xcb:+request-unchecked+reply exwm--connection
-  (make-instance 'xcb:InternAtom
- :only-if-exists 0
- :name-len (length atom-name)
- :name atom-name))
-  'atom)))
+  (setq exwm-manage--_MOTIF_WM_HINTS (exwm--intern-atom "_MOTIF_WM_HINTS"))
   (add-hook 'after-make-frame-functions #'exwm-manage--add-frame)
   (add-hook 'delete-frame-functions #'exwm-manage--remove-frame)
   (xcb:+event exwm--connection 'xcb:ConfigureRequest
diff --git a/exwm-randr.el b/exwm-randr.el
index 4338152..7d20022 100644
--- a/exwm-randr.el
+++ b

[elpa] master be18c4d 4/4: Merge commit '83aa4099b048ff883071b4598d88a084de47d3bf'

2019-02-06 Thread Stephen Leake
branch: master
commit be18c4daccf08d8db9a4603a575322aca7035942
Merge: be1367a 83aa409
Author: Stephen Leake 
Commit: Stephen Leake 

Merge commit '83aa4099b048ff883071b4598d88a084de47d3bf'
---
 externals-list | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/externals-list b/externals-list
index 2098587..b2dd210 100644
--- a/externals-list
+++ b/externals-list
@@ -83,6 +83,8 @@
  ("gnome-c-style"  :subtree "https://github.com/ueno/gnome-c-style.git";)
  ("gnorb"   :subtree "https://github.com/girzel/gnorb";)
  ("gpastel":external 
"https://gitlab.petton.fr/DamienCassou/gpastel";)
+ ;; FIXME: Waiting for copyright paperwork
+ ;; ("greader" :external 
"https://gitlab.com/michelangelo-rodriguez/greader";)
  ("highlight-escape-sequences" :subtree 
"https://github.com/dgutov/highlight-escape-sequences/";)
  ("hyperbole"   :external 
"http://git.savannah.gnu.org/r/hyperbole.git";)
  ("ioccur" :subtree 
"https://github.com/thierryvolpiatto/ioccur.git";)
@@ -157,6 +159,7 @@
  ("websocket"  :subtree 
"https://github.com/ahyatt/emacs-websocket.git";)
  ("which-key"   :subtree "https://github.com/justbur/emacs-which-key";)
  ("xelb"   :external "https://github.com/ch11ng/xelb.git";)
+ ("xr" :external "https://github.com/mattiase/xr";)
  ("yasnippet"  :subtree 
"https://github.com/capitaomorte/yasnippet.git";)
  ("zones"  :external nil)  
;https://www.emacswiki.org/emacs/zones.el
  ("ztree"  :subtree "https://github.com/fourier/ztree";)



[elpa] master 652f07b 1/4: Improve path-iterator handline of duplicate directories

2019-02-06 Thread Stephen Leake
branch: master
commit 652f07b2289c41139e810aacd0d73b7c2ae60e2b
Author: Stephen Leake 
Commit: Stephen Leake 

Improve path-iterator handline of duplicate directories

* packages/path-iterator/path-iterator.el (path-iter-done): Delete; not
correct when non-recursive path contains duplicate directories, or
directories included in the recursive path.
(path-iter-next): Do recursive first, to properly handle duplicates in
non-recursive. Don't push nil onto visited for duplicates.
(path-iter-all-files): Don't use path-iter-done.

* packages/path-iterator/path-iterator-test.el: Match code changes, test
duplicate.
---
 packages/path-iterator/path-iterator-test.el |  19 -
 packages/path-iterator/path-iterator.el  | 121 ---
 2 files changed, 69 insertions(+), 71 deletions(-)

diff --git a/packages/path-iterator/path-iterator-test.el 
b/packages/path-iterator/path-iterator-test.el
index 780e744..4986842 100644
--- a/packages/path-iterator/path-iterator-test.el
+++ b/packages/path-iterator/path-iterator-test.el
@@ -37,9 +37,9 @@ iterator built from PATH-NON-RECURSIVE, PATH-RECURSIVE, 
IGNORE-FUNCTION."
  ))
 
 (defun path-iter-test-run-1 (iter expected-dirs)
-  (let (computed-dirs)
-(while (not (path-iter-done iter))
-  (push (path-iter-next iter) computed-dirs))
+  (let (dir computed-dirs)
+(while (setq dir (path-iter-next iter))
+  (push dir computed-dirs))
 (should (null (path-iter-next iter)))
 (setq computed-dirs (nreverse computed-dirs))
 (should (equal computed-dirs expected-dirs))
@@ -86,10 +86,23 @@ iterator built from PATH-NON-RECURSIVE, PATH-RECURSIVE, 
IGNORE-FUNCTION."
   (list
(concat path-iter-root-dir "/bob-1"))
   (list
+   (concat path-iter-root-dir "/bob-1")
+   (concat path-iter-root-dir "/bob-1/bob-2")
+   (concat path-iter-root-dir "/bob-1/bob-3")
+   (concat path-iter-root-dir "/alice-1")
+   ))
+
+(path-iter-deftest dup
+  (list
(concat path-iter-root-dir "/alice-1")
+   (concat path-iter-root-dir "/bob-1")) ;; non-recursive
+  (list
+   (concat path-iter-root-dir "/bob-1")) ;; recursive
+  (list
(concat path-iter-root-dir "/bob-1")
(concat path-iter-root-dir "/bob-1/bob-2")
(concat path-iter-root-dir "/bob-1/bob-3")
+   (concat path-iter-root-dir "/alice-1")
))
 
 (defvar path-iter-ignore-bob nil
diff --git a/packages/path-iterator/path-iterator.el 
b/packages/path-iterator/path-iterator.el
index 6bd3504..5598e57 100644
--- a/packages/path-iterator/path-iterator.el
+++ b/packages/path-iterator/path-iterator.el
@@ -40,9 +40,6 @@
 ;;
 ;; Other functions:
 ;;
-;; path-iter-done: non-nil if the iterator is done (all directories
-;; have been returned).
-;;
 ;; path-iter-next: return the next directory, or nil if done.
 ;;
 ;; path-iter-restart: restart iterator; next call to `path-iter-next'
@@ -136,30 +133,17 @@ If an element of PATH is nil, `default-directory' is 
used."
  path)
 (nreverse result)))
 
-(cl-defmethod path-iter-done ((iter path-iterator))
-"Return non-nil if ITER is done."
-  (cond
-   ((listp (path-iter-visited iter))
-;; First iteration
-(and (null (car (path-iter-path-non-recursive iter)))
-(null (car (path-iter-path-recursive iter)
-
-   (t
-;; Subsequent iterations
-(= (1+ (path-iter-current iter)) (length (path-iter-visited iter
-   ))
-
 (cl-defmethod path-iter-next ((iter path-iterator))
   "Return the next directory to visit, or nil if there are no more.
 
-The iterator will first visit all elements of the non-recursive
-path, then all elements of the recursive path, and visit all
-subdirectories of the recursive path for which `ignore-function'
-returns nil, in depth-first order (parent directories are visited
-before their subdirectories; sibling directories are visited
-after subdirectories), but will not visit any directory more than
-once. The order of subdirectories within a directory is given by
-`directory-files'.
+The iterator will first visit all elements of the recursive path,
+visiting all subdirectories of the recursive path for which
+`ignore-function' returns nil, in depth-first order (parent
+directories are visited before their subdirectories; sibling
+directories are visited after subdirectories); then visit all
+directories in the non-recursive path, but will not visit any
+directory more than once. The order of subdirectories within a
+directory is given by `directory-files'.
 
 `ignore-function' is passed one argument; the directory file
 name. Symlinks in the directory part are resolved, but the
@@ -171,51 +155,53 @@ not end in a slash, have casing that matches the existing
 directory file name, and resolve simlinks (see `file-truename')."
   (cond
((and (listp (path-iter-visited iter))
-(not (null (path-iter-path-non-recursive iter
-;; First iteration, doing non-recursive path
-(let ((result (pop (path-iter-path-non-recursive iter
+(not (null (p

[elpa] master be1367a 3/4: Fix bugs in uniquify-files

2019-02-06 Thread Stephen Leake
branch: master
commit be1367a01d4e322ab592d1882371852005f773c4
Author: Stephen Leake 
Commit: Stephen Leake 

Fix bugs in uniquify-files

* packages/uniquify-files/file-complete-root-relative.el:
(fc-root-rel-completion-table-list): Enforce directory-file-name for
root.

* packages/uniquify-files/uniquify-files.el:
(locate-uniquified-file-iter-2): Set completion-category-overrides.
---
 packages/uniquify-files/file-complete-root-relative.el | 6 +++---
 packages/uniquify-files/uniquify-files.el  | 6 --
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/packages/uniquify-files/file-complete-root-relative.el 
b/packages/uniquify-files/file-complete-root-relative.el
index 3f66809..929afdc 100644
--- a/packages/uniquify-files/file-complete-root-relative.el
+++ b/packages/uniquify-files/file-complete-root-relative.el
@@ -368,7 +368,7 @@ STRING, PRED, ACTION are completion table arguments."
  (list
   '(category . project-file)
   '(styles . (file-root-rel))
-  (cons 'root root
+  (cons 'root (directory-file-name root)
 
((null action)
 ;; Called from `try-completion'; should never get here (see
@@ -379,7 +379,7 @@ STRING, PRED, ACTION are completion table arguments."
  '(lambda ;; Called from `test-completion'
 t))   ;; Called from all-completions
 
-(let ((regex (fc-root-rel--pcm-pattern-list string root))
+(let ((regex (fc-root-rel--pcm-pattern-list string (directory-file-name 
root)))
  (result nil)
  (case-fold-search completion-ignore-case))
 
@@ -394,7 +394,7 @@ STRING, PRED, ACTION are completion table arguments."
   (cond
((eq action 'lambda)
;; Called from `test-completion'
-   (fc-root-rel--valid-completion string result root))
+   (fc-root-rel--valid-completion string result (directory-file-name 
root)))
 
((eq action t)
;; Called from all-completions
diff --git a/packages/uniquify-files/uniquify-files.el 
b/packages/uniquify-files/uniquify-files.el
index 59575c2..a281ebb 100644
--- a/packages/uniquify-files/uniquify-files.el
+++ b/packages/uniquify-files/uniquify-files.el
@@ -808,8 +808,10 @@ In the user input string, `*' is treated as a wildcard."
 (defun locate-uniquified-file-iter-2 (iter &optional predicate default prompt)
   "Same as `locate-uniquified-file-iter', but the internal
 completion table is the list returned by `path-iter-all-files'."
-  (let ((table (path-iter-all-files iter))
-   (completion-styles '(uniquify-file)))
+  (let* ((table (path-iter-all-files iter))
+(table-styles (cdr (assq 'styles (completion-metadata "" table nil
+(completion-category-overrides
+ (list (list 'project-file (cons 'styles table-styles)
 (completing-read (format (concat (or prompt "file") " (%s): ") default)
 table
 predicate t nil nil default)



[elpa] master updated (83aa409 -> be18c4d)

2019-02-06 Thread Stephen Leake
stephen_leake pushed a change to branch master.

  from  83aa409   * externals-list (xr): New package
   new  652f07b   Improve path-iterator handline of duplicate directories
   new  1ed6707   Improve uniquify-files in corner case
   new  be1367a   Fix bugs in uniquify-files
   new  be18c4d   Merge commit '83aa4099b048ff883071b4598d88a084de47d3bf'


Summary of changes:
 packages/path-iterator/path-iterator-test.el   |  19 +++-
 packages/path-iterator/path-iterator.el| 121 +
 .../uniquify-files/file-complete-root-relative.el  |   6 +-
 packages/uniquify-files/uniquify-files-test.el |   4 +
 packages/uniquify-files/uniquify-files.el  |  30 +++--
 5 files changed, 96 insertions(+), 84 deletions(-)



[elpa] master 1ed6707 2/4: Improve uniquify-files in corner case

2019-02-06 Thread Stephen Leake
branch: master
commit 1ed670767339d2300f6818c2b7df4df6b36723c0
Author: Stephen Leake 
Commit: Stephen Leake 

Improve uniquify-files in corner case

* packages/uniquify-files/uniquify-files.el (uniq-file--dir-match):
Include trailing directories.
(locate-uniquified-file-iter, -2): Set completion-category-overrides.

* packages/uniquify-files/uniquify-files-test.el:
(test-uniq-file-all-completions-noface-1): Add test of corner case.
---
 packages/uniquify-files/uniquify-files-test.el |  4 
 packages/uniquify-files/uniquify-files.el  | 24 
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/packages/uniquify-files/uniquify-files-test.el 
b/packages/uniquify-files/uniquify-files-test.el
index 8950cbd..4dc1923 100644
--- a/packages/uniquify-files/uniquify-files-test.el
+++ b/packages/uniquify-files/uniquify-files-test.el
@@ -356,6 +356,10 @@
  "foo-file4.text"
  "foo-file4.text")))
 
+  (should (equal (sort (uniq-file-all-completions "foo-file4.text")))
+
   (should (equal (uniq-file-all-completions "f-file5" table nil nil)
 (list "foo-file5.text")))
 
diff --git a/packages/uniquify-files/uniquify-files.el 
b/packages/uniquify-files/uniquify-files.el
index b36ec11..59575c2 100644
--- a/packages/uniquify-files/uniquify-files.el
+++ b/packages/uniquify-files/uniquify-files.el
@@ -191,17 +191,20 @@ Match 1 is the filename, match 2 is the relative 
directory.")
   (regex (completion-pcm--pattern->regex pattern)))
 
   ;; `regex' is anchored at the beginning; delete the anchor to
-  ;; match a directory in the middle of ABS.  Also extend
-  ;; the match to the bounding '/'.
+  ;; match a directory in the middle of ABS.
   (setq regex (substring regex 2))
+
+  ;; Include the preceding and following '/' .
   (unless (= ?/ (aref regex 0))
(setq regex (concat "/" regex)))
   (unless (= ?/ (aref regex (1- (length regex
(setq regex (concat regex "[^/]*/" )))
 
   (when (string-match regex abs);; Should never fail, but gives obscure 
error if it does
-   ;; Drop the leading '/'
-   (substring (match-string 0 abs) 1))
+
+   ;; Drop the leading '/', include all trailing directories;
+   ;; consider Bob/alice-3/foo, Alice/alice-3/foo.
+   (substring abs (1+ (match-beginning 0
   ))
 
(t
@@ -792,10 +795,15 @@ file name is included in the result if PRED returns
 non-nil. DEFAULT is the default for completion.
 
 In the user input string, `*' is treated as a wildcard."
-  (completing-read (format (concat (or prompt "file") " (%s): ") default)
-  (apply-partially #'uniq-file-completion-table iter)
-  predicate t nil nil default)
-  )
+  (let* ((table (apply-partially #'uniq-file-completion-table iter))
+(table-styles (cdr (assq 'styles (completion-metadata "" table nil
+(completion-category-overrides
+ (list (list 'project-file (cons 'styles table-styles)
+
+(completing-read (format (concat (or prompt "file") " (%s): ") default)
+table
+predicate t nil nil default)
+))
 
 (defun locate-uniquified-file-iter-2 (iter &optional predicate default prompt)
   "Same as `locate-uniquified-file-iter', but the internal