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

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

[elpa] 204/287: Allow ergoemacs-key to work outside of themes again


From: Matthew Fidler
Subject: [elpa] 204/287: Allow ergoemacs-key to work outside of themes again
Date: Wed, 02 Jul 2014 14:46:00 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 00d82af75c1de6dfe26c9fb69fa63d286f91c8db
Author: Matthew L. Fidler <address@hidden>
Date:   Mon Jun 23 22:04:04 2014 +0800

    Allow ergoemacs-key to work outside of themes again
---
 ergoemacs-theme-engine.el |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 94b743b..3787c13 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -2335,22 +2335,29 @@ When SILENT is true, also include silent themes"
 (defun ergoemacs-key (key function &optional desc only-first fixed-key)
   "Defines KEY in ergoemacs keyboard based on QWERTY and binds to FUNCTION.
 DESC is ignored, as is FIXED-KEY."
-  (let* ((key (or
-               (and (vectorp key) key)
-               (read-kbd-macro key t)))
-         (ergoemacs-force-just-first only-first)
-         (ergoemacs-force-variable t))
-    (ergoemacs-define-key 'global-map key function)))
+  (if (ergoemacs-theme-component-maps-p 
ergoemacs-theme-component-maps--curr-component)
+      (let* ((key (or
+                   (and (vectorp key) key)
+                   (read-kbd-macro key t)))
+             (ergoemacs-force-just-first only-first)
+             (ergoemacs-force-variable t))
+        (ergoemacs-define-key 'global-map key function))
+    (warn "ergoemacs-key is depreciated, use global-set-key instead.")
+    (global-set-key (ergoemacs-kbd key nil only-first) function)))
 
 (defun ergoemacs-fixed-key (key function &optional desc)
   "Defines fixed KEY in ergoemacs and binds to FUNCTION.
 Ignores DESC."
-  (let* ((key (or
-               (and (vectorp key) key)
-               (read-kbd-macro key t)))
-         (ergoemacs-force-just-first nil)
-         (ergoemacs-force-fixed t))
-    (ergoemacs-define-key 'global-map key function)))
+  (if (ergoemacs-theme-component-maps-p 
ergoemacs-theme-component-maps--curr-component)
+      (let* ((key (or
+                   (and (vectorp key) key)
+                   (read-kbd-macro key t)))
+             (ergoemacs-force-just-first nil)
+             (ergoemacs-force-fixed t))
+        (ergoemacs-define-key 'global-map key function))
+    (warn "ergoemacs-fixed-key is depreciated, use global-set-key instead.")
+    (global-set-key (if (vectorp key) key
+                      (read-kbd-macro key)) function)))
 
 (provide 'ergoemacs-theme-engine)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



reply via email to

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