[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 22/287: Some cleanups for ergoemacs-setup-translation
From: |
Matthew Fidler |
Subject: |
[elpa] 22/287: Some cleanups for ergoemacs-setup-translation |
Date: |
Wed, 02 Jul 2014 14:44:16 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 4b7b0dee0af8e326358c4fa16d0c3a3a2d421982
Author: Matthew L. Fidler <address@hidden>
Date: Fri May 30 08:16:36 2014 -0500
Some cleanups for ergoemacs-setup-translation
---
ergoemacs-translate.el | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el
index 1120313..a18d5a4 100644
--- a/ergoemacs-translate.el
+++ b/ergoemacs-translate.el
@@ -855,23 +855,25 @@ and `ergoemacs-pretty-key' descriptions.
(defun ergoemacs-setup-translation (layout &optional base-layout)
"Setup translation from BASE-LAYOUT to LAYOUT."
- (let ((orig-base (or base-layout "us"))
- lay shifted-list unshifted-list base
- len i)
- (setq lay (symbol-value (intern (concat "ergoemacs-layout-" layout))))
- (setq base (symbol-value (intern (concat "ergoemacs-layout-" orig-base))))
-
- (setq len (length base))
- (setq i 0)
+ (let* ((orig-base (or base-layout "us"))
+ (lay (symbol-value (intern (concat "ergoemacs-layout-" layout))))
+ shifted-list unshifted-list
+ (base (symbol-value (intern (concat "ergoemacs-layout-" orig-base))))
+ (len (length base))
+ (i 0))
(while (< i 60)
(unless (or (string= "" (nth i lay))
(string= "" (nth (+ i 60) lay)))
- (add-to-list 'ergoemacs-shifted-assoc
- `(,(nth i lay) . ,(nth (+ i 60) lay)))
- (add-to-list 'ergoemacs-shifted-assoc
- `(,(nth (+ i 60) lay) . ,(nth i lay)))
- (add-to-list 'unshifted-list (nth i lay))
- (add-to-list 'shifted-list (nth (+ i 60) lay)))
+ (pushnew 'ergoemacs-shifted-assoc
+ `(,(nth i lay) . ,(nth (+ i 60) lay))
+ :test 'equal)
+ (pushnew 'ergoemacs-shifted-assoc
+ `(,(nth (+ i 60) lay) . ,(nth i lay))
+ :test 'equal)
+ (pushnew 'unshifted-list (nth i lay)
+ :test 'equal)
+ (pushnew 'shifted-list (nth (+ i 60) lay)
+ :test 'equal))
(setq i (+ i 1)))
(setq ergoemacs-shifted-regexp
(format "\\(-\\| \\|^\\)\\(%s\\)\\($\\| \\)"
@@ -897,8 +899,9 @@ and `ergoemacs-pretty-key' descriptions.
(while (< i len)
(unless (or (string= "" (nth i base))
(string= "" (nth i lay)))
- (add-to-list 'ergoemacs-translation-assoc
- `(,(nth i base) . ,(nth i lay))))
+ (pushnew 'ergoemacs-translation-assoc
+ `(,(nth i base) . ,(nth i lay))
+ :test 'equal))
(setq i (+ i 1)))
(setq ergoemacs-translation-regexp
(format "\\(-\\| \\|^\\)\\(%s\\)\\($\\| \\)"
- [elpa] 13/287: Activate advices in definitions., (continued)
- [elpa] 13/287: Activate advices in definitions., Matthew Fidler, 2014/07/02
- [elpa] 14/287: Fix `ergoemacs-populate-pre-command-hook', Matthew Fidler, 2014/07/02
- [elpa] 12/287: no-ergoemacs-advice -> ergoemacs-ignore-advice, Matthew Fidler, 2014/07/02
- [elpa] 15/287: Use strinp consp and vectorp, Matthew Fidler, 2014/07/02
- [elpa] 18/287: Load ergoemacs-test for clean ergoemacs-mode load., Matthew Fidler, 2014/07/02
- [elpa] 06/287: Don't use symbol-value, Matthew Fidler, 2014/07/02
- [elpa] 16/287: ergoemacs--key-message, Matthew Fidler, 2014/07/02
- [elpa] 17/287: fix some let bindings., Matthew Fidler, 2014/07/02
- [elpa] 20/287: Add requires for byte-compile, Matthew Fidler, 2014/07/02
- [elpa] 21/287: Remove unused ergoemacs-define-key, Matthew Fidler, 2014/07/02
- [elpa] 22/287: Some cleanups for ergoemacs-setup-translation,
Matthew Fidler <=
- [elpa] 19/287: Added `ergoemacs-read-key--echo-command`, Matthew Fidler, 2014/07/02
- [elpa] 24/287: Revert ergoemacs-translate, Matthew Fidler, 2014/07/02
- [elpa] 26/287: Fix ergoemacs-extras Issue #225., Matthew Fidler, 2014/07/02
- [elpa] 27/287: Added cl require for ergoemacs-functions (Issue #225)., Matthew Fidler, 2014/07/02
- [elpa] 28/287: Merge branch 'master' into eieio, Matthew Fidler, 2014/07/02
- [elpa] 25/287: Started allowing parsing of the ergoemacs-mode key objects., Matthew Fidler, 2014/07/02
- [elpa] 01/287: Stefan Monnier's Patch, Matthew Fidler, 2014/07/02
- [elpa] 30/287: Started adding modes and setq assignments., Matthew Fidler, 2014/07/02
- [elpa] 32/287: Fix Issue #226, Matthew Fidler, 2014/07/02
- [elpa] 33/287: Merge branch 'master' into eieio, Matthew Fidler, 2014/07/02