[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 96/287: Fix shortcut keys again.
From: |
Matthew Fidler |
Subject: |
[elpa] 96/287: Fix shortcut keys again. |
Date: |
Wed, 02 Jul 2014 14:44:57 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 7af6867e9984c7d0161dca54729006bb780c785c
Author: Matthew L. Fidler <address@hidden>
Date: Mon Jun 16 09:16:05 2014 -0500
Fix shortcut keys again.
---
ergoemacs-modal.el | 1 -
ergoemacs-mode.el | 29 ++---------------------------
ergoemacs-shortcuts.el | 41 +++++++++++++----------------------------
3 files changed, 15 insertions(+), 56 deletions(-)
diff --git a/ergoemacs-modal.el b/ergoemacs-modal.el
index 4a65f4c..065bdb7 100644
--- a/ergoemacs-modal.el
+++ b/ergoemacs-modal.el
@@ -201,7 +201,6 @@ modal state is currently enabled."
(defun ergoemacs-minibuffer-setup ()
"Exit temporary overlay maps."
- ;; (setq ergoemacs-shortcut-keys t)
)
(defun ergoemacs-modal-p ()
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 5e93d47..1464a00 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -635,30 +635,6 @@ However instead of using M-a `eval-buffer', you could use
M-a `eb'"
(when ergoemacs-use-aliases
(ergoemacs-load-aliases))
-(defun ergoemacs-vars-sync ()
- "Sync variables.
-`ergoemacs-mode' `ergoemacs-shortcut-keys', `ergoemacs-read-input-keys'
-`ergoemacs-unbind-keys'."
- (if (assq 'ergoemacs-mode minor-mode-map-alist)
- (when (or ergoemacs-mode ergoemacs-shortcut-keys
- ergoemacs-unbind-keys
- ergoemacs-save-variables)
- (unless ergoemacs-mode
- (setq ergoemacs-mode t)
- (ergoemacs-debug "WARNING: ergoemacs-mode was turned off; Turning
on."))
- (unless ergoemacs-unbind-keys
- (setq ergoemacs-unbind-keys t)
- (ergoemacs-debug "WARNING: ergoemacs-unbind-keys was turned off;
Turning on.")))
- (when ergoemacs-mode
- (setq ergoemacs-mode nil)
- (ergoemacs-debug "WARNING: ergoemacs-mode was turned on; Turning off."))
- (unless ergoemacs-unbind-keys
- (setq ergoemacs-unbind-keys nil)
- (ergoemacs-debug "WARNING: ergoemacs-unbind-keys was turned on; Turning
off."))
- (unless ergoemacs-shortcut-keys
- (setq ergoemacs-shortcut-keys nil)
- (ergoemacs-debug "WARNING: ergoemacs-shortcut-keys was turned on;
Turning off."))))
-
(defun ergoemacs-shuffle-keys (&optional force-update)
"Shuffle ergoemacs keymaps in `minor-mode-map-alist'."
(when (or force-update (not (eq (car (nth 0 minor-mode-map-alist))
'ergoemacs-mode)))
@@ -753,7 +729,6 @@ These hooks are deferred to make sure `this-command' is set
appropriately.")
(condition-case err
(progn
(ergoemacs-restore-post-command-hook)
- (ergoemacs-vars-sync)
(when (and ergoemacs-repeat-keys
(keymapp ergoemacs-repeat-keymap)
(not (lookup-key ergoemacs-repeat-keymap
(this-single-command-keys))))
@@ -812,10 +787,10 @@ These hooks are deferred to make sure `this-command' is
set appropriately.")
(condition-case err
(progn
(when ergoemacs-mode
+ (setq ergoemacs-shortcut-keys t)
(ergoemacs-shuffle-keys)
(when (not unread-command-events)
- (ergoemacs-install-shortcuts-up)
- (ergoemacs-vars-sync)))
+ (ergoemacs-install-shortcuts-up)))
(when (not ergoemacs-mode)
(ergoemacs-remove-shortcuts)))
(error (message "Error %s" err))))
diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index 41d6f60..dafee9a 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -65,7 +65,8 @@ major-mode, minor-mode, and global keys are ignored."
(minor-mode-map-alist
`((ergoemacs-mode ,@ergoemacs-keymap)
(ergoemacs-unbind-keys ,@ergoemacs-unbind-keymap)))
- (ergoemacs-emulation-mode-map-alist
+ (ergoemacs-emulation-mode-map-alist '())
+ (ergoemacs-shortcut-emulation-mode-map-alist
`((ergoemacs-shortcut-keys ,@ergoemacs-shortcut-keymap)))
(old-global-map (current-global-map))
(old-local-map (current-local-map))
@@ -932,33 +933,17 @@ FORCE-KEY forces keys like <escape> to work properly.
(setq ret (ergoemacs-read-key-lookup-get-ret fn))
(or ret (commandp fn t)))
(unless ret
- (cond
- ((and ergoemacs-shortcut-keys (not ergoemacs-describe-key)
- (not ergoemacs-single-command-keys))
- (if (nth 0 hash)
- (progn
- (setq fn (nth 0 hash)))
- (setq fn (key-binding key))
- (setq fn (or (command-remapping fn (point)) fn)))
- (ergoemacs-read-key--echo-command pretty-key fn)
- ;; There is some issue with these keys. Read-key
- ;; thinks it is in a minibuffer, so the recursive
- ;; minibuffer error is raised unless these are put
- ;; into unread-command-events.
- (ergoemacs-read-key--send-unread key lookup use-override)
- (setq ret 'shortcut-workaround))
- (t
- (setq fn (or (command-remapping fn (point)) fn))
- (when (memq fn ergoemacs-universal-fns)
- (setq ret (ergoemacs-read-key-lookup-get-ret---universal
fn)))
- (unless ret
- (setq ergoemacs-single-command-keys key)
- (ergoemacs-read-key--echo-command
- pretty-key (or (and (symbolp fn) (symbol-name fn))
- (ergoemacs-unicode-char "λ" "lambda")))
- (ergoemacs-read-key-call fn nil key)
- (setq ergoemacs-single-command-keys nil)
- (setq ret 'function))))))
+ (setq fn (or (command-remapping fn (point)) fn))
+ (when (memq fn ergoemacs-universal-fns)
+ (setq ret (ergoemacs-read-key-lookup-get-ret---universal
fn)))
+ (unless ret
+ (setq ergoemacs-single-command-keys key)
+ (ergoemacs-read-key--echo-command
+ pretty-key (or (and (symbolp fn) (symbol-name fn))
+ (ergoemacs-unicode-char "λ" "lambda")))
+ (ergoemacs-read-key-call fn nil key)
+ (setq ergoemacs-single-command-keys nil)
+ (setq ret 'function))))
;; Does this call an override or major/minor mode function?
((progn
(setq fn (or
- [elpa] 187/287: Change to eieio-named, (continued)
- [elpa] 187/287: Change to eieio-named, Matthew Fidler, 2014/07/02
- [elpa] 98/287: Modified ergoemacs-init not to depend on anything..., Matthew Fidler, 2014/07/02
- [elpa] 137/287: Get old-style fixed & variable layouts, Matthew Fidler, 2014/07/02
- [elpa] 143/287: Make test dir the same as work dir, Matthew Fidler, 2014/07/02
- [elpa] 196/287: Clean up open last closed buffer. (Issue #237), Matthew Fidler, 2014/07/02
- [elpa] 100/287: Reduce Readme.md and add build status, Matthew Fidler, 2014/07/02
- [elpa] 94/287: Fixed shortcut keys., Matthew Fidler, 2014/07/02
- [elpa] 127/287: Update documentation again., Matthew Fidler, 2014/07/02
- [elpa] 203/287: Fix the C-e test, Matthew Fidler, 2014/07/02
- [elpa] 198/287: More flexible redo, Issue #239, Matthew Fidler, 2014/07/02
- [elpa] 96/287: Fix shortcut keys again.,
Matthew Fidler <=
- [elpa] 199/287: Update ergoemacs-test-layout so it wont parse the function, Matthew Fidler, 2014/07/02
- [elpa] 135/287: Fix defcustom, Matthew Fidler, 2014/07/02
- [elpa] 104/287: Fix many compiler warnings with ergoemacs-advices.el, Matthew Fidler, 2014/07/02
- [elpa] 97/287: First attempt for Cask without Cask (I'm on windows), Matthew Fidler, 2014/07/02
- [elpa] 116/287: Take out compiler warnings from ergoemacs-shortcuts.el, Matthew Fidler, 2014/07/02
- [elpa] 89/287: Fix most keybinding issues, Matthew Fidler, 2014/07/02
- [elpa] 113/287: No more warnings for ergoemacs-modal.el; mapc->dolist, Matthew Fidler, 2014/07/02
- [elpa] 132/287: Be more careful when redefining maps., Matthew Fidler, 2014/07/02
- [elpa] 129/287: Fix compiler warnings for ergoemacs-unbind.el, Matthew Fidler, 2014/07/02
- [elpa] 140/287: Fix Byte Compile Warnings, Matthew Fidler, 2014/07/02