[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 113/287: No more warnings for ergoemacs-modal.el; mapc->dolist
From: |
Matthew Fidler |
Subject: |
[elpa] 113/287: No more warnings for ergoemacs-modal.el; mapc->dolist |
Date: |
Wed, 02 Jul 2014 14:45:08 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit a6733337e0fb0fb1aca80b9017a3e608fd902e77
Author: Matthew L. Fidler <address@hidden>
Date: Tue Jun 17 10:49:38 2014 -0500
No more warnings for ergoemacs-modal.el; mapc->dolist
---
ergoemacs-modal.el | 161 ++++++++++++++++++++++++---------------------------
1 files changed, 76 insertions(+), 85 deletions(-)
diff --git a/ergoemacs-modal.el b/ergoemacs-modal.el
index 065bdb7..c27261e 100644
--- a/ergoemacs-modal.el
+++ b/ergoemacs-modal.el
@@ -203,6 +203,39 @@ modal state is currently enabled."
"Exit temporary overlay maps."
)
+(defvar ergoemacs-modal-list '())
+(defvar ergoemacs-translations)
+(defvar ergoemacs-modal-ignored-keymap
+ (let ((ret (make-sparse-keymap)))
+ (dolist (char '("<f1>"
+ "<f2>"
+ "<f3>"
+ "<f4>"
+ "<f5>"
+ "<f6>"
+ "<f7>"
+ "<f8>"
+ "<f9>"
+ "<f10>"
+ "<f11>"
+ "<f12>"
+ "<apps>" "<menu>"
+ "RET" "ESC" "DEL" "TAB"
+ "<home>"
+ "<next>"
+ "<prior>"
+ "<end>"
+ "<insert>"
+ "<deletechar>"))
+ (dolist (mod '("" "C-" "C-S-" "M-" "M-S-" "C-M-" "C-M-S-"))
+ (let ((key (read-kbd-macro (concat mod char))))
+ (unless (lookup-key ret key)
+ (define-key ret key 'ergoemacs-modal-default)))))
+ ret)
+ "`ergoemacs-mode' keys to ignore the modal translation.
+Typically function keys")
+
+(defvar ergoemacs-single-command-keys)
(defun ergoemacs-modal-p ()
"Determine if the command should be modal.
If so return the hash of translation values."
@@ -220,11 +253,9 @@ If so return the hash of translation values."
(setq ret nil))
((and (not always)
(catch 'match-modal
- (mapc
- (lambda(reg)
- (when (string-match reg (buffer-name))
- (throw 'match-modal t)))
- ergoemacs-modal-ignored-buffers)
+ (dolist (reg ergoemacs-modal-ignored-buffers)
+ (when (string-match reg (buffer-name))
+ (throw 'match-modal t)))
nil))
(setq ret nil))
((and (not always)
@@ -233,6 +264,9 @@ If so return the hash of translation values."
(setq ret nil)))
ret)))
+(defvar ergoemacs-translation-text)
+(declare-function ergoemacs-read-key "ergoemacs-shortcuts.el")
+(declare-function ergoemacs-mode-line "ergoemacs-mode.el")
(defun ergoemacs-modal-default (&optional arg)
"The default command for `ergoemacs-mode' modal.
It sends `this-single-command-keys' to `ergoemacs-read-key' with
@@ -274,46 +308,15 @@ the translation type defined by `ergoemacs-modal-list' as
long as it should."
(defvar ergoemacs-modal nil
"If ergoemacs modal and what translation is active.")
-(defvar ergoemacs-modal-ignored-keymap
- (let ((ret (make-sparse-keymap)))
- (mapc
- (lambda(char)
- (mapc
- (lambda(mod)
- (let ((key (read-kbd-macro (concat mod char))))
- (unless (lookup-key ret key)
- (define-key ret key 'ergoemacs-modal-default))))
- '("" "C-" "C-S-" "M-" "M-S-" "C-M-" "C-M-S-")))
- '("<f1>"
- "<f2>"
- "<f3>"
- "<f4>"
- "<f5>"
- "<f6>"
- "<f7>"
- "<f8>"
- "<f9>"
- "<f10>"
- "<f11>"
- "<f12>"
- "<apps>" "<menu>"
- "RET" "ESC" "DEL" "TAB"
- "<home>"
- "<next>"
- "<prior>"
- "<end>"
- "<insert>"
- "<deletechar>"))
- ret)
- "`ergoemacs-mode' keys to ignore the modal translation.
-Typically function keys")
-
(defvar ergoemacs-modal-keymap nil
"`ergoemacs-mode' modal keymap. Attempts to capture ALL keystrokes.")
(defvar ergoemacs-modal-base-keymap nil
"`ergoemacs-mode' modal keymap. Attempts to capture ALL keystrokes.")
+(declare-function ergoemacs-translate-shifted "ergoemacs-translate.el")
+(declare-function ergoemacs-get-layouts "ergoemacs-layouts.el")
+(declare-function ergoemacs-local-map "ergoemacs-translate.el")
(defun ergoemacs-modal-base-keymap (&optional map)
"Returns the ergoemacs-modal keymap"
(if ergoemacs-modal-base-keymap
@@ -321,55 +324,43 @@ Typically function keys")
(make-composed-keymap (list map ergoemacs-modal-base-keymap))
ergoemacs-modal-base-keymap)
(let ((ret (make-sparse-keymap)))
- (unless ret
- (setq ret (make-sparse-keymap)))
- (mapc
- (lambda(lay)
- (mapc
- (lambda(char)
- (unless (string= char "")
- (mapc
- (lambda(mod)
- (let ((key (read-kbd-macro
- (ergoemacs-translate-shifted
- (concat mod char)))))
- (unless (lookup-key ret key)
- (define-key ret key 'ergoemacs-modal-default))))
- '("" "C-" "M-" "C-M-"))))
- (symbol-value (intern (concat "ergoemacs-layout-" lay)))))
- (ergoemacs-get-layouts))
- (mapc
- (lambda(char)
- (mapc
- (lambda(mod)
- (let ((key (read-kbd-macro (concat mod char))))
- (unless (lookup-key ret key)
- (define-key ret key 'ergoemacs-modal-default))))
- '("" "C-" "C-S-" "M-" "M-S-" "C-M-" "C-M-S-")))
- '("<f1>"
- "<f2>"
- "<f3>"
- "<f4>"
- "<f5>"
- "<f6>"
- "<f7>"
- "<f8>"
- "<f9>"
- "<f10>"
- "<f11>"
- "<f12>"
- "<apps>" "<menu>"
- "SPC" "RET" "ESC" "DEL" "TAB"
- "<home>"
- "<next>"
- "<prior>"
- "<end>"
- "<insert>"
- "<deletechar>"))
+ (dolist (lay (ergoemacs-get-layouts))
+ (dolist (char (symbol-value (intern (concat "ergoemacs-layout-" lay))))
+ (unless (string= char "")
+ (dolist (mod '("" "C-" "M-" "C-M-"))
+ (let ((key (read-kbd-macro
+ (ergoemacs-translate-shifted
+ (concat mod char)))))
+ (unless (lookup-key ret key)
+ (define-key ret key 'ergoemacs-modal-default)))))))
+ (dolist (char '("<f1>"
+ "<f2>"
+ "<f3>"
+ "<f4>"
+ "<f5>"
+ "<f6>"
+ "<f7>"
+ "<f8>"
+ "<f9>"
+ "<f10>"
+ "<f11>"
+ "<f12>"
+ "<apps>" "<menu>"
+ "SPC" "RET" "ESC" "DEL" "TAB"
+ "<home>"
+ "<next>"
+ "<prior>"
+ "<end>"
+ "<insert>"
+ "<deletechar>"))
+ (dolist (mod '("" "C-" "C-S-" "M-" "M-S-" "C-M-" "C-M-S-"))
+ (let ((key (read-kbd-macro (concat mod char))))
+ (unless (lookup-key ret key)
+ (define-key ret key 'ergoemacs-modal-default)))))
(setq ergoemacs-modal-base-keymap ret))
(ergoemacs-modal-base-keymap map)))
-(defvar ergoemacs-modal-list '())
+(defvar ergoemacs-modal-emulation-mode-map-alist)
(defun ergoemacs-modal-toggle (type)
"Toggle ergoemacs command modes."
(let* ((help-list (gethash type ergoemacs-translation-text))
- [elpa] 127/287: Update documentation again., (continued)
- [elpa] 127/287: Update documentation again., Matthew Fidler, 2014/07/02
- [elpa] 203/287: Fix the C-e test, Matthew Fidler, 2014/07/02
- [elpa] 198/287: More flexible redo, Issue #239, Matthew Fidler, 2014/07/02
- [elpa] 96/287: Fix shortcut keys again., Matthew Fidler, 2014/07/02
- [elpa] 199/287: Update ergoemacs-test-layout so it wont parse the function, Matthew Fidler, 2014/07/02
- [elpa] 135/287: Fix defcustom, Matthew Fidler, 2014/07/02
- [elpa] 104/287: Fix many compiler warnings with ergoemacs-advices.el, Matthew Fidler, 2014/07/02
- [elpa] 97/287: First attempt for Cask without Cask (I'm on windows), Matthew Fidler, 2014/07/02
- [elpa] 116/287: Take out compiler warnings from ergoemacs-shortcuts.el, Matthew Fidler, 2014/07/02
- [elpa] 89/287: Fix most keybinding issues, Matthew Fidler, 2014/07/02
- [elpa] 113/287: No more warnings for ergoemacs-modal.el; mapc->dolist,
Matthew Fidler <=
- [elpa] 132/287: Be more careful when redefining maps., Matthew Fidler, 2014/07/02
- [elpa] 129/287: Fix compiler warnings for ergoemacs-unbind.el, Matthew Fidler, 2014/07/02
- [elpa] 140/287: Fix Byte Compile Warnings, Matthew Fidler, 2014/07/02
- [elpa] 117/287: Take out compiler errors from ergoemacs-test, Matthew Fidler, 2014/07/02
- [elpa] 93/287: Add ergoemacs-shortcut-emulation-mode-map-alist, Matthew Fidler, 2014/07/02
- [elpa] 119/287: Fix byte-compile warnings for ergoemacs-macros.el, Matthew Fidler, 2014/07/02
- [elpa] 67/287: Completely use the object, Matthew Fidler, 2014/07/02
- [elpa] 134/287: Finalize tests; Passes on windows, Matthew Fidler, 2014/07/02
- [elpa] 101/287: Fix Cask setup?, Matthew Fidler, 2014/07/02
- [elpa] 133/287: Remove byte compiled load warning, Matthew Fidler, 2014/07/02