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

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

[elpa] 146/287: dolist instaed of mapc


From: Matthew Fidler
Subject: [elpa] 146/287: dolist instaed of mapc
Date: Wed, 02 Jul 2014 14:45:27 +0000

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

commit eca51d252666c7632daf372171894afec3dfa61a
Author: Matthew L. Fidler <address@hidden>
Date:   Wed Jun 18 13:04:44 2014 -0500

    dolist instaed of mapc
---
 ergoemacs-extras.el       |  755 +++++++++++++++++++++------------------------
 ergoemacs-functions.el    |   39 +--
 ergoemacs-macros.el       |    8 +-
 ergoemacs-menus.el        |  111 ++++----
 ergoemacs-mode.el         |    6 +-
 ergoemacs-shortcuts.el    |  189 ++++++------
 ergoemacs-test.el         |   12 +-
 ergoemacs-theme-engine.el |  216 ++++++-------
 ergoemacs-track.el        |   10 +-
 ergoemacs-translate.el    |  133 ++++----
 ergoemacs-unbind.el       |   38 +--
 11 files changed, 707 insertions(+), 810 deletions(-)

diff --git a/ergoemacs-extras.el b/ergoemacs-extras.el
index cfba5ef..aae74ff 100644
--- a/ergoemacs-extras.el
+++ b/ergoemacs-extras.el
@@ -259,36 +259,34 @@
               (progn
                 (setq shortcut-type "Unclassified")
                 (setq short-desc "")
-                (mapc
-                 (lambda(x)
-                   ;; (message "%s" (nth 1 x))
-                   ;; (message "%s" (nth 1 (nth 0 x)))
-                   (when (string= (format "%s" (nth 1 x))
-                                  (save-match-data
-                                    (replace-regexp-in-string
-                                     
"---\\(standard\\(---cua\\)?\\|ergo\\|apps\\)" "" (match-string 1))))
-                     (setq shortcut-type
-                           (if (save-match-data (string-match "---apps" 
(match-string 1)))
-                               "Ergonomic Unchorded"
-                             (if (save-match-data (string-match 
"---standard---cua" (match-string 1)))
-                                 "Standard"
-                               (if (save-match-data (string-match 
"---standard" (match-string 1)))
-                                   "Fixed"
-                                 (if (save-match-data (string-match "---ergo" 
(match-string 1)))
-                                     (if (save-match-data (string-match 
movement-regexp (match-string 1)))
-                                         "Ergonomic Movement"
-                                       (if (save-match-data
-                                             (string-match deletion-regexp 
(match-string 1)))
-                                           "Ergonomic Deletion"
-                                         (if (save-match-data
-                                               (string-match tab-regexp 
(match-string 1)))
-                                             "Ergonomic Window/Frame"
-                                           "Ergonomic Misc")))
-                                   "Duplicate")))))
-                     (when (nth 2 x)
-                       (setq short-desc (nth 2 x)))))
-                 `(,@(symbol-value (ergoemacs-get-variable-layout))
-                   ,@(symbol-value (ergoemacs-get-fixed-layout))))
+                (dolist (x `(,@(symbol-value (ergoemacs-get-variable-layout))
+                             ,@(symbol-value (ergoemacs-get-fixed-layout))))
+                  ;; (message "%s" (nth 1 x))
+                  ;; (message "%s" (nth 1 (nth 0 x)))
+                  (when (string= (format "%s" (nth 1 x))
+                                 (save-match-data
+                                   (replace-regexp-in-string
+                                    
"---\\(standard\\(---cua\\)?\\|ergo\\|apps\\)" "" (match-string 1))))
+                    (setq shortcut-type
+                          (if (save-match-data (string-match "---apps" 
(match-string 1)))
+                              "Ergonomic Unchorded"
+                            (if (save-match-data (string-match 
"---standard---cua" (match-string 1)))
+                                "Standard"
+                              (if (save-match-data (string-match "---standard" 
(match-string 1)))
+                                  "Fixed"
+                                (if (save-match-data (string-match "---ergo" 
(match-string 1)))
+                                    (if (save-match-data (string-match 
movement-regexp (match-string 1)))
+                                        "Ergonomic Movement"
+                                      (if (save-match-data
+                                            (string-match deletion-regexp 
(match-string 1)))
+                                          "Ergonomic Deletion"
+                                        (if (save-match-data
+                                              (string-match tab-regexp 
(match-string 1)))
+                                            "Ergonomic Window/Frame"
+                                          "Ergonomic Misc")))
+                                  "Duplicate")))))
+                    (when (nth 2 x)
+                      (setq short-desc (nth 2 x)))))
                 (save-restriction
                   (narrow-to-region (point-at-bol) (point-at-eol))
                   (when (re-search-backward 
"---\\(standard\\(---cua\\)?\\|ergo\\|apps\\)" nil t)
@@ -341,19 +339,18 @@
     (setq extra-dir (expand-file-name "ergoemacs-extras" user-emacs-directory))
     (when (not (file-exists-p extra-dir))
       (make-directory extra-dir t))
-    (mapc
-     (lambda(x)
-       (message "Generate Kbd table for %s" x)
-       (ergoemacs-set-default 'ergoemacs-theme nil)
-       (ergoemacs-set-default 'ergoemacs-keyboard-layout x)
-       (ergoemacs-mode 1)
-       (setq curr-dir (expand-file-name "ergo-layouts" extra-dir))
-       (when (not (file-exists-p curr-dir))
-         (make-directory curr-dir t))
-       (with-temp-file (expand-file-name (format "ergoemacs-layout-%s.html" x) 
curr-dir)
-         (insert tbl)
-         (insert (ergoemacs-get-html-key-table))
-         (insert "</table><script language=\"javascript\" 
type=\"text/javascript\">
+    (dolist (x lay)
+      (message "Generate Kbd table for %s" x)
+      (ergoemacs-set-default 'ergoemacs-theme nil)
+      (ergoemacs-set-default 'ergoemacs-keyboard-layout x)
+      (ergoemacs-mode 1)
+      (setq curr-dir (expand-file-name "ergo-layouts" extra-dir))
+      (when (not (file-exists-p curr-dir))
+        (make-directory curr-dir t))
+      (with-temp-file (expand-file-name (format "ergoemacs-layout-%s.html" x) 
curr-dir)
+        (insert tbl)
+        (insert (ergoemacs-get-html-key-table))
+        (insert "</table><script language=\"javascript\" 
type=\"text/javascript\">
   //<![CDATA[
         var table_keys_Props =      {
                                                         col_0: \"select\", 
on_change: true, display_all_text: \" [ Show all ] \", rows_counter: true, 
alternate_rows: true
@@ -361,30 +358,25 @@
         setFilterGrid( \"table_keys\",table_keys_Props );
 //]]>
 </script></body></html>"))
-       (mapc
-        (lambda(y)
-          (condition-case err
-              (progn
-                (ergoemacs-set-default 'ergoemacs-theme y)
-                (ergoemacs-mode 1)
-                (message "\tTheme %s" y)
-                (setq curr-dir (expand-file-name y extra-dir))
-                (when (not (file-exists-p curr-dir))
-                  (make-directory curr-dir t))
-                (with-temp-file (expand-file-name (format 
"ergoemacs-layout-%s.html" x) curr-dir)
-                  (insert tbl)
-                  (insert (ergoemacs-get-html-key-table))
-                  (insert "</table><script language=\"javascript\" 
type=\"text/javascript\">
+      (dolist (y (sort (ergoemacs-get-themes) 'string<))
+        (ignore-errors
+          (ergoemacs-set-default 'ergoemacs-theme y)
+          (ergoemacs-mode 1)
+          (message "\tTheme %s" y)
+          (setq curr-dir (expand-file-name y extra-dir))
+          (when (not (file-exists-p curr-dir))
+            (make-directory curr-dir t))
+          (with-temp-file (expand-file-name (format "ergoemacs-layout-%s.html" 
x) curr-dir)
+            (insert tbl)
+            (insert (ergoemacs-get-html-key-table))
+            (insert "</table><script language=\"javascript\" 
type=\"text/javascript\">
   //<![CDATA[
         var table_keys_Props =      {
                                                         col_0: \"select\"
                                                 };
         setFilterGrid( \"table_keys\",table_keys_Props );
 //]]>
-</script></html>")))
-            (error (message "Error generating theme %s; %s" y err))))
-        (sort (ergoemacs-get-themes) 'string<)))
-     lay)
+</script></html>")))))
     (message "Setting theme back to %s" saved-theme)
     (ergoemacs-set-default 'ergoemacs-theme saved-theme)
     (ergoemacs-set-default 'ergoemacs-keyboard-layout saved-layout)
@@ -460,47 +452,45 @@
       (insert " id=\"dot_emacs\""))
     ;; Now add [K]ey type headers.
     (let (current-class)
-      (mapc
-       (lambda(file)
-         (find-file file)
-         (setq current-class "dark")
-         (goto-char (point-min))
-         (while (re-search-forward "\\<\\(Ctr?l\\|Alt\\|\\(?:.\\|&.*?;\\)? 
?Shift\\|Shift\\)[+]\\(.\\)" nil t)
-           (replace-match "<kbd class=\"dark\">\\1</kbd>+\\2")
-           (backward-char)
-           (while (looking-at "\\(Ctr?l\\|Alt\\|\\(?:.\\|&.*?;\\)? 
?Shift\\|Shift\\)[+]\\(.\\)")
-             (replace-match "<kbd class=\"dark\">\\1</kbd>+\\2")
-             (backward-char))
-           (when (looking-at "\\(.\\)")
-             (replace-match "<kbd class=\"dark\">\\1</kbd>")))
-         (goto-char (point-min))
-         (while (re-search-forward ">Shift</kbd>" nil t)
-           (replace-match ">⇧ Shift</kbd>"))
-         (goto-char (point-min))
-         (let (p1 p2)
-           (while (re-search-forward "@@html:" nil t)
-             (replace-match "")
-             (setq p1 (point))
-             (when (search-forward "@@" nil t)
-               (replace-match "")
-               (setq p2 (point))
-               (goto-char p1)
-               (while (search-forward "&lt;" p2 t)
-                 (replace-match "<"))
-               (goto-char p1)
-               (while (search-forward "&gt;" p2 t)
-                 (replace-match ">")))))
-         (goto-char (point-min))
-         (while (re-search-forward "\\(<h[1234].*?>\\)" nil t)
-           (re-search-forward "\\=<a.*?>" nil t)
-           (when (looking-at "About")
-             (goto-char (point-max)) ;; Not displaying properly.  Remove.
-             (setq current-class "light"))
-           (when (looking-at "\\([A-Za-z0-9]\\)")
-             (replace-match (format "<kbd class=\"%s\">\\1</kbd>" 
current-class) t)))
-         (save-buffer (current-buffer)))
-       (let ((default-directory (expand-file-name "out" ergoemacs-dir)))
-         (file-expand-wildcards "*.html" t))))
+      (dolist (file (let ((default-directory (expand-file-name "out" 
ergoemacs-dir)))
+                      (file-expand-wildcards "*.html" t)))
+        (find-file file)
+        (setq current-class "dark")
+        (goto-char (point-min))
+        (while (re-search-forward "\\<\\(Ctr?l\\|Alt\\|\\(?:.\\|&.*?;\\)? 
?Shift\\|Shift\\)[+]\\(.\\)" nil t)
+          (replace-match "<kbd class=\"dark\">\\1</kbd>+\\2")
+          (backward-char)
+          (while (looking-at "\\(Ctr?l\\|Alt\\|\\(?:.\\|&.*?;\\)? 
?Shift\\|Shift\\)[+]\\(.\\)")
+            (replace-match "<kbd class=\"dark\">\\1</kbd>+\\2")
+            (backward-char))
+          (when (looking-at "\\(.\\)")
+            (replace-match "<kbd class=\"dark\">\\1</kbd>")))
+        (goto-char (point-min))
+        (while (re-search-forward ">Shift</kbd>" nil t)
+          (replace-match ">⇧ Shift</kbd>"))
+        (goto-char (point-min))
+        (let (p1 p2)
+          (while (re-search-forward "@@html:" nil t)
+            (replace-match "")
+            (setq p1 (point))
+            (when (search-forward "@@" nil t)
+              (replace-match "")
+              (setq p2 (point))
+              (goto-char p1)
+              (while (search-forward "&lt;" p2 t)
+                (replace-match "<"))
+              (goto-char p1)
+              (while (search-forward "&gt;" p2 t)
+                (replace-match ">")))))
+        (goto-char (point-min))
+        (while (re-search-forward "\\(<h[1234].*?>\\)" nil t)
+          (re-search-forward "\\=<a.*?>" nil t)
+          (when (looking-at "About")
+            (goto-char (point-max)) ;; Not displaying properly.  Remove.
+            (setq current-class "light"))
+          (when (looking-at "\\([A-Za-z0-9]\\)")
+            (replace-match (format "<kbd class=\"%s\">\\1</kbd>" 
current-class) t)))
+        (save-buffer (current-buffer))))
     (save-buffer (current-buffer))))
 
 (defun ergoemacs-o-blog-html ()
@@ -639,21 +629,19 @@ Currently only supports two modifier plus key."
         (goto-char (point-min))
         (when (re-search-forward "QWERTY")
           (replace-match layout))
-        (mapc
-         (lambda(x)
-           (let ((from (nth 0 x))
-                 from-reg
-                 (to nil))
-             (setq to (ergoemacs-kbd from t))
-             (if (string= from to) nil
-               
-               (setq from (ergoemacs-trans-mac-osx from t))
-               (setq to (ergoemacs-trans-mac-osx to swap-opiton-and-control))
-               (setq from-reg (regexp-quote from))
-               (goto-char (point-min))
-               (when (re-search-forward from-reg nil t)
-                 (replace-match to t t)))))
-         (symbol-value (ergoemacs-get-variable-layout)))
+        (dolist (x (symbol-value (ergoemacs-get-variable-layout)))
+          (let ((from (nth 0 x))
+                from-reg
+                (to nil))
+            (setq to (ergoemacs-kbd from t))
+            (if (string= from to) nil
+              
+              (setq from (ergoemacs-trans-mac-osx from t))
+              (setq to (ergoemacs-trans-mac-osx to swap-opiton-and-control))
+              (setq from-reg (regexp-quote from))
+              (goto-char (point-min))
+              (when (re-search-forward from-reg nil t)
+                (replace-match to t t)))))
         (goto-char (point-min))
         (ergoemacs-setup-keys-for-layout ergoemacs-keyboard-layout)))))
 
@@ -661,12 +649,10 @@ Currently only supports two modifier plus key."
   "Generate Mac OS X dictionaries for all the defined layouts."
   (interactive)
   (let ((lay (or layouts (ergoemacs-get-layouts))))
-    (mapc
-     (lambda(x)
-       (message "Generate Mac Dictionary for %s" x)
-       (ergoemacs-gen-mac-osx x)
-       (ergoemacs-gen-mac-osx x nil "os_x_opt-ctl" t))
-     lay)))
+    (dolist (x lay)
+      (message "Generate Mac Dictionary for %s" x)
+      (ergoemacs-gen-mac-osx x)
+      (ergoemacs-gen-mac-osx x nil "os_x_opt-ctl" t))))
 
 (defun ergoemacs-trans-bash (key)
   "Translate Emacs kbd code KEY to bash kbd code"
@@ -735,21 +721,19 @@ EXTRA is the extra directory used to gerenate the bash 
~/.inputrc
         (goto-char (point-min))
         (when (re-search-forward "QWERTY")
           (replace-match layout))
-        (mapc
-         (lambda(x)
-           (let ((from (nth 0 x))
-                 from-reg
-                 (to nil))
-             (setq to (ergoemacs-kbd from t))
-             (if (string= from to) nil
-               
-               (setq from (ergoemacs-trans-bash from))
-               (setq to (ergoemacs-trans-bash to))
-               (setq from-reg (regexp-quote from))
-               (goto-char (point-min))
-               (when (re-search-forward from-reg nil t)
-                 (replace-match to t t)))))
-         (symbol-value (ergoemacs-get-variable-layout)))
+        (dolist (x (symbol-value (ergoemacs-get-variable-layout)))
+          (let ((from (nth 0 x))
+                from-reg
+                (to nil))
+            (setq to (ergoemacs-kbd from t))
+            (if (string= from to) nil
+              
+              (setq from (ergoemacs-trans-bash from))
+              (setq to (ergoemacs-trans-bash to))
+              (setq from-reg (regexp-quote from))
+              (goto-char (point-min))
+              (when (re-search-forward from-reg nil t)
+                (replace-match to t t)))))
         (goto-char (point-min))
         (while (re-search-forward "\"\\\\M-" nil t)
           (replace-match "\"\\e" t t))
@@ -759,11 +743,9 @@ EXTRA is the extra directory used to gerenate the bash 
~/.inputrc
   "Generate BASH scripts for all the defined layouts."
   (interactive)
   (let ((lay (or layouts (ergoemacs-get-layouts))))
-    (mapc
-     (lambda(x)
-       (message "Generate bash for %s" x)
-       (ergoemacs-gen-bash x))
-     lay)))
+    (dolist (x lay)
+      (message "Generate bash for %s" x)
+      (ergoemacs-gen-bash x))))
 
 (defun ergoemacs-trans-ahk (key &optional number)
   "Translates Emacs kbd code KEY to ahk kbd code. "
@@ -796,34 +778,30 @@ EXTRA is the extra directory used to gerenate the bash 
~/.inputrc
         (i 0))
     (with-temp-buffer
       (insert "[Layouts]\n")
-      (mapc
-       (lambda(lay)
-         (let* ((variable (intern (concat "ergoemacs-layout-" lay)))
-                (alias (condition-case nil
-                           (indirect-variable variable)
-                         (error variable)))
-                (is-alias nil)
-                (doc nil))
-           (setq doc (or (documentation-property variable 
'variable-documentation)
-                         (progn
-                           (setq is-alias t)
-                           (documentation-property alias 
'variable-documentation))))
-           (insert lay)
-           (insert "=")
-           (insert doc)
-           (insert "\n")
-           (setq i 1)
-           (setq lay-ini (format "%s\n[%s]" lay-ini lay))
-           (mapc
-            (lambda(x)
-              (unless (string-match "\\(<apps>\\|<menu>\\)" x) ;; Currently 
take out
-                ;; <apps> mapping.  Needs some work.
-                (let ((key (format "%s" (string-to-char x))))
-                  (push `(,x ,key) trans-keys)
-                  (setq lay-ini (format "%s\n%s=%s" lay-ini i key))))
-              (setq i (+ i 1)))
-            (symbol-value variable))))
-       (ergoemacs-get-layouts))
+      (dolist (lay (ergoemacs-get-layouts))
+        (let* ((variable (intern (concat "ergoemacs-layout-" lay)))
+               (alias (condition-case nil
+                          (indirect-variable variable)
+                        (error variable)))
+               (is-alias nil)
+               (doc nil))
+          (setq doc (or (documentation-property variable 
'variable-documentation)
+                        (progn
+                          (setq is-alias t)
+                          (documentation-property alias 
'variable-documentation))))
+          (insert lay)
+          (insert "=")
+          (insert doc)
+          (insert "\n")
+          (setq i 1)
+          (setq lay-ini (format "%s\n[%s]" lay-ini lay))
+          (dolist (x (symbol-value variable))
+            (unless (string-match "\\(<apps>\\|<menu>\\)" x) ;; Currently take 
out
+              ;; <apps> mapping.  Needs some work.
+              (let ((key (format "%s" (string-to-char x))))
+                (push `(,x ,key) trans-keys)
+                (setq lay-ini (format "%s\n%s=%s" lay-ini i key))))
+            (setq i (+ i 1)))))
       (goto-char (point-max))
       (insert lay-ini)
       (insert "\n")
@@ -834,11 +812,9 @@ EXTRA is the extra directory used to gerenate the bash 
~/.inputrc
   (with-temp-buffer
     (insert "[Themes]\n")
     (let ((lays (sort (ergoemacs-get-themes) 'string<)))
-      (mapc
-       (lambda(lay)
-         (insert lay "="
-                 (plist-get (gethash lay ergoemacs-theme-hash) ':description) 
"\n"))
-       lays))
+      (dolist (lay lays)
+        (insert lay "="
+                (plist-get (gethash lay ergoemacs-theme-hash) ':description) 
"\n")))
     (buffer-string)))
 
 (defun ergoemacs-get-ahk-keys-ini ()
@@ -854,23 +830,17 @@ EXTRA is the extra directory used to gerenate the bash 
~/.inputrc
     (setq re (format "^%s$" (regexp-opt lst 't)))
     (with-temp-buffer
       (let ((old-lay ergoemacs-theme))
-        (mapc
-         (lambda(z)
-           (ergoemacs-set-default 'ergoemacs-theme z)
-           (mapc
-            (lambda(x)
-              (ergoemacs-setup-keys-for-layout x)
-              (insert (concat "[" x "-" z "]\n"))
-              (message "Generating AHK ini for %s %s" x z)
-              (mapc
-               (lambda(y)
-                 (when (string-match re (format "%s" (nth 1 y)))
-                   (let ((trans (ergoemacs-trans-ahk (ergoemacs-kbd (nth 0 y) 
t (nth 3 y)) t)))
-                     (when (string-match "^[0-9]+$" trans)
-                       (insert (symbol-name (nth 1 y)) "=" trans "\n")))))
-               (symbol-value (ergoemacs-get-variable-layout))))
-            (ergoemacs-get-layouts)))
-         (ergoemacs-get-themes))
+        (dolist (z (ergoemacs-get-themes))
+          (ergoemacs-set-default 'ergoemacs-theme z)
+          (dolist (x (ergoemacs-get-layouts))
+            (ergoemacs-setup-keys-for-layout x)
+            (insert (concat "[" x "-" z "]\n"))
+            (message "Generating AHK ini for %s %s" x z)
+            (dolist (y (symbol-value (ergoemacs-get-variable-layout)))
+              (when (string-match re (format "%s" (nth 1 y)))
+                (let ((trans (ergoemacs-trans-ahk (ergoemacs-kbd (nth 0 y) t 
(nth 3 y)) t)))
+                  (when (string-match "^[0-9]+$" trans)
+                    (insert (symbol-name (nth 1 y)) "=" trans "\n")))))))
         (ergoemacs-setup-keys-for-layout ergoemacs-keyboard-layout)
         (ergoemacs-set-default 'ergoemacs-theme old-lay))
       (buffer-string))))
@@ -1060,7 +1030,6 @@ Files are generated in the dir 〔ergoemacs-extras〕 at 
`user-emacs-directory'.
           (when (search-forward (format "id=\"key%s\"" i) nil t)
             (when (re-search-backward "fill:.*?;" nil t)
               (replace-match (format "fill:%s;" (nth 6 tmp)))))
-          ;;(add-to-list 'cmd-freq (cons (nth 2 tmp) (format "id=\"key%s\"" 
i)))
           (goto-char (point-min))
           (when (search-forward (format ">A%s<" i) nil t)
             (replace-match (format ">%s<" (nth 1 tmp)) t t))
@@ -1089,7 +1058,6 @@ Files are generated in the dir 〔ergoemacs-extras〕 at 
`user-emacs-directory'.
             (when (re-search-forward "id=\"keySPC\"" nil t)
               (when (re-search-backward "fill:.*?;" nil t)
                 (replace-match "fill:#FFFF00;"))))
-        ;;(add-to-list 'cmd-freq (cons (nth 2 tmp)
         ;;"id=\"keySPC\"")
         (setq ret t)
         (goto-char (point-min))
@@ -1201,12 +1169,10 @@ Files are generated in the dir 〔ergoemacs-extras〕 at 
`user-emacs-directory'.
       ;; Merge with the values in .emacs.keyfreq file
       (keyfreq-table-load table)
       (setq list (keyfreq-list (keyfreq-groups-major-modes table) 'no-sort))
-      (mapc
-       (lambda(x)
-         (setq total-n (+ total-n (cdr x)))
+      (dolist (x (cdr list))
+        (setq total-n (+ total-n (cdr x)))
          (unless (string-match "self-insert" (symbol-name (car x)))
            (setq cmd-n (+ cmd-n (cdr x)))))
-       (cdr list))
 
       ;; Get the frequencies for all the ergoemacs commands
       (setq cmd-freq-ergo
@@ -1424,196 +1390,191 @@ IS-PREFIX tell ergoemacs if this is a prefix diagram."
             (replace-match
              (format ">%s<"
                      (ergoemacs-gen-svg-quote (nth i lay))) t t))
-          (mapc
-           (lambda(x)
-             (let ((key-pre (nth 0 x))
-                   (rep-pre (nth 1 x))
-                   (rep-sym-pre (nth 2 x))
-                   (final-txt (nth 3 x))
-                   (sym-pre (nth 4 x))
-                   (var-is-fixed-p (nth 5 x))
-                   curr-var)
-               ;; Variable Layout
-               (setq curr-var (nth i (symbol-value (intern (concat 
"ergoemacs-layout-" ergoemacs-translation-from)))))
-               
-               (if var-is-fixed-p
-                   (setq curr-var (nth i lay))
-                 (setq curr-var (nth i (symbol-value (intern (concat 
"ergoemacs-layout-" ergoemacs-translation-from))))))
-               
-               (unless (string= curr-var "")
-                 (setq txt (assoc (format "%s%s" key-pre curr-var)
-                                  (symbol-value 
(ergoemacs-get-variable-layout))))
-                 
-                 (if (not txt)
-                     (setq txt "")
-                   (if (>= (length txt) 3)
-                       (setq txt (nth 2 txt))
-                     (setq txt "")))
-                 (when (string= "" txt)
-                   (setq txt (all-completions (format "%s%s " key-pre curr-var)
-                                              (symbol-value 
(ergoemacs-get-variable-layout))))
-                   (if (= 0 (length txt))
-                       (setq txt "")
-                     (setq prefix-fixed (nth 3 (assoc (nth 0 txt) 
(symbol-value (ergoemacs-get-variable-layout)))))
-                     (setq txt "⌨")
-                     ;; Add to prefix list
-                     (setq prefix-lst
-                           (append prefix-lst
+          (dolist (x ergoemacs-svn-prefixes)
+            (let ((key-pre (nth 0 x))
+                  (rep-pre (nth 1 x))
+                  (rep-sym-pre (nth 2 x))
+                  (final-txt (nth 3 x))
+                  (sym-pre (nth 4 x))
+                  (var-is-fixed-p (nth 5 x))
+                  curr-var)
+              ;; Variable Layout
+              (setq curr-var (nth i (symbol-value (intern (concat 
"ergoemacs-layout-" ergoemacs-translation-from)))))
+              
+              (if var-is-fixed-p
+                  (setq curr-var (nth i lay))
+                (setq curr-var (nth i (symbol-value (intern (concat 
"ergoemacs-layout-" ergoemacs-translation-from))))))
+              
+              (unless (string= curr-var "")
+                (setq txt (assoc (format "%s%s" key-pre curr-var)
+                                 (symbol-value 
(ergoemacs-get-variable-layout))))
+                
+                (if (not txt)
+                    (setq txt "")
+                  (if (>= (length txt) 3)
+                      (setq txt (nth 2 txt))
+                    (setq txt "")))
+                (when (string= "" txt)
+                  (setq txt (all-completions (format "%s%s " key-pre curr-var)
+                                             (symbol-value 
(ergoemacs-get-variable-layout))))
+                  (if (= 0 (length txt))
+                      (setq txt "")
+                    (setq prefix-fixed (nth 3 (assoc (nth 0 txt) (symbol-value 
(ergoemacs-get-variable-layout)))))
+                    (setq txt "⌨")
+                    ;; Add to prefix list
+                    (setq prefix-lst
+                          (append prefix-lst
+                                  (list
                                    (list
-                                    (list
-                                     (format "%s%s " key-pre curr-var)
-                                     (format "%sA" prefix-num)
-                                     (format "%sAA" prefix-num)
-                                     (format "%s%s" final-txt (nth i lay))
-                                     (format "%sAA-" prefix-num)
-                                     prefix-fixed))))
-                     (setq prefix-num (+ prefix-num 1))))
-                 (goto-char (point-min))
-                 (unless (string= "" txt)
-                   (when (search-forward (format ">%s%s<" rep-pre i) nil t)
-                     (replace-match  (format ">%s<" txt) t t))))
-               
-               ;; Fixed layout
-               (goto-char (point-min))
-               (setq txt (assoc (format "%s%s" key-pre (nth i lay)) fix))
-               (if (not txt)
-                   (setq txt "")
-                 (if (>= (length txt) 3)
-                     (setq txt (nth 2 txt))
-                   (setq txt "")))
-               (when (string= txt "")
-                 (setq txt (all-completions (format "%s%s " key-pre (nth i 
lay)) fix))
-                 (if (= 0 (length txt))
-                     (setq txt "")
-                   (setq txt "⌨")))
-               (unless (string= "" txt)
-                 (when (search-forward (format ">%s%s<" rep-pre i) nil t)
-                   (replace-match  (format ">%s<" txt) t t)))
-               
-               ;; Space and other symbols
-               (mapc
-                (lambda(sym)
-                  (setq txt (assoc (format "%s%s" sym-pre sym) (symbol-value 
(ergoemacs-get-variable-layout))))
-                  (if (not txt)
+                                    (format "%s%s " key-pre curr-var)
+                                    (format "%sA" prefix-num)
+                                    (format "%sAA" prefix-num)
+                                    (format "%s%s" final-txt (nth i lay))
+                                    (format "%sAA-" prefix-num)
+                                    prefix-fixed))))
+                    (setq prefix-num (+ prefix-num 1))))
+                (goto-char (point-min))
+                (unless (string= "" txt)
+                  (when (search-forward (format ">%s%s<" rep-pre i) nil t)
+                    (replace-match  (format ">%s<" txt) t t))))
+              
+              ;; Fixed layout
+              (goto-char (point-min))
+              (setq txt (assoc (format "%s%s" key-pre (nth i lay)) fix))
+              (if (not txt)
+                  (setq txt "")
+                (if (>= (length txt) 3)
+                    (setq txt (nth 2 txt))
+                  (setq txt "")))
+              (when (string= txt "")
+                (setq txt (all-completions (format "%s%s " key-pre (nth i 
lay)) fix))
+                (if (= 0 (length txt))
+                    (setq txt "")
+                  (setq txt "⌨")))
+              (unless (string= "" txt)
+                (when (search-forward (format ">%s%s<" rep-pre i) nil t)
+                  (replace-match  (format ">%s<" txt) t t)))
+              ;; Space and other symbols
+              (dolist (sym '("SPC"))
+                (setq txt (assoc (format "%s%s" sym-pre sym) (symbol-value 
(ergoemacs-get-variable-layout))))
+                (if (not txt)
+                    (setq txt "")
+                  (if (>= (length txt) 3)
+                      (setq txt (nth 2 txt))
+                    (setq txt "")))
+                
+                (when (string= "" txt)
+                  (setq txt
+                        (all-completions
+                         (format "%s%s " sym-pre sym)
+                         (symbol-value (ergoemacs-get-variable-layout))))
+                  (if (= 0 (length txt))
                       (setq txt "")
-                    (if (>= (length txt) 3)
-                        (setq txt (nth 2 txt))
-                      (setq txt "")))
-                  
-                  (when (string= "" txt)
-                    (setq txt
-                          (all-completions
-                           (format "%s%s " sym-pre sym)
-                           (symbol-value (ergoemacs-get-variable-layout))))
-                    (if (= 0 (length txt))
-                        (setq txt "")
-                      (setq txt "⌨")))
-                  (goto-char (point-min))
-                  (unless (string= "" txt)
-                    (when (search-forward (format ">%s-%s<" rep-sym-pre sym) 
nil t)
-                      (replace-match  (format ">%s<" (ergoemacs-gen-svg-quote 
txt)) t t))))
-                '("SPC"))
-
-               (mapc
-                (lambda(sym)
-                  (setq txt (assoc (format "<%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-variable-layout))))
-                  (if (not txt)
+                    (setq txt "⌨")))
+                (goto-char (point-min))
+                (unless (string= "" txt)
+                  (when (search-forward (format ">%s-%s<" rep-sym-pre sym) nil 
t)
+                    (replace-match  (format ">%s<" (ergoemacs-gen-svg-quote 
txt)) t t))))
+
+              (dolist (sym '("F1" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" 
"F10" "F11" "F12"))
+                (setq txt (assoc (format "<%s>" (downcase sym)) (symbol-value 
(ergoemacs-get-variable-layout))))
+                (if (not txt)
+                    (progn
+                      (setq txt (assoc (format "<%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-fixed-layout))))
+                      (if (not txt)
+                          (setq txt "")
+                        (if (>= (length txt) 3)
+                            (setq txt (nth 2 txt))
+                          (setq txt ""))))
+                  (if (>= (length txt) 3)
+                      (setq txt (nth 2 txt))
+                    (setq txt "")))
+                (when (string= "" txt)
+                  (setq txt
+                        (all-completions
+                         (format "<%s> " (downcase sym))
+                         (symbol-value (ergoemacs-get-variable-layout))))
+                  (if (= 0 (length txt))
                       (progn
-                        (setq txt (assoc (format "<%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-fixed-layout))))
-                        (if (not txt)
+                        (setq txt
+                              (all-completions
+                               (format "<%s> " (downcase sym))
+                               (symbol-value (ergoemacs-get-fixed-layout))))
+                        (if (= 0 (length txt))
                             (setq txt "")
-                          (if (>= (length txt) 3)
-                              (setq txt (nth 2 txt))
-                            (setq txt ""))))
-                    (if (>= (length txt) 3)
-                        (setq txt (nth 2 txt))
-                      (setq txt "")))
-                  (when (string= "" txt)
-                    (setq txt
-                          (all-completions
-                           (format "<%s> " (downcase sym))
-                           (symbol-value (ergoemacs-get-variable-layout))))
-                    (if (= 0 (length txt))
-                        (progn
-                          (setq txt
-                                (all-completions
-                                 (format "<%s> " (downcase sym))
-                                 (symbol-value (ergoemacs-get-fixed-layout))))
-                          (if (= 0 (length txt))
-                              (setq txt "")
-                            (setq txt "⌨")))
-                      (setq txt "⌨")))
-                  (goto-char (point-min))
-                  (when (search-forward (format ">N%s<" (upcase sym)) nil t)
-                    (replace-match  (format ">%s<" txt) t t))
-
-                  (setq txt (assoc (format "<C-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-variable-layout))))
-                  (if (not txt)
+                          (setq txt "⌨")))
+                    (setq txt "⌨")))
+                (goto-char (point-min))
+                (when (search-forward (format ">N%s<" (upcase sym)) nil t)
+                  (replace-match  (format ">%s<" txt) t t))
+
+                (setq txt (assoc (format "<C-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-variable-layout))))
+                (if (not txt)
+                    (progn
+                      (setq txt (assoc (format "<C-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-fixed-layout))))
+                      (if (not txt)
+                          (setq txt "")
+                        (if (>= (length txt) 3)
+                            (setq txt (nth 2 txt))
+                          (setq txt ""))))
+                  (if (>= (length txt) 3)
+                      (setq txt (nth 2 txt))
+                    (setq txt "")))
+                (when (string= "" txt)
+                  (setq txt
+                        (all-completions
+                         (format "<C-%s> " (downcase sym))
+                         (symbol-value (ergoemacs-get-variable-layout))))
+                  (if (= 0 (length txt))
                       (progn
-                        (setq txt (assoc (format "<C-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-fixed-layout))))
-                        (if (not txt)
+                        (setq txt
+                              (all-completions
+                               (format "<C-%s> " (downcase sym))
+                               (symbol-value (ergoemacs-get-fixed-layout))))
+                        (if (= 0 (length txt))
                             (setq txt "")
-                          (if (>= (length txt) 3)
-                              (setq txt (nth 2 txt))
-                            (setq txt ""))))
-                    (if (>= (length txt) 3)
-                        (setq txt (nth 2 txt))
-                      (setq txt "")))
-                  (when (string= "" txt)
-                    (setq txt
-                          (all-completions
-                           (format "<C-%s> " (downcase sym))
-                           (symbol-value (ergoemacs-get-variable-layout))))
-                    (if (= 0 (length txt))
-                        (progn
-                          (setq txt
-                                (all-completions
-                                 (format "<C-%s> " (downcase sym))
-                                 (symbol-value (ergoemacs-get-fixed-layout))))
-                          (if (= 0 (length txt))
-                              (setq txt "")
-                            (setq txt "⌨")))
-                      (setq txt "⌨")))
-                  (goto-char (point-min))
-                  (when (search-forward (format ">CC%s<" (upcase sym)) nil t)
-                    (replace-match  (format ">%s<" txt) t t))
-                  
-                  (setq txt (assoc (format "<M-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-variable-layout))))
-                  (if (not txt)
+                          (setq txt "⌨")))
+                    (setq txt "⌨")))
+                (goto-char (point-min))
+                (when (search-forward (format ">CC%s<" (upcase sym)) nil t)
+                  (replace-match  (format ">%s<" txt) t t))
+                
+                (setq txt (assoc (format "<M-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-variable-layout))))
+                (if (not txt)
+                    (progn
+                      (setq txt (assoc (format "<M-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-fixed-layout))))
+                      (if (not txt)
+                          (setq txt "")
+                        (if (>= (length txt) 3)
+                            (setq txt (nth 2 txt))
+                          (setq txt ""))))
+                  (if (>= (length txt) 3)
+                      (setq txt (nth 2 txt))
+                    (setq txt "")))
+                (when (string= "" txt)
+                  (setq txt
+                        (all-completions
+                         (format "<M-%s> " (downcase sym))
+                         (symbol-value (ergoemacs-get-variable-layout))))
+                  (if (= 0 (length txt))
                       (progn
-                        (setq txt (assoc (format "<M-%s>" (downcase sym)) 
(symbol-value (ergoemacs-get-fixed-layout))))
-                        (if (not txt)
+                        (setq txt
+                              (all-completions
+                               (format "<M-%s> " (downcase sym))
+                               (symbol-value (ergoemacs-get-fixed-layout))))
+                        (if (= 0 (length txt))
                             (setq txt "")
-                          (if (>= (length txt) 3)
-                              (setq txt (nth 2 txt))
-                            (setq txt ""))))
-                    (if (>= (length txt) 3)
-                        (setq txt (nth 2 txt))
-                      (setq txt "")))
-                  (when (string= "" txt)
-                    (setq txt
-                          (all-completions
-                           (format "<M-%s> " (downcase sym))
-                           (symbol-value (ergoemacs-get-variable-layout))))
-                    (if (= 0 (length txt))
-                        (progn
-                          (setq txt
-                                (all-completions
-                                 (format "<M-%s> " (downcase sym))
-                                 (symbol-value (ergoemacs-get-fixed-layout))))
-                          (if (= 0 (length txt))
-                              (setq txt "")
-                            (setq txt "⌨")))
-                      (setq txt "⌨")))
-                  (goto-char (point-min))
-                  (when (search-forward (format ">MM%s<" (upcase sym)) nil t)
-                    (replace-match  (format ">%s<" txt) t t)))
-                '("F1" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "F10" "F11" 
"F12"))
-               ;; Legend/Key
-               (goto-char (point-min))
-               (when (search-forward (format ">%s<" rep-sym-pre) nil t)
-                 (replace-match (format ">%s<" (ergoemacs-gen-svg-quote 
final-txt)) t t))))
-           ergoemacs-svn-prefixes)
+                          (setq txt "⌨")))
+                    (setq txt "⌨")))
+                (goto-char (point-min))
+                (when (search-forward (format ">MM%s<" (upcase sym)) nil t)
+                  (replace-match  (format ">%s<" txt) t t))
+                
+                )
+              ;; Legend/Key
+              (goto-char (point-min))
+              (when (search-forward (format ">%s<" rep-sym-pre) nil t)
+                (replace-match (format ">%s<" (ergoemacs-gen-svg-quote 
final-txt)) t t))))
           (setq i (+ i 1)))
         (goto-char (point-min))
         (while (re-search-forward 
">\\([0-4]?[CMAN][0-9]+\\|[0-4]?[CMAN]\\{2\\}[^\n<]*?\\|nil\\)<" nil t)
@@ -1679,26 +1640,22 @@ IS-PREFIX tell ergoemacs if this is a prefix diagram."
   (interactive)
   (let* ((lay (or layouts (ergoemacs-get-layouts)))
          (saved-theme ergoemacs-theme))
-    (mapc
-     (lambda(x)
-       (message "Generate SVG for %s" x)
-       (condition-case err
-           (progn
-             (ergoemacs-gen-svg x)
-             (ergoemacs-set-default 'ergoemacs-theme nil)
-             (ergoemacs-gen-svg x "kbd-ergo.svg" "ergo-layouts"))
-         (error (message "Error generating base SVG for %s; %s" x err)))
-       (mapc
-        (lambda(y)
-          (condition-case err
-              (progn
-                (ergoemacs-set-default 'ergoemacs-theme y)
-                (ergoemacs-gen-svg x "kbd-ergo.svg" (concat y)))
-            (error (message "Error generating theme %s; %s" y err))))
-        (sort (ergoemacs-get-themes) 'string<))
-       (message "Setting theme back to %s" saved-theme)
-       (ergoemacs-set-default 'ergoemacs-theme saved-theme))
-     lay)))
+    (dolist (x lay)
+      (message "Generate SVG for %s" x)
+      (condition-case err
+          (progn
+            (ergoemacs-gen-svg x)
+            (ergoemacs-set-default 'ergoemacs-theme nil)
+            (ergoemacs-gen-svg x "kbd-ergo.svg" "ergo-layouts"))
+        (error (message "Error generating base SVG for %s; %s" x err)))
+      (dolist (y (sort (ergoemacs-get-themes) 'string<))
+        (condition-case err
+            (progn
+              (ergoemacs-set-default 'ergoemacs-theme y)
+              (ergoemacs-gen-svg x "kbd-ergo.svg" (concat y)))
+          (error (message "Error generating theme %s; %s" y err))))
+      (message "Setting theme back to %s" saved-theme)
+      (ergoemacs-set-default 'ergoemacs-theme saved-theme))))
 
 ;; (require 'json nil t)
 
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 9b645f3..d5a60d5 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -166,12 +166,10 @@
   (when (or (equal current-prefix-arg '(4))
             (equal current-prefix-arg '(16)))
     (insert "Delete Byte Compiled Files:\n")
-    (mapc
-     (lambda(file)
-       (insert "\tDelete " file)
-       (delete-file file)
-       (insert "\n"))
-     (directory-files (expand-file-name (file-name-directory (locate-library 
"ergoemacs-mode"))) t "[.]elc$"))
+    (dolist (file (directory-files (expand-file-name (file-name-directory 
(locate-library "ergoemacs-mode"))) t "[.]elc$"))
+      (insert "\tDelete " file)
+      (delete-file file)
+      (insert "\n"))
     (insert "\n"))
   (if (equal  current-prefix-arg '(16))
       (let* ((emacs-exe (ergoemacs-emacs-exe))
@@ -1124,13 +1122,11 @@ the last misspelled word with
        (t ;; This cycles through the camel-case types.
         (let ((c-char (get this-command 'state))
               n-char)
-          (mapc
-           (lambda(char)
-             (when (eq n-char t)
-               (setq n-char char))
-             (when (string= c-char char)
-               (setq n-char t)))
-           ccc)
+          (dolist (char ccc)
+            (when (eq n-char t)
+              (setq n-char char))
+            (when (string= c-char char)
+              (setq n-char t)))
           (cond
            ((eq n-char t) ;; at last char. convert un_camel to unCamel
             (let ((txt (filter-buffer-substring p1 p2)))
@@ -2136,7 +2132,8 @@ The dictionaries used are in `ergoemacs-all-dictionaries'.
 
 See also `ergoemacs-lookup-word-on-internet'."
   (interactive)
-  (mapc (lambda (dictUrl) (ergoemacs-lookup-word-on-internet input-word 
dictUrl)) ergoemacs-all-dictionaries)) 
+  (dolist (dict-url ergoemacs-all-dictionaries)
+    (ergoemacs-lookup-word-on-internet input-word dictUrl)))
 
 (defvar ergoemacs-shortcut-keys)
 (defvar ergoemacs-read-input-keys)
@@ -2181,14 +2178,12 @@ See also `ergoemacs-lookup-word-on-internet'."
                     (lambda(x) (nth 0 x))
                     minor-mode-map-alist)))
   (insert "** Maps\n")
-  (mapc
-   (lambda(x)
-     (let ((tmp (cdr x)))
-       (insert (format "*** %s: %s\n%s\n"
-                       (nth 0 x) (symbol-value (nth 0 x))
-                       (substitute-command-keys "\\{tmp}")
-                       ))))
-   ergoemacs-emulation-mode-map-alist))
+  (dolist (x ergoemacs-emulation-mode-map-alist)
+    (let ((tmp (cdr x)))
+      (insert (format "*** %s: %s\n%s\n"
+                      (nth 0 x) (symbol-value (nth 0 x))
+                      (substitute-command-keys "\\{tmp}")
+                      )))))
 
 
 ;; Ergoemacs Test suite
diff --git a/ergoemacs-macros.el b/ergoemacs-macros.el
index 662f77b..8d7f2bd 100644
--- a/ergoemacs-macros.el
+++ b/ergoemacs-macros.el
@@ -283,11 +283,9 @@ The rest of the body is an `ergoemacs-theme-component' 
named THEME-NAME-theme
     (setq tmp (eval (plist-get (nth 0 kb) ':components)))
     (push (intern (concat (plist-get (nth 0 kb) ':name) "-theme")) tmp)
     (setq tmp (plist-put (nth 0 kb) ':components tmp))
-    (mapc
-     (lambda(comp)
-       (setq tmp (plist-put (nth 0 kb) comp
-                            (eval (plist-get (nth 0 kb) comp)))))
-     '(:optional-on :optional-off :options-menu))
+    (dolist (comp '(:optional-on :optional-off :options-menu))
+      (setq tmp (plist-put (nth 0 kb) comp
+                           (eval (plist-get (nth 0 kb) comp)))))
     
     `(let (themes silent)
        (setq themes (gethash "defined-themes" ergoemacs-theme-hash)
diff --git a/ergoemacs-menus.el b/ergoemacs-menus.el
index e89be39..c674beb 100644
--- a/ergoemacs-menus.el
+++ b/ergoemacs-menus.el
@@ -76,16 +76,15 @@
                   (cdr menu)))
 
   ;; Recurse sub menu items
-  (mapc (lambda (x)
-          (when (and (consp x)
-                     (consp (cdr x))
-                     (consp (cdr (cdr x)))
-                     (consp (cdr (cdr (cdr x))))
-                     (eq (car (cdr x)) 'menu-item)
-                     (keymapp (car (cdr (cdr (cdr x))))))
+  (dolist (x (cdr menu))
+    (when (and (consp x)
+               (consp (cdr x))
+               (consp (cdr (cdr x)))
+               (consp (cdr (cdr (cdr x))))
+               (eq (car (cdr x)) 'menu-item)
+               (keymapp (car (cdr (cdr (cdr x))))))
                                         ;(message "Submenu: %s" (car (cdr (cdr 
x))))
-            (ergoemacs-preprocess-menu-keybindings (car (cdr (cdr (cdr x)))))))
-        (cdr menu)))
+      (ergoemacs-preprocess-menu-keybindings (car (cdr (cdr (cdr x))))))))
 
 (defun ergoemacs-shortcut-for-command (cmd)
   (let ((key (key-description (where-is-internal cmd nil t nil t))))
@@ -155,58 +154,54 @@ All other modes are assumed to be minor modes or 
unimportant.
         all dups cur-let cur-lst current-letter
         added-modes
         (modes '()))
-    (mapc
-     (lambda(elt)
-       (unless (memq (cdr elt) modes)
-         (when (and (functionp (cdr elt))
-                    (string-match "-mode$" (condition-case err
-                                               (symbol-name (cdr elt))
-                                             (error ""))))
-           (unless (or (memq (cdr elt) ergoemacs-excluded-major-modes)
-                       (member (downcase (symbol-name (cdr elt))) added-modes))
-             (let* ((name (ergoemacs-get-major-mode-name (cdr elt)))
-                    (first (upcase (substring name 0 1))))
-               (if (member first all)
-                   (unless (member first dups)
-                     (push first dups))
-                 (push first all))
-               (push (list (cdr elt) 'menu-item
-                           name
-                           (cdr elt)) ret))
-             (push (downcase (symbol-name (cdr elt))) added-modes)
-             (push (cdr elt) modes)))))
-     (append
-      interpreter-mode-alist
-      magic-mode-alist
-      magic-fallback-mode-alist
-      auto-mode-alist))
+    (dolist (elt (append
+                  interpreter-mode-alist
+                  magic-mode-alist
+                  magic-fallback-mode-alist
+                  auto-mode-alist))
+      (unless (memq (cdr elt) modes)
+        (when (and (functionp (cdr elt))
+                   (string-match "-mode$" (condition-case err
+                                              (symbol-name (cdr elt))
+                                            (error ""))))
+          (unless (or (memq (cdr elt) ergoemacs-excluded-major-modes)
+                      (member (downcase (symbol-name (cdr elt))) added-modes))
+            (let* ((name (ergoemacs-get-major-mode-name (cdr elt)))
+                   (first (upcase (substring name 0 1))))
+              (if (member first all)
+                  (unless (member first dups)
+                    (push first dups))
+                (push first all))
+              (push (list (cdr elt) 'menu-item
+                          name
+                          (cdr elt)) ret))
+            (push (downcase (symbol-name (cdr elt))) added-modes)
+            (push (cdr elt) modes)))))
     (setq modes (sort ret (lambda(x1 x2) (string< (downcase (nth 2 x2))
                                              (downcase (nth 2 x1))))))
     (setq ret '())
-    (mapc
-     (lambda(elt)
-       (let ((this-letter (upcase (substring (nth 2 elt) 0 1))))
-         (cond
-          ((not (member this-letter dups))
-           ;; not duplicated -- add prior list and push current element.
-           (when cur-lst
-             (push `(,(intern current-letter) menu-item ,current-letter
-                     (keymap ,@cur-lst)) ret))
-           (push elt ret)
-           (setq current-letter this-letter)
-           (setq cur-lst nil))
-          ((not (equal this-letter current-letter))
-           ;; duplicated, but not last letter.
-           (when cur-lst
-             (push `(,(intern current-letter) menu-item ,current-letter
-                     (keymap ,@cur-lst)) ret))
-           (setq cur-lst nil)
-           (setq current-letter this-letter)
-           (push elt cur-lst))
-          (t
-           ;; duplicated and last letter
-           (push elt cur-lst)))))
-     modes)
+    (dolist (elt modes)
+      (let ((this-letter (upcase (substring (nth 2 elt) 0 1))))
+        (cond
+         ((not (member this-letter dups))
+          ;; not duplicated -- add prior list and push current element.
+          (when cur-lst
+            (push `(,(intern current-letter) menu-item ,current-letter
+                    (keymap ,@cur-lst)) ret))
+          (push elt ret)
+          (setq current-letter this-letter)
+          (setq cur-lst nil))
+         ((not (equal this-letter current-letter))
+          ;; duplicated, but not last letter.
+          (when cur-lst
+            (push `(,(intern current-letter) menu-item ,current-letter
+                    (keymap ,@cur-lst)) ret))
+          (setq cur-lst nil)
+          (setq current-letter this-letter)
+          (push elt cur-lst))
+         (t
+          ;; duplicated and last letter
+          (push elt cur-lst)))))
     (when cur-lst
       (push `(,(intern current-letter) menu-item ,current-letter
               (keymap ,@cur-lst)) ret))
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index c5d4d52..cab9b0e 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -617,10 +617,8 @@ However instead of using M-a `eval-buffer', you could use 
M-a `eb'"
 
 (defun ergoemacs-load-aliases ()
   "Loads aliases defined in `ergoemacs-aliases'."
-  (mapc
-   (lambda(x)
-     (eval (macroexpand `(defalias ',(nth 0 x) ',(nth 1 x)))))
-   ergoemacs-aliases))
+  (dolist (x ergoemacs-aliases)
+    (eval (macroexpand `(defalias ',(nth 0 x) ',(nth 1 x))))))
 
 (when ergoemacs-use-aliases
   (ergoemacs-load-aliases))
diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index 59e825f..cd5d858 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -650,11 +650,10 @@ In addition, when the function is called:
     (ergoemacs-defer-post-command-hook)
     (reset-this-command-lengths))
    (t
-    (mapc
-     (lambda(var) ;; should include `this-command' and `this-original-command'
-       (when (ergoemacs-smart-function-p var)
-         (set var function)))
-     ergoemacs-this-command-fake)
+    (dolist (var ergoemacs-this-command-fake)
+      ;; should include `this-command' and `this-original-command'
+      (when (ergoemacs-smart-function-p var)
+        (set var function)))
     (let ((this-command-keys-shift-translated
            (or this-command-keys-shift-translated
                (if ergoemacs-shift-translated t nil))))
@@ -1120,30 +1119,28 @@ argument prompt.
                              (condition-case err
                                  (interactive-form (nth 0 tmp))
                                (error nil)))
-                    (mapc
-                     (lambda(key)
-                       (let ((key-base (concat ":" (md5 (format "%s" key))))
-                             (ergoemacs-use-ergoemacs-key-descriptions t))
-                         ;; First add translation to next-key
-                         (setq next-key
-                               (plist-put next-key
-                                          (intern (concat key-base "-key"))
-                                          key))
-                         (setq next-key
-                               (plist-put next-key
-                                          (intern key-base)
-                                          (key-description key)))
-                         (setq next-key
-                               (plist-put next-key
-                                          (intern (concat key-base "-pretty"))
-                                          (ergoemacs-pretty-key
-                                           (plist-get next-key (intern 
key-base)))))
-                         ;; Now add to list to check.
-                         (push key-base key-trials)
-                         ;; Add ergoemacs translation
-                         (setq next-key (ergoemacs-read-key-add-translation 
next-key key-base))
-                         (push (concat key-base "-et") key-trials)))
-                     (ergoemacs-shortcut-function-binding (nth 0 tmp)))))
+                    (dolist (key (ergoemacs-shortcut-function-binding (nth 0 
tmp)))
+                      (let ((key-base (concat ":" (md5 (format "%s" key))))
+                            (ergoemacs-use-ergoemacs-key-descriptions t))
+                        ;; First add translation to next-key
+                        (setq next-key
+                              (plist-put next-key
+                                         (intern (concat key-base "-key"))
+                                         key))
+                        (setq next-key
+                              (plist-put next-key
+                                         (intern key-base)
+                                         (key-description key)))
+                        (setq next-key
+                              (plist-put next-key
+                                         (intern (concat key-base "-pretty"))
+                                         (ergoemacs-pretty-key
+                                          (plist-get next-key (intern 
key-base)))))
+                        ;; Now add to list to check.
+                        (push key-base key-trials)
+                        ;; Add ergoemacs translation
+                        (setq next-key (ergoemacs-read-key-add-translation 
next-key key-base))
+                        (push (concat key-base "-et") key-trials)))))
                 (when ergoemacs-translate-keys
                   (dolist (trial '(":raw" ":ctl" ":alt" ":alt-ctl" 
":raw-shift" ":ctl-shift" ":alt-shift" ":alt-ctl-shift"))
                     (push trial key-trials)
@@ -1403,22 +1400,20 @@ Basically, this gets the keys called and passes the 
arguments to`ergoemacs-read-
         ergoemacs-repeat-keys
         ergoemacs-read-input-keys
         (keymap (make-sparse-keymap)))
-    (mapc
-     (lambda(key)
-       (when (= 1 (length key))
-         (let ((mods (event-modifiers (elt key 0))))
-           (when (memq 'meta mods)
-             (define-key keymap
-               (vector
-                (event-convert-list
-                 (append (delete 'meta mods)
-                         (list (event-basic-type (elt key 0))))))
-               `(lambda() (interactive) (ergoemacs-read-key ,(key-description 
key))))))))
-     (apply 'append
-            (mapcar
-             (lambda (cmd)
-               (where-is-internal cmd))
-             (or cmds '(ergoemacs-shortcut-movement 
ergoemacs-shortcut-movement-no-shift-select)))))
+    (dolist (key (apply 'append
+                        (mapcar
+                         (lambda (cmd)
+                           (where-is-internal cmd))
+                         (or cmds '(ergoemacs-shortcut-movement 
ergoemacs-shortcut-movement-no-shift-select)))))
+      (when (= 1 (length key))
+        (let ((mods (event-modifiers (elt key 0))))
+          (when (memq 'meta mods)
+            (define-key keymap
+              (vector
+               (event-convert-list
+                (append (delete 'meta mods)
+                        (list (event-basic-type (elt key 0))))))
+              `(lambda() (interactive) (ergoemacs-read-key ,(key-description 
key))))))))
     keymap))
 
 (defun ergoemacs-shortcut-movement (&optional opt-args)
@@ -1562,60 +1557,58 @@ user-defined keys.
           (progn
             (use-global-map new-global-map)
             (when key-bindings-lst
-              (mapc
-               (lambda(key)
-                 (let* (fn
-                        (key-desc (key-description key))
-                        (user-key
-                         (read-kbd-macro
-                          (concat "<ergoemacs-user> " key-desc)))
-                        fn2)
-                   (cond
-                    (keymap
-                     (setq fn (lookup-key keymap key t))
-                     (if (eq fn (lookup-key keymap user-key))
+              (dolist (key key-bindings-lst)
+                (let* (fn
+                       (key-desc (key-description key))
+                       (user-key
+                        (read-kbd-macro
+                         (concat "<ergoemacs-user> " key-desc)))
+                       fn2)
+                  (cond
+                   (keymap
+                    (setq fn (lookup-key keymap key t))
+                    (if (eq fn (lookup-key keymap user-key))
+                        (setq fn nil)
+                      (unless (condition-case err
+                                  (interactive-form fn)
+                                (error nil))
+                        (setq fn nil))))
+                   (t
+                    (ergoemacs-with-global
+                     (setq fn (ergoemacs-real-key-binding key t nil (point)))
+                     (if (eq fn (ergoemacs-real-key-binding user-key t nil 
(point)))
                          (setq fn nil)
-                       (unless (condition-case err
-                                   (interactive-form fn)
-                                 (error nil))
-                         (setq fn nil))))
-                    (t
-                     (ergoemacs-with-global
-                      (setq fn (ergoemacs-real-key-binding key t nil (point)))
-                      (if (eq fn (ergoemacs-real-key-binding user-key t nil 
(point)))
-                          (setq fn nil)
-                        (if (keymapp fn)
-                            (setq fn nil))))))
-                   (when fn
-                     (cond
-                      ((eq ignore-desc t))
-                      ((eq (type-of ignore-desc) 'string)
-                       (when (string-match ignore-desc key-desc)
-                         (setq fn nil)))
-                      (t
-                       (when (string-match "[sAH]-" key-desc)
-                         (setq fn nil))))
-                     (when fn
-                       (unless dont-swap-for-ergoemacs-functions
-                         (setq fn2 (condition-case err
-                                       (intern-soft (concat "ergoemacs-" 
(symbol-name fn)))
-                                     (error nil)))
-                         (when (and fn2 (not (interactive-form fn2)))
-                           (setq fn2 nil)))
-                       (when (memq fn (append
-                                       `(,function ,(if keymap nil 
ergoemacs-this-command))
-                                       ergoemacs-shortcut-ignored-functions))
-                         (setq fn nil))
-                       (when (and fn2
-                                  (memq fn2 (append
-                                             `(,function ,(if keymap nil 
ergoemacs-this-command))
-                                             
ergoemacs-shortcut-ignored-functions)))
-                         (setq fn2 nil))
-                       (cond
-                        (fn2
-                         (push (list fn2 key key-desc) ret2))
-                        (fn (push (list fn key key-desc) ret)))))))
-               key-bindings-lst)))
+                       (if (keymapp fn)
+                           (setq fn nil))))))
+                  (when fn
+                    (cond
+                     ((eq ignore-desc t))
+                     ((eq (type-of ignore-desc) 'string)
+                      (when (string-match ignore-desc key-desc)
+                        (setq fn nil)))
+                     (t
+                      (when (string-match "[sAH]-" key-desc)
+                        (setq fn nil))))
+                    (when fn
+                      (unless dont-swap-for-ergoemacs-functions
+                        (setq fn2 (condition-case err
+                                      (intern-soft (concat "ergoemacs-" 
(symbol-name fn)))
+                                    (error nil)))
+                        (when (and fn2 (not (interactive-form fn2)))
+                          (setq fn2 nil)))
+                      (when (memq fn (append
+                                      `(,function ,(if keymap nil 
ergoemacs-this-command))
+                                      ergoemacs-shortcut-ignored-functions))
+                        (setq fn nil))
+                      (when (and fn2
+                                 (memq fn2 (append
+                                            `(,function ,(if keymap nil 
ergoemacs-this-command))
+                                            
ergoemacs-shortcut-ignored-functions)))
+                        (setq fn2 nil))
+                      (cond
+                       (fn2
+                        (push (list fn2 key key-desc) ret2))
+                       (fn (push (list fn key key-desc) ret)))))))))
         (use-global-map old-global-map))
       (when ret2
         (setq ret (append ret2 ret)))
diff --git a/ergoemacs-test.el b/ergoemacs-test.el
index 4f4b8d7..e1ad075 100644
--- a/ergoemacs-test.el
+++ b/ergoemacs-test.el
@@ -647,10 +647,8 @@ Should test issue #142"
       (execute-kbd-macro macro)
       (when (looking-at " in culpa qui")
         (setq ret t))
-      (mapc
-       (lambda(x)
-         (delete-overlay x))
-       overlays)
+      (dolist (x overlays)
+        (delete-overlay x))
       (kill-buffer (current-buffer)))
     (ergoemacs-mode -1)
     (setq ergoemacs-theme old-ergoemacs-theme)
@@ -782,10 +780,8 @@ Part of addressing Issue #147."
       (execute-kbd-macro macro)
       (when (looking-at ")")
         (setq ret t))
-      (mapc
-       (lambda(x)
-         (delete-overlay x))
-       overlays)
+      (dolist (x overlays)
+        (delete-overlay x))
       (kill-buffer (current-buffer)))
     (ergoemacs-mode -1)
     (setq ergoemacs-theme old-ergoemacs-theme)
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 2f187cb..29f650e 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -1696,31 +1696,29 @@ Formatted for use with `ergoemacs-theme-component-hash' 
it will return ::version
               best-version-list
               test-version-list
               ret)
-          (mapc
-           (lambda (v)
-             (setq test-version-list (version-to-list v))
-             (if (not biggest-version)
-                 (setq biggest-version v
-                       biggest-version-list test-version-list)
-               (when (version-list-< biggest-version-list test-version-list)
-                 (setq biggest-version v
-                       biggest-version-list test-version-list)))
-             (if (not smallest-version)
-                 (setq smallest-version v
-                       smallest-version-list test-version-list)
-               (when (version-list-< test-version-list smallest-version-list)
-                 (setq smallest-version v
-                       smallest-version-list test-version-list)))
-             (cond
-              ((and (not best-version)
-                    (version-list-<= test-version-list use-version))
-               (setq best-version v
-                     best-version-list test-version-list))
-              ((and (version-list-<= best-version-list test-version-list) ;; 
Better than best 
-                    (version-list-<= test-version-list use-version))
-               (setq best-version v
-                     best-version-list test-version-list))))
-           version-list)
+          (dolist (v version-list)
+            (setq test-version-list (version-to-list v))
+            (if (not biggest-version)
+                (setq biggest-version v
+                      biggest-version-list test-version-list)
+              (when (version-list-< biggest-version-list test-version-list)
+                (setq biggest-version v
+                      biggest-version-list test-version-list)))
+            (if (not smallest-version)
+                (setq smallest-version v
+                      smallest-version-list test-version-list)
+              (when (version-list-< test-version-list smallest-version-list)
+                (setq smallest-version v
+                      smallest-version-list test-version-list)))
+            (cond
+             ((and (not best-version)
+                   (version-list-<= test-version-list use-version))
+              (setq best-version v
+                    best-version-list test-version-list))
+             ((and (version-list-<= best-version-list test-version-list) ;; 
Better than best 
+                   (version-list-<= test-version-list use-version))
+              (setq best-version v
+                    best-version-list test-version-list))))
           (if (version-list-< biggest-version-list use-version)
               (setq ret "")
             (if best-version
@@ -1912,23 +1910,19 @@ This respects `ergoemacs-theme-options'."
                                ergoemacs-theme-hash))
          components)
     (setq components (reverse (plist-get theme-plist ':components)))
-    (mapc
-     (lambda(x)
-       (let ((a (assoc x ergoemacs-theme-options)))
-         (if (not a)
-             (push x components)
-           (setq a (car (cdr a)))
-           (when (or (not a) (eq a 'on))
-             (push x components)))))
-     (reverse (plist-get theme-plist ':optional-on)))
-    (mapc
-     (lambda(x)
-       (let ((a (assoc x ergoemacs-theme-options)))
-         (when a
-           (setq a (car (cdr a)))
-           (when (eq a 'on)
-             (push x components)))))
-     (reverse (plist-get theme-plist ':optional-off)))
+    (dolist (x (reverse (plist-get theme-plist ':optional-on)))
+      (let ((a (assoc x ergoemacs-theme-options)))
+        (if (not a)
+            (push x components)
+          (setq a (car (cdr a)))
+          (when (or (not a) (eq a 'on))
+            (push x components)))))
+    (dolist (x (reverse (plist-get theme-plist ':optional-off)))
+      (let ((a (assoc x ergoemacs-theme-options)))
+        (when a
+          (setq a (car (cdr a)))
+          (when (eq a 'on)
+            (push x components)))))
     (setq components (reverse components))
     components))
 
@@ -1955,39 +1949,35 @@ TYPE can also be 'off, where the option will be 
included in the
 theme, but assumed to be disabled by default.
 "
   (if (eq (type-of option) 'cons)
-      (mapc
-       (lambda(new-option)
-         (let (ergoemacs-mode)
-           (ergoemacs-require new-option theme type)))
-       option)
+      (dolist (new-option option)
+        (let (ergoemacs-mode)
+          (ergoemacs-require new-option theme type)))
     (let ((option-sym
            (or (and (stringp option) (intern option)) option)))
-      (mapc
-     (lambda(theme)
-       (let ((theme-plist (gethash (if (stringp theme) theme
-                                     (symbol-name theme))
-                                   ergoemacs-theme-hash))
-             comp on off)
-         (setq comp (plist-get theme-plist ':components)
-               on (plist-get theme-plist ':optional-on)
-               off (plist-get theme-plist ':optional-off))
-         (setq comp (delq option-sym comp)
-               on (delq option-sym on)
-               off (delq option-sym off))
-         (cond
-          ((eq type 'required-hidden)
-           (push option-sym comp))
-          ((eq type 'off)
-           (push option-sym off))
-          (t
-           (push option-sym on)))
-         (setq theme-plist (plist-put theme-plist ':components comp))
-         (setq theme-plist (plist-put theme-plist ':optional-on on))
-         (setq theme-plist (plist-put theme-plist ':optional-off off))
-         (puthash (if (stringp theme) theme (symbol-name theme)) theme-plist
-                  ergoemacs-theme-hash)))
-     (or (and theme (or (and (eq (type-of theme) 'cons) theme) (list theme)))
-         (ergoemacs-get-themes)))))
+      (dolist (theme (or (and theme (or (and (eq (type-of theme) 'cons) theme) 
(list theme)))
+                         (ergoemacs-get-themes)))
+        (let ((theme-plist (gethash (if (stringp theme) theme
+                                      (symbol-name theme))
+                                    ergoemacs-theme-hash))
+              comp on off)
+          (setq comp (plist-get theme-plist ':components)
+                on (plist-get theme-plist ':optional-on)
+                off (plist-get theme-plist ':optional-off))
+          (setq comp (delq option-sym comp)
+                on (delq option-sym on)
+                off (delq option-sym off))
+          (cond
+           ((eq type 'required-hidden)
+            (push option-sym comp))
+           ((eq type 'off)
+            (push option-sym off))
+           (t
+            (push option-sym on)))
+          (setq theme-plist (plist-put theme-plist ':components comp))
+          (setq theme-plist (plist-put theme-plist ':optional-on on))
+          (setq theme-plist (plist-put theme-plist ':optional-off off))
+          (puthash (if (stringp theme) theme (symbol-name theme)) theme-plist
+                   ergoemacs-theme-hash)))))
   (ergoemacs-theme-option-on option))
 
 (declare-function ergoemacs-mode "ergoemacs-mode.el")
@@ -1997,11 +1987,9 @@ theme, but assumed to be disabled by default.
 When OPTION is a list turn on all the options in the list
 If OFF is non-nil, turn off the options instead."
   (if (eq (type-of option) 'cons)
-      (mapc
-       (lambda(new-option)
-         (let (ergoemacs-mode)
-           (ergoemacs-theme-option-on new-option off)))
-       option)
+      (dolist (new-option option)
+        (let (ergoemacs-mode)
+          (ergoemacs-theme-option-on new-option off)))
     (let (found)
       (setq ergoemacs-theme-options
             (mapcar
@@ -2052,45 +2040,39 @@ If OFF is non-nil, turn off the options instead."
           options-off (plist-get plist ':optional-off)
           menu-list (plist-get plist ':options-menu))
     (if (= 0 (length (append options-on options-off))) nil
-      (mapc
-       (lambda(elt)
-         (let ((menu-name (nth 0 elt))
-               (menu-items (nth 1 elt))
-               desc plist2
-               (ret '()))
-           (mapc
-            (lambda(option)
-              (when (memq option (append options-on options-off))
-                ;; (setq plist2 (gethash (concat (symbol-name option) 
":plist") ergoemacs-theme-component-hash))
-                ;; (setq desc (plist-get plist2 ':description))
-                (setq desc (ergoemacs-theme-get-component-description 
(symbol-name option)))
-                (push option menu-options)
-                (push
-                 `(,option
-                   menu-item ,desc
-                   (lambda()
-                     (interactive)
-                     (ergoemacs-theme-toggle-option ',option)
-                     (ergoemacs-mode -1)
-                     (ergoemacs-mode 1))
-                   :button (:toggle . (ergoemacs-theme-option-enabled-p 
',option)))
-                 ret)))
-            (reverse menu-items))
-           (unless (eq ret '())
-             (setq ret
-                   `(,(intern (format "options-menu-%s" i))
-                     menu-item ,menu-name
-                     (keymap ,@ret)))
-             (setq i (+ i 1))
-             (push ret menu-pre))))
-       (reverse menu-list))
-      (mapc
-       (lambda(option)
-         (unless (member option menu-options)
-           (let ((desc (ergoemacs-theme-get-component-description (symbol-name 
option))))
-             (push desc options-list)
-             (push (list desc option) options-alist))))
-       (append options-on options-off))
+      (dolist (elt (reverse menu-list))
+        (let ((menu-name (nth 0 elt))
+              (menu-items (nth 1 elt))
+              desc plist2
+              (ret '()))
+          (dolist (option (reverse menu-items))
+            (when (memq option (append options-on options-off))
+              ;; (setq plist2 (gethash (concat (symbol-name option) ":plist") 
ergoemacs-theme-component-hash))
+              ;; (setq desc (plist-get plist2 ':description))
+              (setq desc (ergoemacs-theme-get-component-description 
(symbol-name option)))
+              (push option menu-options)
+              (push
+               `(,option
+                 menu-item ,desc
+                 (lambda()
+                   (interactive)
+                   (ergoemacs-theme-toggle-option ',option)
+                   (ergoemacs-mode -1)
+                   (ergoemacs-mode 1))
+                 :button (:toggle . (ergoemacs-theme-option-enabled-p 
',option)))
+               ret)))
+          (unless (eq ret '())
+            (setq ret
+                  `(,(intern (format "options-menu-%s" i))
+                    menu-item ,menu-name
+                    (keymap ,@ret)))
+            (setq i (+ i 1))
+            (push ret menu-pre))))
+      (dolist (option (append options-on options-off))
+        (unless (member option menu-options)
+          (let ((desc (ergoemacs-theme-get-component-description (symbol-name 
option))))
+            (push desc options-list)
+            (push (list desc option) options-alist))))
       `(ergoemacs-theme-options
         menu-item "Theme Options"
         (keymap
diff --git a/ergoemacs-track.el b/ergoemacs-track.el
index bb67656..3330ee0 100644
--- a/ergoemacs-track.el
+++ b/ergoemacs-track.el
@@ -158,12 +158,10 @@
     (when lay
       (if curr-i
           (setq wi curr-i)
-        (mapc
-         (lambda(x)
-           (when (string= key x)
-             (setq wi i))
-           (setq i (+ i 1)))
-         (symbol-value lay)))
+        (dolist (x (symbol-value lay))
+          (when (string= key x)
+            (setq wi i))
+          (setq i (+ i 1))))
       (setq i wi)
       (setq xh (nth (if (<= (nth i ergoemacs-track-finger) 3)
                         (+ 32 (nth i ergoemacs-track-finger))
diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el
index ebb94de..f0e928f 100644
--- a/ergoemacs-translate.el
+++ b/ergoemacs-translate.el
@@ -414,51 +414,47 @@ This function is made in `ergoemacs-translation' and 
calls `ergoemacs-modal-togg
     
     
     ;; Now put the translation text together as a list.
-    (mapc
-     (lambda(x)
-       (let ((trans (plist-get arg-plist (nth 0 x)))
-             (orig (nth 1 x))
-             case-fold-search)
-         (when trans
-           (push (concat orig (ergoemacs-unicode-char "→" "->") trans)
-                 trans-text)
-           (push (concat
-                  (replace-regexp-in-string
-                   "[Qq]" ""
-                   (ergoemacs-pretty-key (concat orig "q")))
-                  (ergoemacs-unicode-char "→" "->")
-                  (replace-regexp-in-string
-                   "[Qq]" ""
-                   (ergoemacs-pretty-key (concat trans "q"))))
-                 pretty-trans))))
-     '((:alt "M-")
-       (:ctl "C-")
-       (:shift "S-")
-       (:alt-ctl "M-C-")
-       (:alt-shift "M-S-")
-       (:ctl-shift "C-S-")
-       (:alt-ctl-shift "C-M-S-")))
+    (dolist (x '((:alt "M-")
+                 (:ctl "C-")
+                 (:shift "S-")
+                 (:alt-ctl "M-C-")
+                 (:alt-shift "M-S-")
+                 (:ctl-shift "C-S-")
+                 (:alt-ctl-shift "C-M-S-")))
+      (let ((trans (plist-get arg-plist (nth 0 x)))
+            (orig (nth 1 x))
+            case-fold-search)
+        (when trans
+          (push (concat orig (ergoemacs-unicode-char "→" "->") trans)
+                trans-text)
+          (push (concat
+                 (replace-regexp-in-string
+                  "[Qq]" ""
+                  (ergoemacs-pretty-key (concat orig "q")))
+                 (ergoemacs-unicode-char "→" "->")
+                 (replace-regexp-in-string
+                  "[Qq]" ""
+                  (ergoemacs-pretty-key (concat trans "q"))))
+                pretty-trans))))
     ;; Now get keys that change the next key's behavior
     (when keymap
-      (mapc
-       (lambda(x)
-         (let ((key (where-is-internal (nth 0 x) keymap t))
-               (trans (nth 1 x)))
-           (when key
-             (setq key (key-description key))
-             (push (concat key (ergoemacs-unicode-char "→" "->") trans)
-                   key-text)
-             (push (concat
-                    (ergoemacs-pretty-key key)
-                    (ergoemacs-unicode-char "→" "->")
-                    (replace-regexp-in-string
-                     "[Qq]" ""
-                     (ergoemacs-pretty-key (concat trans "q"))))
-                   key-pretty))))
-       '((ergoemacs-read-key-next-key-is-alt "M-")
-         (ergoemacs-read-key-next-key-is-ctl "C-")
-         (ergoemacs-read-key-next-key-is-alt-ctl "C-M-")
-         (ergoemacs-read-key-next-key-is-quoted ""))))
+      (dolist (x '((ergoemacs-read-key-next-key-is-alt "M-")
+                   (ergoemacs-read-key-next-key-is-ctl "C-")
+                   (ergoemacs-read-key-next-key-is-alt-ctl "C-M-")
+                   (ergoemacs-read-key-next-key-is-quoted "")))
+        (let ((key (where-is-internal (nth 0 x) keymap t))
+              (trans (nth 1 x)))
+          (when key
+            (setq key (key-description key))
+            (push (concat key (ergoemacs-unicode-char "→" "->") trans)
+                  key-text)
+            (push (concat
+                   (ergoemacs-pretty-key key)
+                   (ergoemacs-unicode-char "→" "->")
+                   (replace-regexp-in-string
+                    "[Qq]" ""
+                    (ergoemacs-pretty-key (concat trans "q"))))
+                  key-pretty)))))
     (setq tmp '("" ""))
     (when (plist-get arg-plist ':unchorded)
       (setq tmp (list (plist-get arg-plist ':unchorded)
@@ -858,32 +854,30 @@ and `ergoemacs-pretty-key' descriptions.
                                           ergoemacs-translation-assoc) nil)))))
     ;; Pre-cache the translations...?  Takes too long to load :(
     (when nil
-      (mapc
-       (lambda(char)
-         (unless (string= "" char)
-           (ergoemacs-translate char)
-           (ergoemacs-translate (concat "C-" char))
-           (ergoemacs-translate (concat "M-" char))
-           (ergoemacs-translate (concat "M-C-" char))))
-       (append lay '("<f1>"  "<S-f1>"
-                     "<f2>"  "<S-f2>"
-                     "<f3>"  "<S-f3>"
-                     "<f4>"  "<S-f4>"
-                     "<f5>"  "<S-f5>"
-                     "<f6>"  "<S-f6>"
-                     "<f7>"  "<S-f7>"
-                     "<f8>"  "<S-f8>"
-                     "<f9>"  "<S-f9>"
-                     "<f10>" "<S-f10>"
-                     "<f11>" "<S-f11>"
-                     "<f12>" "<S-f12>"
-                     "SPC" "RET" "ESC" "DEL" "TAB"
-                     "<home>" "<S-home>"
-                     "<next>" "<S-next>"
-                     "<prior>" "<S-prior>"
-                     "<end>" "<S-end>"
-                     "<insert>" "<S-insert>"
-                     "<deletechar>" "<S-deletechar>"))))))
+      (dolist (char (append lay '("<f1>"  "<S-f1>"
+                                  "<f2>"  "<S-f2>"
+                                  "<f3>"  "<S-f3>"
+                                  "<f4>"  "<S-f4>"
+                                  "<f5>"  "<S-f5>"
+                                  "<f6>"  "<S-f6>"
+                                  "<f7>"  "<S-f7>"
+                                  "<f8>"  "<S-f8>"
+                                  "<f9>"  "<S-f9>"
+                                  "<f10>" "<S-f10>"
+                                  "<f11>" "<S-f11>"
+                                  "<f12>" "<S-f12>"
+                                  "SPC" "RET" "ESC" "DEL" "TAB"
+                                  "<home>" "<S-home>"
+                                  "<next>" "<S-next>"
+                                  "<prior>" "<S-prior>"
+                                  "<end>" "<S-end>"
+                                  "<insert>" "<S-insert>"
+                                  "<deletechar>" "<S-deletechar>")))
+        (unless (string= "" char)
+          (ergoemacs-translate char)
+          (ergoemacs-translate (concat "C-" char))
+          (ergoemacs-translate (concat "M-" char))
+          (ergoemacs-translate (concat "M-C-" char)))))))
 
 (declare-function ergoemacs-mode-line "ergoemacs-mode.el")
 (defun ergoemacs-setup-keys-for-layout (layout &optional base-layout)
@@ -949,6 +943,7 @@ If JUST-TRANSLATE is non-nil, just return the KBD code, not 
the actual emacs key
 For example, on dvorak, change C-j to C-c (copy/command)."
   :type 'boolean
   :set 'ergoemacs-set-default
+  :initialize #'custom-initialize-default
   :group 'ergoemacs-mode)
 
 (defun ergoemacs-get-kbd-translation (pre-kbd-code &optional dont-swap)
diff --git a/ergoemacs-unbind.el b/ergoemacs-unbind.el
index 45e54e3..0e2d080 100644
--- a/ergoemacs-unbind.el
+++ b/ergoemacs-unbind.el
@@ -733,16 +733,12 @@
 (defun ergoemacs-reset-global-where-is ()
   "Reset `ergoemacs-where-is-global-hash'."
   (setq ergoemacs-where-is-global-hash (make-hash-table :test 'equal))
-  (mapc
-   (lambda(x)
-     (let ((key (read-kbd-macro (nth 0 x))))
-       (mapc
-        (lambda(fn)
-          (let ((keys (gethash fn ergoemacs-where-is-global-hash)))
-            (pushnew key keys :test equal)
-            (puthash fn keys ergoemacs-where-is-global-hash)))
-        (nth 1 x))))
-   ergoemacs-emacs-default-bindings))
+  (dolist (x ergoemacs-emacs-default-bindings)
+    (let ((key (read-kbd-macro (nth 0 x))))
+      (dolist (fn (nth 1 x))
+        (let ((keys (gethash fn ergoemacs-where-is-global-hash)))
+          (pushnew key keys :test equal)
+          (puthash fn keys ergoemacs-where-is-global-hash))))))
 
 
 ;;;###autoload
@@ -911,21 +907,15 @@ This should only be run when no global keys have been set.
 (defun ergoemacs-warn-globally-changed-keys (&optional fix)
   "Warns about globally changed keys. If FIX is true, fix the ergoemacs-unbind 
file."
   (interactive)
-  (mapc
-   (lambda(x)
-     (ergoemacs-global-changed-p (nth 0 x) nil t t))
-   ergoemacs-emacs-default-bindings)
+  (dolist (x ergoemacs-emacs-default-bindings)
+    (ergoemacs-global-changed-p (nth 0 x) nil t t))
   (message "Ergoemacs Keys warnings for this layout:")
-  (mapc
-   (lambda(x)
-     (and (eq 'string (type-of (nth 0 x)))
-          (ergoemacs-global-changed-p (nth 0 x) nil t t)))
-      (symbol-value (ergoemacs-get-fixed-layout)))
-  (mapc
-   (lambda(x)
-     (and (eq 'string (type-of (nth 0 x)))
-          (ergoemacs-global-changed-p (nth 0 x) t t)))
-   (symbol-value (ergoemacs-get-variable-layout))))
+  (dolist (x (symbol-value (ergoemacs-get-fixed-layout)))
+    (and (eq 'string (type-of (nth 0 x)))
+         (ergoemacs-global-changed-p (nth 0 x) nil t t)))
+  (dolist (x (symbol-value (ergoemacs-get-variable-layout)))
+    (and (eq 'string (type-of (nth 0 x)))
+         (ergoemacs-global-changed-p (nth 0 x) t t))))
 
 
 



reply via email to

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