[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2bc9146 22/24: hydra.el: Use add/remove-function. Fix warn
From: |
Oleh Krehel |
Subject: |
[elpa] master 2bc9146 22/24: hydra.el: Use add/remove-function. Fix warning. |
Date: |
Fri, 01 May 2015 14:27:23 +0000 |
branch: master
commit 2bc9146199a3d3f3eda29508a53e147974dfbc3d
Author: Stefan Monnier <address@hidden>
Commit: Oleh Krehel <address@hidden>
hydra.el: Use add/remove-function. Fix warning.
* hydra.el (hydra--input-method-function): Move before first use.
(hydra--imf): New function.
(hydra-default-pre, hydra-disable): Use add/remove-function.
---
hydra.el | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/hydra.el b/hydra.el
index dd58e63..3412ca5 100644
--- a/hydra.el
+++ b/hydra.el
@@ -141,9 +141,11 @@ warn: keep KEYMAP and issue a warning instead of running
the command."
(when overriding-terminal-local-map
(internal-pop-keymap hydra-curr-map 'overriding-terminal-local-map)
(unless hydra--ignore
- (when hydra--input-method-function
- (setq input-method-function hydra--input-method-function)
- (setq hydra--input-method-function nil))
+ (if (fboundp 'remove-function)
+ (remove-function input-method-function #'hydra--imf)
+ (when hydra--input-method-function
+ (setq input-method-function hydra--input-method-function)
+ (setq hydra--input-method-function nil)))
(when hydra-curr-on-exit
(let ((on-exit hydra-curr-on-exit))
(setq hydra-curr-on-exit nil)
@@ -373,12 +375,16 @@ Return DEFAULT if PROP is not in H."
((blue teal) t)
(t nil)))))
+(defalias 'hydra--imf #'list)
+
(defun hydra-default-pre ()
"Default setup that happens in each head before :pre."
(when (eq input-method-function 'key-chord-input-method)
- (unless hydra--input-method-function
- (setq hydra--input-method-function input-method-function)
- (setq input-method-function nil))))
+ (if (fboundp 'add-function)
+ (add-function :override input-method-function #'hydra--imf)
+ (unless hydra--input-method-function
+ (setq hydra--input-method-function input-method-function)
+ (setq input-method-function nil)))))
(defvar hydra-timeout-timer (timer-create)
"Timer for `hydra-timeout'.")
@@ -1030,11 +1036,11 @@ DOC defaults to TOGGLE-NAME split and capitalized."
0
i)))))
-(provide 'hydra)
-
;; Local Variables:
;; outline-regexp: ";;\\([;*]+ [^\s\t\n]\\|###autoload\\)\\|("
;; indent-tabs-mode: nil
;; End:
+(provide 'hydra)
+
;;; hydra.el ends here
- [elpa] master 00d2c0c 11/24: Add lv-force-update, (continued)
- [elpa] master 00d2c0c 11/24: Add lv-force-update, Oleh Krehel, 2015/05/01
- [elpa] master 824f105 12/24: Optionally separate lv window and echo area using a thin line, Oleh Krehel, 2015/05/01
- [elpa] master dd02b16 13/24: .dir-locals.el: Add, Oleh Krehel, 2015/05/01
- [elpa] master bf48e63 14/24: lv.el (lv-force-update): Be nil by default, Oleh Krehel, 2015/05/01
- [elpa] master 0ae560a 15/24: lv.el (lv-message): Use `lv-use-separator', Oleh Krehel, 2015/05/01
- [elpa] master 270c38b 16/24: Add a work-around for pop-to-buffer / dedicated bug, Oleh Krehel, 2015/05/01
- [elpa] master 8db62bf 17/24: Make *LV* window fixed size, Oleh Krehel, 2015/05/01
- [elpa] master 6524a2c 19/24: hydra.el (hydra-fontify-head-default): Fixup, Oleh Krehel, 2015/05/01
- [elpa] master 319ac87 20/24: hydra.el (hydra-key-format-spec): Declare obsolete, Oleh Krehel, 2015/05/01
- [elpa] master c78367f 21/24: hydra.el (hydra-cell-format): Change to defvar, Oleh Krehel, 2015/05/01
- [elpa] master 2bc9146 22/24: hydra.el: Use add/remove-function. Fix warning.,
Oleh Krehel <=
- [elpa] master 370a862 18/24: Repurpose `hydra--complain' for debugging, Oleh Krehel, 2015/05/01
- [elpa] master 1380f8c 23/24: hydra.el: Bump version, Oleh Krehel, 2015/05/01
- [elpa] master fddedd2 24/24: Merge commit '1380f8c1a51f31514125a08f632d017cdfb8e26e' from hydra, Oleh Krehel, 2015/05/01