]> code.delx.au - gnu-emacs-elpa/commitdiff
Try to re-encode the input in the terminal
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 31 Mar 2015 13:35:25 +0000 (15:35 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Sat, 11 Apr 2015 09:07:17 +0000 (11:07 +0200)
* hydra.el (hydra--handle-nonhead): Update. Most interesting sequences
  start with [27 91] or [27 79]. It's hard to do it for all of them.

Re #90

hydra.el

index c817a3f607bcc831dc02ec4a7d823896c0a350bf..1cac1f5d695bbe61471b2c5a4d6d3e0959561dfb 100644 (file)
--- a/hydra.el
+++ b/hydra.el
@@ -682,10 +682,21 @@ NAME, BODY and HEADS are parameters to `defhydra'."
                      `(lambda ()
                         (interactive)
                         ,(cond
-                          ((memq body-color '(amaranth teal))
-                           '(message "An amaranth Hydra can only exit through a blue head"))
-                          (t
-                           '(hydra-pink-fallback)))
+                           ((memq body-color '(amaranth teal))
+                            '(let ((k (or (lookup-key
+                                           input-decode-map
+                                           (vconcat [27 91]
+                                                    (this-command-keys-vector)))
+                                          (lookup-key
+                                           input-decode-map
+                                           (vconcat [27 79]
+                                                    (this-command-keys-vector)))))
+                                   f)
+                              (if (and k (setq f (lookup-key test/keymap k)))
+                                  (funcall f)
+                                (message "An amaranth Hydra can only exit through a blue head"))))
+                           (t
+                            '(hydra-pink-fallback)))
                         (hydra-set-transient-map hydra-curr-map t)
                         (when hydra-is-helpful
                           (unless hydra-lv