emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 7222773 3/6: hydra.el (hydra-disable): adapt to Emacs 24.4


From: Oleh Krehel
Subject: [elpa] master 7222773 3/6: hydra.el (hydra-disable): adapt to Emacs 24.4.1
Date: Wed, 04 Feb 2015 18:51:20 +0000

branch: master
commit 7222773c5685b6858707a9d3d1acae2612711bb3
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    hydra.el (hydra-disable): adapt to Emacs 24.4.1
    
    The old thing should work for Emacs 25, and some versions older than
    24.4.1.
    
    Fixes #14.
---
 hydra.el |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/hydra.el b/hydra.el
index 03b3819..2f4f12e 100644
--- a/hydra.el
+++ b/hydra.el
@@ -188,13 +188,22 @@ It's intended for the echo area, when a Hydra is active."
 
 (defun hydra-disable ()
   "Disable the current Hydra."
-  (if (functionp hydra-last)
-      (funcall hydra-last)
-    (while (and (consp (car emulation-mode-map-alists))
-                (consp (caar emulation-mode-map-alists))
-                (equal (cl-cdaar emulation-mode-map-alists) ',keymap))
-      (setq emulation-mode-map-alists
-            (cdr emulation-mode-map-alists)))))
+  (cond
+    ;; Emacs 25
+    ((functionp hydra-last)
+     (funcall hydra-last))
+
+    ;; Emacs 24.4.1
+    ((boundp 'overriding-terminal-local-map)
+     (setq overriding-terminal-local-map nil))
+
+    ;; older
+    (t
+     (while (and (consp (car emulation-mode-map-alists))
+                 (consp (caar emulation-mode-map-alists))
+                 (equal (cl-cdaar emulation-mode-map-alists) ',keymap))
+       (setq emulation-mode-map-alists
+             (cdr emulation-mode-map-alists))))))
 
 (defun hydra--doc (body-key body-name heads)
   "Generate a part of Hydra docstring.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]