about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2019-10-13T00·00+0000
committerChris Feng <chris.w.feng@gmail.com>2019-10-13T00·00+0000
commit3c8b39505825eff7e2b61e09833374d904926724 (patch)
tree1556c7597785e1120f2102135b481afb7cb19ec1
parent5a43dbecc759fccdd1adcaae5c073bdb4d88d856 (diff)
Fix `exwm-input-set-simulation-key'
* exwm-input.el (exwm-input--read-keys): Return nil on empty input so
that `exwm-input-set-simulation-key' can ignore it.
(exwm-input-set-simulation-key): Improve prompt.
-rw-r--r--exwm-input.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/exwm-input.el b/exwm-input.el
index e6482193887a..34fe2221b744 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -976,7 +976,8 @@ Notes:
                                   (key-description (vector stop-key))
                                   (key-description keys)))
             keys (vconcat keys (vector key))))
-    (substring keys 0 -1)))
+    (when (> (length keys) 1)
+      (substring keys 0 -1))))
 
 ;;;###autoload
 (defun exwm-input-set-simulation-key (original-key simulated-key)
@@ -987,10 +988,11 @@ ends unless it's specifically saved in the Customize interface for
 `exwm-input-simulation-keys'."
   (interactive
    (let (original simulated)
-     (setq original (exwm-input--read-keys "Original keys" ?\C-g))
+     (setq original (exwm-input--read-keys "Translate from" ?\C-g))
      (when original
        (setq simulated (exwm-input--read-keys
-                        (format "Simulate %s as" (key-description original))
+                        (format "Translate from %s to"
+                                (key-description original))
                         ?\C-g)))
      (list original simulated)))
   (exwm--log "original: %s, simulated: %s" original-key simulated-key)