From 46e1d7a754bdf66cf89e6d3fad3d1c4bf003db3a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 19 Feb 2017 14:53:43 -0800 Subject: [PATCH 1/2] Use let instead of setq when setting exwm-input--line-mode-passthrough That way, exwm won't clobber user modifications to this variable. --- exwm-input.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/exwm-input.el b/exwm-input.el index d410bec79..22e21d69a 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -629,16 +629,15 @@ This value should always be overwritten.") (let (key keys) (dotimes (i times) ;; Skip events not from keyboard - (setq exwm-input--line-mode-passthrough t) - (catch 'break - (while t - (setq key (read-key (format "Send key: %s (%d/%d)" - (key-description keys) - (1+ i) times))) - (when (and (listp key) (eq (car key) t)) - (setq key (cdr key))) - (unless (listp key) (throw 'break nil)))) - (setq exwm-input--line-mode-passthrough nil) + (let ((exwm-input--line-mode-passthrough t)) + (catch 'break + (while t + (setq key (read-key (format "Send key: %s (%d/%d)" + (key-description keys) + (1+ i) times))) + (when (and (listp key) (eq (car key) t)) + (setq key (cdr key))) + (unless (listp key) (throw 'break nil))))) (setq keys (vconcat keys (vector key))) (exwm-input--fake-key key)))) From d0e98957485afa6a91d3c8be1520d65e46987718 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Fri, 24 Feb 2017 23:25:02 +0800 Subject: [PATCH 2/2] ; Expose `exwm-input-line-mode-passthrough' as a public interface. --- exwm-core.el | 4 ++-- exwm-input.el | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exwm-core.el b/exwm-core.el index c5f28cb79..750f134d1 100644 --- a/exwm-core.el +++ b/exwm-core.el @@ -80,7 +80,7 @@ (logior xcb:EventMask:StructureNotify xcb:EventMask:PropertyChange)) "Event mask set on all managed windows.") -(defvar exwm-input--line-mode-passthrough) +(defvar exwm-input-line-mode-passthrough) (defvar exwm-input--global-prefix-keys) (defvar exwm-input-prefix-keys) (defvar exwm-input--simulation-prefix-keys) @@ -154,7 +154,7 @@ (lambda () (interactive) (cond - ((or exwm-input--line-mode-passthrough + ((or exwm-input-line-mode-passthrough ;; Do not test `exwm-input--during-command'. (active-minibuffer-window) (memq last-input-event exwm-input--global-prefix-keys) diff --git a/exwm-input.el b/exwm-input.el index 22e21d69a..809f41ece 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -420,7 +420,7 @@ This value should always be overwritten.") (defvar exwm-input--during-command nil "Indicate whether between `pre-command-hook' and `post-command-hook'.") -(defvar exwm-input--line-mode-passthrough nil +(defvar exwm-input-line-mode-passthrough nil "Non-nil makes 'line-mode' forwards all events to Emacs.") (defvar exwm-input--line-mode-cache nil "Cache for incomplete key sequence.") @@ -449,7 +449,7 @@ This value should always be overwritten.") (setq event (xcb:keysyms:keysym->event exwm--connection (car keysym) (logand state (lognot (cdr keysym))))) - (or exwm-input--line-mode-passthrough + (or exwm-input-line-mode-passthrough exwm-input--during-command ;; Forward the event when there is an incomplete key ;; sequence or when the minibuffer is active. @@ -629,7 +629,7 @@ This value should always be overwritten.") (let (key keys) (dotimes (i times) ;; Skip events not from keyboard - (let ((exwm-input--line-mode-passthrough t)) + (let ((exwm-input-line-mode-passthrough t)) (catch 'break (while t (setq key (read-key (format "Send key: %s (%d/%d)"