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

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

[elpa] externals/ergoemacs-mode 21cab2a 006/325: Merge branch 'master' i


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 21cab2a 006/325: Merge branch 'master' into ergoterm
Date: Sat, 23 Oct 2021 18:48:09 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 21cab2a6a38163207cb2d5e3340cddb5c6cf965b
Merge: 89b618b 57bbe7d
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>

    Merge branch 'master' into ergoterm
---
 ergoemacs-advice.el       |   6 ++
 ergoemacs-command-loop.el | 218 ++++++++++++++++++++++++++++------------------
 ergoemacs-component.el    |   1 +
 ergoemacs-mode.el         |   5 ++
 ergoemacs-themes.el       |  10 +--
 ergoemacs-translate.el    |  32 ++++++-
 6 files changed, 172 insertions(+), 100 deletions(-)

diff --git a/ergoemacs-advice.el b/ergoemacs-advice.el
index ecb93b9..e2320d3 100644
--- a/ergoemacs-advice.el
+++ b/ergoemacs-advice.el
@@ -361,6 +361,12 @@ TYPE is the type of translation installed."
       ad-do-it
     (ergoemacs-mode--undefined-advice)))
 
+(ergoemacs-advice handle-shift-selection ()
+  "Allow `ergoemacs-mode' to do shift selection on keys like Alt+# to Alt+3."
+  :type :before
+  (when (eq 'ergoemacs-command-loop--shift-translate (key-binding 
(this-single-command-keys)))
+    (setq this-command-keys-shift-translated t)))
+
 (provide 'ergoemacs-advice)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; ergoemacs-advice.el ends here
diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index 3a28560..8628dbb 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -184,6 +184,7 @@ ignore the post-command hooks.")
 (defvar ergoemacs-command-loop-time-before-blink)
 (defvar ergoemacs-command-loop-blink-character)
 (defvar ergoemacs-command-loop-blink-rate)
+(defvar ergoemacs-command-loop-hide-shift-translations)
 (defvar ergoemacs-mode)
 (defvar ergoemacs-command-loop-type)
 (defvar ergoemacs-keymap)
@@ -800,6 +801,9 @@ KEYS is the keys information"
        (push 'ergoemacs-timeout unread-command-events))
       (setq ergoemacs-command--timeout-keys nil))))
 
+(defvar ergoemacs-this-command-keys-shift-translated nil
+  "ergoemacs override of shift translation in command loop.")
+
 (defun ergoemacs-command--echo-prefix ()
   "Echos prefix keys in the ergoemacs-mode way."
   (let ((keys (this-single-command-keys))
@@ -817,6 +821,8 @@ KEYS is the keys information"
           ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut) 
            (push 'ergoemacs-timeout unread-command-events))
           ((not (region-active-p))) ;; active
+          ((and (or ergoemacs-this-command-keys-shift-translated 
this-command-keys-shift-translated)
+                 (eq ergoemacs-handle-ctl-c-or-ctl-x 'both)))
           ((and (not ergoemacs-ctl-c-or-ctl-x-delay) ;; Immediate
                  (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
            (push 'ergoemacs-timeout unread-command-events))
@@ -899,7 +905,8 @@ read."
       ;; Don't echo the uncommon hyper/super/alt translations (alt is
       ;; not the alt key...)
       (dolist (tr trans)
-        (unless (or (memq 'hyper (nth 0  tr)) (memq 'super (nth 0 tr)) (memq 
'alt (nth 0 tr)))
+        (unless (or (memq 'hyper (nth 0  tr)) (memq 'super (nth 0 tr)) (memq 
'alt (nth 0 tr))
+                    (and ergoemacs-command-loop-hide-shift-translations (memq 
'shift (nth 0  tr))))
           (if (member (list (nth 1 tr) (nth 0 tr)) trans)
               (when (not (member (list (nth 1 tr) (nth 0 tr)) double))
                 (push tr double))
@@ -1553,7 +1560,8 @@ needed (and resotre them to the original values)."
   "Call the COMMAND interactively.  Also handle mouse events (if possible.)
 The RECORD-FLAG and KEYS are sent to 
`ergoemacs-command-loop--grow-interactive'."
   (ergoemacs-command-loop--sync-point)
-  (setq ergoemacs-last-command-was-ergoemacs-ignore-p nil)
+  (setq ergoemacs-last-command-was-ergoemacs-ignore-p nil
+       this-command-keys-shift-translated (or 
ergoemacs-this-command-keys-shift-translated 
this-command-keys-shift-translated))
   (cond
    ((and (eventp last-command-event)
          (consp last-command-event)
@@ -1569,7 +1577,8 @@ The RECORD-FLAG and KEYS are sent to 
`ergoemacs-command-loop--grow-interactive'.
     (ergoemacs-specials
      (ergoemacs-command-loop--grow-interactive command record-flag keys)))
    (t
-    (ergoemacs-command-loop--grow-interactive command record-flag keys))))
+    (ergoemacs-command-loop--grow-interactive command record-flag keys)))
+  (setq ergoemacs-this-command-keys-shift-translated nil))
 
 
 (defun ergoemacs-command-loop-start ()
@@ -1822,7 +1831,8 @@ Emacs versions)."
                      "Key sequence %s aborted by %s"
                      (ergoemacs-key-description last-current-key)
                      (ergoemacs-key-description raw-key))
-                    (setq quit-flag t))
+                    (setq quit-flag t
+                         ergoemacs-this-command-keys-shift-translated nil))
                    ;; Handle local commands.
                    ((and (or modal-p
                              (not (equal current-key raw-key)))
@@ -2128,90 +2138,106 @@ pressed the translated key by changing
     ;; Make sure to lookup the keys in the selected buffer
     (ergoemacs-command-loop--sync-point)
     (let ((trials (ergoemacs-translate--trials key))
-          tmp tmp2 ret)
-      (catch 'found-command
-        (dolist (cur-key trials)
-          (when cur-key
-            (let* ((orig-key cur-key)
-                   (bind (key-binding orig-key t))
-                   (meta-key (ergoemacs-translate--meta-to-escape cur-key))
-                   (esc-key (ergoemacs-translate--escape-to-meta cur-key))
-                   (new-key (or meta-key esc-key))
-                   (new-binding (and new-key (key-binding new-key)))
-                   (global (and new-key
-                                (list (lookup-key ergoemacs-keymap orig-key t)
-                                      (lookup-key ergoemacs-keymap new-key 
t)))))
-              ;; Prefer non-global keys.
-             (when (eq bind 'undefined)
-               (setq bind nil))
-             (when (eq new-binding 'undefined)
-               (setq new-binding nil))
+        tmp tmp2 ret)
+      (setq this-command-keys-shift-translated nil)
+    (catch 'found-command
+      (dolist (cur-key trials)
+        (when cur-key
+          (let* ((orig-key cur-key)
+                 (bind (key-binding orig-key t))
+                 (meta-key (ergoemacs-translate--meta-to-escape cur-key))
+                 (esc-key (ergoemacs-translate--escape-to-meta cur-key))
+                 (new-key (or meta-key esc-key))
+                 (new-binding (and new-key (key-binding new-key)))
+                 (global (and new-key
+                              (list (lookup-key ergoemacs-keymap orig-key t)
+                                    (lookup-key ergoemacs-keymap new-key t)))))
+            ;; Prefer non-global keys.
+           (when (eq bind 'undefined)
+             (setq bind nil))
+           (when (eq new-binding 'undefined)
+             (setq new-binding nil))
+            (cond
+             ((not new-key)
+              (setq new-key orig-key))
+             ((not (memq bind global))
+              (setq new-key orig-key))
+             ((and new-binding (not (memq new-binding global)))
+              (setq bind new-binding)))
+            (unless bind
+              (cond
+               ((or (ergoemacs-keymapp (setq tmp (lookup-key input-decode-map 
orig-key)))
+                    (and (not (integerp tmp)) (commandp tmp)))
+                (setq bind tmp))
+               ((or (ergoemacs-keymapp (setq tmp (lookup-key 
local-function-key-map orig-key)))
+                    (and (not (integerp tmp)) (commandp tmp)))
+                (setq bind tmp))
+               ((or (ergoemacs-keymapp (setq tmp (lookup-key 
key-translation-map orig-key)))
+                    (and (not (integerp tmp)) (commandp tmp)))
+                (setq bind tmp))))
+            (when (and orig-key
+                       (setq ret bind
+                             ret (if (and (eq ret 'ergoemacs-map-undefined)
+                                          (equal orig-key (nth 0 trials))
+                                          (nth 1 trials)) nil ret)))
               (cond
-               ((not new-key)
-                (setq new-key orig-key))
-               ((not (memq bind global))
-                (setq new-key orig-key))
-               ((and new-binding (not (memq new-binding global)))
-                (setq bind new-binding)))
-              (unless bind
-                (cond
-                 ((or (ergoemacs-keymapp (setq tmp (lookup-key 
input-decode-map orig-key)))
-                      (and (not (integerp tmp)) (commandp tmp)))
-                  (setq bind tmp))
-                 ((or (ergoemacs-keymapp (setq tmp (lookup-key 
local-function-key-map orig-key)))
-                      (and (not (integerp tmp)) (commandp tmp)))
-                  (setq bind tmp))
-                 ((or (ergoemacs-keymapp (setq tmp (lookup-key 
key-translation-map orig-key)))
-                      (and (not (integerp tmp)) (commandp tmp)))
-                  (setq bind tmp))))
-              (when (and orig-key
-                         (setq ret bind
-                               ret (if (and (eq ret 'ergoemacs-map-undefined)
-                                            (equal orig-key (nth 0 trials))
-                                            (nth 1 trials)) nil ret)))
-                (cond
-                 ((equal orig-key (nth 0 trials))
-                  (setq ergoemacs-command-loop--single-command-keys new-key)
-                 ;; (message "History %s" (length 
ergoemacs-command-loop--history))
-                  (when (and (not (eq ergoemacs-handle-ctl-c-or-ctl-x 
'only-C-c-and-C-x))
-                            (ergoemacs-keymapp ret)
-                             (setq tmp (lookup-key ret [ergoemacs-timeout])))
-                    (cond
-                     ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
-                      (setq ret tmp))
-                    ((< 1  (length ergoemacs-command-loop--history)))
-                     ((not (region-active-p))) ;; its a key sequence.
-                     
-                     ;; Immediate
-                     ((and (not ergoemacs-ctl-c-or-ctl-x-delay)
-                          (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
-                      (setq ret tmp))
-                     
-                     (t ;; with delay
-                     (if ergoemacs-command-loop--decode-event-timeout-p
-                         (setq tmp2 nil
-                               ergoemacs-command-loop--decode-event-timeout-p 
nil))
-                      (setq tmp2 (with-timeout (ergoemacs-ctl-c-or-ctl-x-delay 
nil)
-                                   (ergoemacs-command-loop--read-event nil 
key)))
-                      (if (not tmp2)
-                          (setq ret tmp) ;; timeout, use copy/cut
-                        ;; Actual key
-                        (setq ret (ergoemacs-command-loop--key-lookup (vconcat 
key (vector tmp2))))))))
-                  (ergoemacs-command-loop--message-binding new-key ret))
-                 ((equal orig-key (nth 1 trials)) ;; `ergoemacs-mode' shift 
translation
-                  (setq ergoemacs-command-loop--single-command-keys (nth 0 
trials))
-                  
-                  ;; Shift+Control+c
-                  (when (and (ergoemacs-keymapp ret)
-                             (setq tmp (lookup-key ret [ergoemacs-timeout]))
-                             (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
+               ((equal orig-key (nth 0 trials))
+                (setq ergoemacs-command-loop--single-command-keys new-key)
+               ;; (message "History %s" (length 
ergoemacs-command-loop--history))
+                (when (and (not (eq ergoemacs-handle-ctl-c-or-ctl-x 
'only-C-c-and-C-x))
+                          (ergoemacs-keymapp ret)
+                           (setq tmp (lookup-key ret [ergoemacs-timeout])))
+                  (cond
+                   ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
                     (setq ret tmp))
-                  (ergoemacs-command-loop--message-binding new-key ret key))
-                 (t
-                  (ergoemacs-command-loop--message-binding new-key ret key)
-                  (setq ergoemacs-command-loop--single-command-keys new-key)))
-                (throw 'found-command ret))))))
-      ret)))
+                  ((< 1  (length ergoemacs-command-loop--history)))
+                   ((not (region-active-p))) ;; its a key sequence.
+                   
+                   ((and (or ergoemacs-this-command-keys-shift-translated 
this-command-keys-shift-translated)
+                         (eq ergoemacs-handle-ctl-c-or-ctl-x 'both)))
+
+                   ;; Immediate
+                   ((and (not ergoemacs-ctl-c-or-ctl-x-delay)
+                        (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
+                    (setq ret tmp))
+                   
+                   (t ;; with delay
+                   (if ergoemacs-command-loop--decode-event-timeout-p
+                       (setq tmp2 nil
+                             ergoemacs-command-loop--decode-event-timeout-p 
nil))
+                    (setq tmp2 (with-timeout (ergoemacs-ctl-c-or-ctl-x-delay 
nil)
+                                 (ergoemacs-command-loop--read-event nil key)))
+                    (if (not tmp2)
+                        (setq ret tmp) ;; timeout, use copy/cut
+                      ;; Actual key
+                      (setq ret (ergoemacs-command-loop--key-lookup (vconcat 
key (vector tmp2))))))))
+                (ergoemacs-command-loop--message-binding new-key ret))
+               ((equal orig-key (nth 1 trials)) ;; `ergoemacs-mode' shift 
translation
+                (setq this-command-keys-shift-translated t
+                      ergoemacs-command-loop--single-command-keys (nth 0 
trials))
+                
+                ;; Shift+Control+c
+                (when (and (ergoemacs-keymapp ret)
+                           (setq tmp (lookup-key ret [ergoemacs-timeout]))
+                           (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
+                  (setq ret tmp))
+                (ergoemacs-command-loop--message-binding new-key ret key))
+               (t
+                (ergoemacs-command-loop--message-binding new-key ret key)
+                (setq ergoemacs-command-loop--single-command-keys new-key)))
+              (throw 'found-command ret))))))
+    ret)))
+
+(defun ergoemacs-command-loop--execute-handle-shift-selection (function)
+  "Allow `ergoemacs-mode' command loop to handle shift selection.
+
+This will apply `handle-shift-selection' when FUNCTION is
+considered a shift-selection compatible function.
+
+This allows shift-selection of non-letter keys.
+For instance in QWERTY M-> is shift translated to M-."
+  (when (ergoemacs :movement-p function)
+    (handle-shift-selection)))
 
 (defun ergoemacs-command-loop--execute-rm-keyfreq (command)
   "Remove COMMAND from `keyfreq-mode' counts."
@@ -2271,6 +2297,7 @@ pressed the translated key by changing
          (ergoemacs-command-loop--execute-modify-command-list command)
           
           ;; Handle Shift Selection
+          (ergoemacs-command-loop--execute-handle-shift-selection this-command)
           (when keys
             (setq ergoemacs-command-loop--single-command-keys keys)
             
@@ -2289,7 +2316,24 @@ pressed the translated key by changing
             (setq ergoemacs-command-loop--single-command-keys nil)))))
     ;; (ergoemacs-command-loop--spinner-end)
     ))
-
+(defun ergoemacs-command-loop--shift-timeout ()
+  "This is the shift-timeout function for a key."
+  (interactive)
+  (let ((shift-trans (ergoemacs-translate--emacs-shift 
(this-single-command-keys))))
+    (if (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
+       (setq unread-command-events (append (ergoemacs-translate--emacs-shift 
shift-trans) '(ergoemacs-timeout)))
+      (setq ergoemacs-this-command-keys-shift-translated t)
+      (ergoemacs-command-loop--internal shift-trans))))
+
+(defun ergoemacs-command-loop--shift-translate ()
+  "Shift translation."
+  (interactive)
+  (let ((shift-trans (ergoemacs-translate--emacs-shift 
(this-single-command-keys) 'ergoemacs-shift)))
+    (message "%s->%s" (key-description (this-single-command-keys))
+            (key-description shift-trans))
+    (setq ergoemacs-this-command-keys-shift-translated t
+         this-command-keys-shift-translated t)
+    (ergoemacs-command-loop--call-interactively (key-binding shift-trans))))
 (provide 'ergoemacs-command-loop)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; ergoemacs-command-loop.el ends here
diff --git a/ergoemacs-component.el b/ergoemacs-component.el
index 25368d8..3740e57 100644
--- a/ergoemacs-component.el
+++ b/ergoemacs-component.el
@@ -461,6 +461,7 @@ Allows the component not to be calculated."
                (ergoemacs-gethash (nth 1 def) ergoemacs-translation-hash)))
       `(lambda(&optional arg)
          (interactive "P")
+        (setq ergoemacs-this-command-keys-shift-translated t)
          (ergoemacs-command-loop ,(nth 0 def) ',(nth 1 def))))
      ((ergoemacs-keymapp (ergoemacs-sv def))
       (ergoemacs-sv def))
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index f884116..001c343 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -994,6 +994,11 @@ Valid values are:
           (const :tag "No command loop support" nil))
   :group 'ergoemacs-comamnd-loop)
 
+(defcustom ergoemacs-command-loop-hide-shift-translations t
+  "Hide shift translations in the command loop help."
+  :type 'boolean
+  :group 'ergoemacs-command-loop)
+
 
 (defcustom ergoemacs-command-loop-echo-keystrokes 1
   "The amount of time before `ergoemacs-mode' displays keystrokes."
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index ff41141..e16c402 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -299,18 +299,14 @@
   (global-set-key (kbd "<S-down-mouse-1>") 'mouse-save-then-kill)
   (global-set-key (kbd "<S-mouse-1>") 'ignore)
   (global-set-key (kbd "C-+") 'text-scale-increase)
-  (global-set-key (kbd "C-=") 'text-scale-increase)
   (global-set-key (kbd "C--") 'text-scale-decrease)
-  (global-set-key (kbd "C-_") 'text-scale-decrease)
   (global-set-key (kbd "C-.") 'keyboard-quit)
-  (global-set-key (kbd "C->") 'keyboard-quit)
-  (global-set-key (kbd "C-") 'keyboard-quit)
   (global-set-key (kbd "C-/") 'info)
   (global-set-key (kbd "C-0") 'ergoemacs-text-scale-normal-size)
-  (global-set-key (kbd "C-)") 'ergoemacs-text-scale-normal-size)
   (global-set-key (kbd "C-<next>") 'ergoemacs-next-user-buffer)
   (global-set-key (kbd "C-<pause>") 'kill-compilation) ; stop 
compilation/find/grep
   (global-set-key (kbd "C-<prior>") 'ergoemacs-previous-user-buffer)
+  (global-set-key (kbd "C-=") 'text-scale-increase)
   (global-set-key (kbd "C-?") 'info)
   (global-set-key (kbd "C-S-<next>") 'ergoemacs-next-emacs-buffer)
   (global-set-key (kbd "C-S-<prior>") 'ergoemacs-previous-emacs-buffer)
@@ -323,7 +319,6 @@
   (global-set-key (kbd "C-S-w") 'delete-frame)
   
   (global-set-key (kbd "C-`") 'other-frame)
-  (global-set-key (kbd "C-~") 'other-frame)
   (global-set-key (kbd "C-a") 'mark-whole-buffer)
   (global-set-key (kbd "C-f") 'isearch-forward)
   (global-set-key (kbd "C-l") 'goto-line)
@@ -881,11 +876,9 @@
 
   (global-unset-key (kbd "C-x 1"))
   (global-set-key (kbd "M-3") 'delete-other-windows)
-  (global-set-key (kbd "M-#") 'delete-other-windows)
   
   (global-unset-key (kbd "C-x 0"))
   (global-set-key (kbd "M-2") 'delete-window)
-  (global-set-key (kbd "M-@") 'delete-window)
   
   (global-unset-key (kbd "C-x 3"))
   (global-set-key (kbd "M-4") '(split-window-below split-window-horizontally))
@@ -943,7 +936,6 @@
   "Text Transformation"
   (global-unset-key (kbd "M-;"))
   (global-set-key (kbd "M-'") '("M-;" :emacs))
-  (global-set-key (kbd "M-\"") '("M-;" :emacs))
   
   (global-set-key (kbd "M-w") 'ergoemacs-shrink-whitespaces)
 
diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el
index 015d3b9..a3b9f88 100644
--- a/ergoemacs-translate.el
+++ b/ergoemacs-translate.el
@@ -158,6 +158,9 @@ modifier occurred, such as in 
`ergoemacs-translate--meta-to-escape'.
 
 (defvar ergoemacs-translate--define-key-if-defined-p t
   "Define a key if even if it is already defined in the keymap.")
+(defvar ergoemacs-translate--define-key-replacement-function nil
+  "When non-nil, use the replacement function for defining a key.")
+
 
 (defun ergoemacs-translate--meta-to-escape (key-seq)
   "Escapes a KEY-SEQ M-q becomes ESC q.
@@ -229,6 +232,24 @@ If no changes are performed, return nil."
         (setq ret new-key))
       ret)))
 
+(defun ergoemacs-translate--ergoemacs-shift-select (key)
+  "Translate KEY to allow `ergoemacs-mode' shift translation.
+
+This will shift translate Alt+# to Alt+3."
+  (let (modifiers basic)
+    (when (and (vectorp key)
+               ;; only makes sense for single key combinations.
+               (= (length key) 1)
+               ;; Doesn't make sense if shifted...
+               (not (or (memq 'shift (setq modifiers 
(ergoemacs-translate--event-modifiers (aref key 0))))
+                        (memq 'ergoemacs-shift modifiers)))
+              ;; Only define if emacs doesn't handle shift selection.
+              (not (eq (event-convert-list (list 'shift (setq basic 
(event-basic-type (aref key 0)))))
+                       (ergoemacs-translate--event-convert-list (list 
'ergoemacs-shift basic)))))
+      (setq ergoemacs-translate--define-key-if-defined-p nil
+            ergoemacs-translate--define-key-replacement-function 
'ergoemacs-command-loop--shift-translate)
+      (vector (ergoemacs-translate--event-convert-list (append modifiers (list 
'ergoemacs-shift basic)))))))
+
 (defun ergoemacs-translate--ergoemacs-timeout (key)
   "Translates KEY to allow Shift translation to default to key sequence.
 
@@ -244,7 +265,8 @@ seleceted (instead of copying the text)."
               (not (or (memq 'shift (setq modifiers 
(ergoemacs-translate--event-modifiers (aref key 0))))
                        (memq 'ergoemacs-shift modifiers))))
       (setq basic (ergoemacs-translate--event-basic-type (aref key 0))
-           ergoemacs-translate--define-key-if-defined-p nil)
+           ergoemacs-translate--define-key-if-defined-p nil
+            ergoemacs-translate--define-key-replacement-function 
'ergoemacs-command-loop--shift-timeout)
       (vector (ergoemacs-translate--event-convert-list (append modifiers (list 
'shift basic)))))))
 
 (defun ergoemacs-translate--to-string (key)
@@ -266,7 +288,8 @@ If no chanegs are performed, return nil."
     ergoemacs-translate--swap-menu
     ergoemacs-translate--to-string
     ergoemacs-translate--to-vector
-    ergoemacs-translate--ergoemacs-timeout)
+    ergoemacs-translate--ergoemacs-timeout
+    ergoemacs-translate--ergoemacs-shift-select)
   "Functions to apply to key.
 
 These functions take a key as an argument and translate it in
@@ -282,7 +305,8 @@ variants are created using 
`ergoemacs-translate--apply-funs'."
     (dolist (fn ergoemacs-translate--apply-funs)
       (when (setq test-key (funcall fn key))
         (apply function test-key args)
-       (setq ergoemacs-translate--define-key-if-defined-p t)))))
+       (setq ergoemacs-translate--define-key-if-defined-p t
+             ergoemacs-translate--define-key-replacement-function nil)))))
 
 
 
@@ -302,7 +326,7 @@ This uses `ergoemacs-translate--apply-key'"
        key (lambda(new-key)
             (when (or ergoemacs-translate--define-key-if-defined-p
                       (not (lookup-key keymap new-key)))
-              (define-key keymap new-key def))))
+              (define-key keymap new-key (or 
ergoemacs-translate--define-key-replacement-function def)))))
     (setq ergoemacs-define-key-after-p nil)))
 
 (defun ergoemacs-translate--event-modifier-hash (&optional layout)



reply via email to

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