branch: elpa/helm
commit e86dd4b761db543cc9a05c0518a2efc539efa02d
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Simplify the helm-command-prefix-key set function
---
 helm-global-bindings.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/helm-global-bindings.el b/helm-global-bindings.el
index b2a17a11a8..0bd318d014 100644
--- a/helm-global-bindings.el
+++ b/helm-global-bindings.el
@@ -39,12 +39,10 @@ Using `setq' to modify this variable will have no effect."
   :type '(choice (string :tag "Key") (const :tag "no binding"))
   :set
   (lambda (var key)
-    (when (and (boundp var) (symbol-value var))
-      (define-key (current-global-map)
-          (read-kbd-macro (symbol-value var)) nil))
+    (helm-aif (and (boundp var) (symbol-value var))
+        (global-unset-key (read-kbd-macro it)))
     (when key
-      (define-key (current-global-map)
-          (read-kbd-macro key) 'helm-command-prefix))
+      (global-set-key (read-kbd-macro key) 'helm-command-prefix))
     (set var key)))
 
 (defvar helm-command-map

Reply via email to