[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.
- [elpa] master updated (d44f2ad -> 3c57fa9), Oleh Krehel, 2015/02/04
- [elpa] master 7222773 3/6: hydra.el (hydra-disable): adapt to Emacs 24.4.1,
Oleh Krehel <=
- [elpa] master b60201f 4/6: Bump version, Oleh Krehel, 2015/02/04
- [elpa] master b963c70 5/6: Improve the names of functions generated from lambdas, Oleh Krehel, 2015/02/04
- [elpa] master 222ba95 2/6: hydra-examples.el: splitters take numeric argument, Oleh Krehel, 2015/02/04
- [elpa] master 0b6ef70 1/6: Add support for `universal-argument' and `digit-argument', Oleh Krehel, 2015/02/04
- [elpa] master 3c57fa9 6/6: Merge commit 'b963c70dcf211c86d4bb03bfd4a20c6807cbe679' from hydra, Oleh Krehel, 2015/02/04