From 0f7269c4ec666eb8bcf2616abbb5af46087cbdea Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Wed, 6 Feb 2019 00:00:00 +0000 Subject: 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. --- exwm-input.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'exwm-input.el') diff --git a/exwm-input.el b/exwm-input.el index a44bd9334a63..4f64d35dd63d 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))) -- cgit 1.4.1