From 3d648ef1c4a754ad89083868190b8e982568b6f5 Mon Sep 17 00:00:00 2001 From: Feng Shu Date: Fri, 23 Apr 2021 19:15:53 +0800 Subject: [PATCH] Add variable indicating XIM buffers * exwm-xim.el (exwm-xim-buffer-p): New variable. (exwm-xim--handle-forward-event-request): Add exwm-xim-buffer-p --- exwm-xim.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/exwm-xim.el b/exwm-xim.el index acf718e..86b82ed 100644 --- a/exwm-xim.el +++ b/exwm-xim.el @@ -161,6 +161,10 @@ C,no" (defvar exwm-xim--_XIM_PROTOCOL nil) (defvar exwm-xim--_XIM_XCONNECT nil) +(defvar exwm-xim-buffer-p nil + "Whether current buffer is used by exwm-xim.") +(make-variable-buffer-local 'exwm-xim-buffer-p) + (defun exwm-xim--on-SelectionRequest (data _synthetic) "Handle SelectionRequest events on IMS window. @@ -585,6 +589,9 @@ The actual XIM request is in client message data or a property." (exwm-input--grab-keyboard)) (unwind-protect (with-temp-buffer + ;; This variable is used to test whether exwm-xim is enabled. + ;; Used by e.g. pyim-probe. + (setq-local exwm-xim-buffer-p t) ;; Always show key strokes. (let ((input-method-use-echo-area t) (exwm-input-line-mode-passthrough t))