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

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

[elpa] 21/287: Remove unused ergoemacs-define-key


From: Matthew Fidler
Subject: [elpa] 21/287: Remove unused ergoemacs-define-key
Date: Wed, 02 Jul 2014 14:44:16 +0000

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

commit e6773460ffc69b1d28840d8822769dd10cecfad5
Author: Matthew L. Fidler <address@hidden>
Date:   Thu May 29 09:18:32 2014 -0500

    Remove unused ergoemacs-define-key
---
 ergoemacs-shortcuts.el |  103 ------------------------------------------------
 1 files changed, 0 insertions(+), 103 deletions(-)

diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index 5931e04..e7f4602 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -1371,110 +1371,7 @@ argument prompt.
           ergoemacs-mark-active nil))
   (setq ergoemacs-describe-key nil))
 
-(defun ergoemacs-define-key (keymap key def)
-  "Defines KEY in KEYMAP to be DEF.
-Similar to `define-key'.
 
-DEF can be:
-1. A function; If globally defined, this is defined by
-   `ergoemacs-shortcut-remap'
-2. A list of functions
-3. A keymap
-4. A kbd-code that this shortcuts to with `ergoemacs-read'
-
-"
-  (cond
-   ((eq 'cons (type-of def))
-    (let (found)
-      (if (condition-case err
-              (stringp (nth 0 def))
-            (error nil))
-          (if (and (boundp 'setup-ergoemacs-keymap) setup-ergoemacs-keymap)
-              (progn
-                (puthash (read-kbd-macro (key-description key) t)
-                         `(,(nth 0 def) ,(nth 1 def))
-                         ergoemacs-command-shortcuts-hash)
-                (define-key ergoemacs-shortcut-keymap key
-                  'ergoemacs-shortcut))
-            (unless (lookup-key keymap key)
-              (cond
-               ((condition-case err
-                    (interactive-form (nth 0 def))
-                  (error nil))
-                (define-key keymap key
-                  `(lambda(&optional arg)
-                     (interactive "P")
-                     (setq this-command last-command) ; Don't record this 
command.
-                     ;; (setq prefix-arg current-prefix-arg)
-                     (ergoemacs-shortcut-remap ,(nth 0 def)))))
-               (t
-                (define-key keymap key
-                `(lambda(&optional arg)
-                   (interactive "P")
-                   (setq this-command last-command) ; Don't record this 
command.
-                   ;; (setq prefix-arg current-prefix-arg)
-                   (ergoemacs-read-key ,(nth 0 def) ',(nth 1 def))))))))
-        (mapc
-         (lambda(new-def)
-           (unless found
-             (when (condition-case err
-                       (interactive-form new-def)
-                     (error nil))
-               (setq found
-                     (ergoemacs-define-key keymap key new-def)))))
-         def))
-      found))
-   ((condition-case err
-        (interactive-form def)
-      (error nil))
-    (cond
-     ;; only setup on `ergoemacs-shortcut-keymap' when setting up
-     ;; ergoemacs default keymap.
-     ((and (boundp 'setup-ergoemacs-keymap) setup-ergoemacs-keymap
-           (memq def '(ergoemacs-ctl-c ergoemacs-ctl-x)))
-      (define-key ergoemacs-shortcut-keymap key def))
-     ((and (not (string-match "\\(mouse\\|wheel\\)" (key-description key)))
-           (boundp 'setup-ergoemacs-keymap) setup-ergoemacs-keymap
-           (ergoemacs-shortcut-function-binding def))
-      (puthash (read-kbd-macro (key-description key) t)
-               (list def 'global) ergoemacs-command-shortcuts-hash)
-      (if (ergoemacs-is-movement-command-p def)
-          (if (let (case-fold-search) (string-match "\\(S-\\|[A-Z]$\\)" 
(key-description key)))
-              (define-key ergoemacs-shortcut-keymap key 
'ergoemacs-shortcut-movement-no-shift-select)
-            (define-key ergoemacs-shortcut-keymap key 
'ergoemacs-shortcut-movement))
-        (define-key ergoemacs-shortcut-keymap key 'ergoemacs-shortcut)))     
-     ((or (and (boundp 'setup-ergoemacs-keymap) setup-ergoemacs-keymap)
-          (not (lookup-key keymap key)))
-      (define-key keymap key def)))
-    t)
-   ((condition-case err
-        (keymapp (symbol-value def))
-      (error nil))
-    (define-key keymap key (symbol-value def))
-    t)
-   ((condition-case err
-        (stringp def)
-      (error nil))
-    (if (and (boundp 'setup-ergoemacs-keymap) setup-ergoemacs-keymap)
-        (progn
-          (puthash (read-kbd-macro (key-description key) t)
-                   `(,def nil)
-                   ergoemacs-command-shortcuts-hash)
-          (if (ergoemacs-is-movement-command-p def)
-              (if (let (case-fold-search) (string-match "\\(S-\\|[A-Z]$\\)" 
(key-description key)))
-                  (define-key ergoemacs-shortcut-keymap key 
'ergoemacs-shortcut-movement-no-shift-select)
-                (define-key ergoemacs-shortcut-keymap key 
'ergoemacs-shortcut-movement))
-            (define-key ergoemacs-shortcut-keymap key 'ergoemacs-shortcut)))
-      (unless (lookup-key keymap key)
-        (define-key keymap key
-          `(lambda(&optional arg)
-             (interactive "P")
-             (setq this-command last-command) ; Don't record this command.
-             ;; (setq prefix-arg current-prefix-arg)
-             (ergoemacs-read-key ,def)))))
-    
-    t)
-   (t nil)))
 
 (defvar ergoemacs-ignored-prefixes '(;; "C-h" "<f1>"
                                      "C-x" "C-c" "ESC" "<escape>"))



reply via email to

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