[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 141/287: Add back ergoemacs-fixed-key and ergoemacs-key compatabi
From: |
Matthew Fidler |
Subject: |
[elpa] 141/287: Add back ergoemacs-fixed-key and ergoemacs-key compatability. |
Date: |
Wed, 02 Jul 2014 14:45:24 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit dc6dfe33f7233d1feba37e0f1968c77fe24d7cc2
Author: Matthew L. Fidler <address@hidden>
Date: Wed Jun 18 11:33:27 2014 -0500
Add back ergoemacs-fixed-key and ergoemacs-key compatability.
---
ergoemacs-theme-engine.el | 43 ++++++++++++++++++++++++-------------------
1 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 7b3b827..4e8816e 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -617,6 +617,9 @@ DEF is anything that can be a key's definition:
(with-slots (cmd-list) obj
cmd-list))
+(defvar ergoemacs-force-just-first nil)
+(defvar ergoemacs-force-variable nil)
+(defvar ergoemacs-force-fixed nil)
(defmethod ergoemacs-define-map--cmd-list ((obj ergoemacs-variable-map)
key-desc def no-unbind &optional desc)
"Add KEY-DESC for DEF to OBJ cmd-list slot.
Optionally use DESC when another description isn't found in
`ergoemacs-function-short-names'."
@@ -626,8 +629,9 @@ Optionally use DESC when another description isn't found in
`ergoemacs-function-
translation-assoc
just-first) obj
(let* ((final-desc (assoc def ergoemacs-function-short-names))
- (only-first (if (string= just-first "") nil
- (ignore-errors (string-match-p just-first key-desc))))
+ (only-first (or ergoemacs-force-just-first
+ (if (string= just-first "") nil
+ (ignore-errors (string-match-p just-first
key-desc)))))
(us-key
(or (and (string= layout "us") key-desc)
(let ((ergoemacs-translation-from layout)
@@ -783,8 +787,10 @@ Optionally use DESC when another description isn't found
in `ergoemacs-function-
variable-reg) obj
(let* ((key-desc (key-description key))
(key-vect (read-kbd-macro key-desc t)))
- (if (and (not (string= variable-reg ""))
- (ignore-errors (string-match-p variable-reg key-desc)))
+ (if (and (not ergoemacs-force-fixed)
+ (or ergoemacs-force-variable
+ (and (not (string= variable-reg ""))
+ (ignore-errors (string-match-p variable-reg
key-desc)))))
(ergoemacs-define-map variable key def no-unbind)
(ergoemacs-define-map fixed key def no-unbind))))
(oset obj keymap-hash (make-hash-table)))
@@ -2349,23 +2355,22 @@ 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-reg t))
- ;; (ergoemacs-theme-component--global-set-key key function))
- )
+ (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)))
(defun ergoemacs-fixed-key (key function &optional desc)
- "Defines fixed KEY in ergoemacs and binds to FUNCTION."
- ;; (let* ((key (or
- ;; (and (vectorp key) key)
- ;; (read-kbd-macro key t)))
- ;; (ergoemacs-force-just-first nil)
- ;; (ergoemacs-force-variable-reg nil))
- ;; (ergoemacs-theme-component--global-set-key key function))
- )
+ "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)))
(provide 'ergoemacs-theme-engine)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [elpa] 287/287: v5.14.07 - Changed theme definitions - Allow variables to be set in theme definitions, will be changed when variable exists. - Add Esperanto Layouts (Thanks to akfoss) - Fixed many menu issues (thanks to akfoss for pointing out) - Added travis support - Fixed ergoemacs-layout-programmer-dv (Thanks to bmalhorn) - Dropped support for Emacs 23 - Dropped various themes, plan on repackaging them separately. - Added support for locate-mode in `ergoemacs-open-in-external-app` (thanks to guoci) - Added standard Norweigian QWERTY layout (Thanks to oegly) - Changed ergoemacs-style key translation to be more ubiquitous by changing substitute-command-keys and other advices, (continued)
- [elpa] 287/287: v5.14.07 - Changed theme definitions - Allow variables to be set in theme definitions, will be changed when variable exists. - Add Esperanto Layouts (Thanks to akfoss) - Fixed many menu issues (thanks to akfoss for pointing out) - Added travis support - Fixed ergoemacs-layout-programmer-dv (Thanks to bmalhorn) - Dropped support for Emacs 23 - Dropped various themes, plan on repackaging them separately. - Added support for locate-mode in `ergoemacs-open-in-external-app` (thanks to guoci) - Added standard Norweigian QWERTY layout (Thanks to oegly) - Changed ergoemacs-style key translation to be more ubiquitous by changing substitute-command-keys and other advices, Matthew Fidler, 2014/07/02
- [elpa] 103/287: Attempt to restore last test engine and make cask use it, Matthew Fidler, 2014/07/02
- [elpa] 131/287: Be more careful in error checking for ergoemacs-rm-key, Matthew Fidler, 2014/07/02
- [elpa] 126/287: Documentation update., Matthew Fidler, 2014/07/02
- [elpa] 108/287: Removed stray saved variables, Matthew Fidler, 2014/07/02
- [elpa] 136/287: Fix Makefile to have test-dir, Matthew Fidler, 2014/07/02
- [elpa] 102/287: Require the libraries that may be needed..., Matthew Fidler, 2014/07/02
- [elpa] 128/287: Fix byte compile issues and remove gaia., Matthew Fidler, 2014/07/02
- [elpa] 139/287: Make TEST_DIR first, Matthew Fidler, 2014/07/02
- [elpa] 204/287: Allow ergoemacs-key to work outside of themes again, Matthew Fidler, 2014/07/02
- [elpa] 141/287: Add back ergoemacs-fixed-key and ergoemacs-key compatability.,
Matthew Fidler <=
- [elpa] 200/287: Declare undo-tree, Matthew Fidler, 2014/07/02
- [elpa] 111/287: No compiler warnings for ergoemacs-menus.el, Matthew Fidler, 2014/07/02
- [elpa] 112/287: Fix last compiler issue for ergoemacs-menus.el, Matthew Fidler, 2014/07/02
- [elpa] 91/287: All tests pass; ido-vertical doesn't have right keys, Matthew Fidler, 2014/07/02
- [elpa] 118/287: Move macros from ergoemacs-theme-engine, Matthew Fidler, 2014/07/02
- [elpa] 124/287: Refactor ergoemacs-open-in-external-app, Matthew Fidler, 2014/07/02
- [elpa] 138/287: Make the test directory., Matthew Fidler, 2014/07/02
- [elpa] 109/287: Add ergoemacs-macros for all macros., Matthew Fidler, 2014/07/02
- [elpa] 121/287: Remove cl dependence for ergoemacs-theme-engine.el, Matthew Fidler, 2014/07/02
- [elpa] 107/287: Remove save-variable-state, Matthew Fidler, 2014/07/02