[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 84/287: Break-out sending unread-command events
From: |
Matthew Fidler |
Subject: |
[elpa] 84/287: Break-out sending unread-command events |
Date: |
Wed, 02 Jul 2014 14:44:50 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 28b006b00e9745fa57c593e2b0c7e39b58e825a5
Author: Matthew L. Fidler <address@hidden>
Date: Fri Jun 13 07:43:06 2014 -0500
Break-out sending unread-command events
---
ergoemacs-shortcuts.el | 51 ++++++++++++++++++++---------------------------
1 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index 930d109..346ee03 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -762,7 +762,7 @@ If universal is returned, and type first-type is bound, set
these
to the appropriate values for `ergoemacs-read-key'.
"
(let (ret tmp)
- (when (condition-case err (keymapp fn) nil)
+ (when (ignore-errors (keymapp fn))
;; If keymap, continue.
(setq ret 'keymap))
(when (memq fn ergoemacs-universal-fns)
@@ -787,6 +787,25 @@ to the appropriate values for `ergoemacs-read-key'.
command
pretty-key-undefined)))))
+(defun ergoemacs-read-key--send-unread (unread-vector lookup use-overrride)
+ "Send `unread-command-events' inside `ergoemacs-read-key-lookup'"
+ (setq ergoemacs-mark-active
+ (or (and mark-active transient-mark-mode) mark-active))
+ (setq ergoemacs-single-command-keys unread-vector)
+ (setq last-input-event unread-vector)
+ (setq prefix-arg current-prefix-arg)
+ (setq unread-command-events (append (listify-key-sequence unread-vector)
unread-command-events))
+ (ergoemacs-defer-post-command-hook)
+ (reset-this-command-lengths)
+ (ergoemacs-read-key--echo-command
+ pretty-key (ergoemacs-pretty-key (key-description unread-vector)))
+ (when lookup
+ (define-key lookup [ergoemacs-single-command-keys] 'ignore)
+ (if (not use-override)
+ (setq ergoemacs-read-key-overriding-overlay-save tmp-overlay)
+ (setq ergoemacs-read-key-overriding-terminal-local-save
overriding-terminal-local-map)
+ (setq overriding-terminal-local-map lookup))))
+
(defun ergoemacs-read-key-lookup (prior-key prior-pretty-key key pretty-key
force-key)
"Lookup KEY and run if necessary.
@@ -892,20 +911,7 @@ FORCE-KEY forces keys like <escape> to work properly.
(setq ergoemacs-single-command-keys nil)
(setq ret 'translate-fn))
((vectorp tmp)
- (setq ergoemacs-mark-active
- (or (and mark-active transient-mark-mode) mark-active))
- (setq ergoemacs-single-command-keys tmp)
- (setq last-input-event tmp)
- (setq prefix-arg current-prefix-arg)
- (setq unread-command-events (append (listify-key-sequence
tmp) unread-command-events))
- (ergoemacs-defer-post-command-hook)
- (reset-this-command-lengths)
- (ergoemacs-read-key--echo-command
- pretty-key (ergoemacs-pretty-key (key-description tmp)))
- (when lookup
- (define-key lookup [ergoemacs-single-command-keys] 'ignore)
- (setq ergoemacs-read-key-overriding-terminal-local-save
overriding-terminal-local-map)
- (setq overriding-terminal-local-map lookup))
+ (ergoemacs-read-key--send-unread tmp lookup use-override)
(setq ret 'translate))))
;; Is there an local override function?
((progn
@@ -972,20 +978,7 @@ FORCE-KEY forces keys like <escape> to work properly.
;; thinks it is in a minibuffer, so the recursive
;; minibuffer error is raised unless these are put
;; into unread-command-events.
- (setq ergoemacs-mark-active
- (or (and mark-active transient-mark-mode)
mark-active))
- (setq ergoemacs-single-command-keys key)
- (setq prefix-arg current-prefix-arg)
- (setq unread-command-events
- (append (listify-key-sequence key)
unread-command-events))
- (ergoemacs-defer-post-command-hook)
- (reset-this-command-lengths)
- (when lookup
- (define-key lookup [ergoemacs-single-command-keys]
'ignore)
- (if (not use-override)
- (setq ergoemacs-read-key-overriding-overlay-save
tmp-overlay)
- (setq
ergoemacs-read-key-overriding-terminal-local-save overriding-terminal-local-map)
- (setq overriding-terminal-local-map lookup)))
+ (ergoemacs-read-key--send-unread key lookup use-override)
(setq ret 'shortcut-workaround))
(t
(setq fn (or (command-remapping fn (point)) fn))
- [elpa] 74/287: Fix <apps> e t bug with object interface., (continued)
- [elpa] 74/287: Fix <apps> e t bug with object interface., Matthew Fidler, 2014/07/02
- [elpa] 75/287: Only put in shortcut-hash if not removed from keymap., Matthew Fidler, 2014/07/02
- [elpa] 68/287: Make the caching more robust, Matthew Fidler, 2014/07/02
- [elpa] 72/287: Fix copy objects to allow keymap versions., Matthew Fidler, 2014/07/02
- [elpa] 79/287: Fix final map to be a composed keymap that works with ergoemacs-rm-key, Matthew Fidler, 2014/07/02
- [elpa] 76/287: Only Issue 86 still persists., Matthew Fidler, 2014/07/02
- [elpa] 77/287: Ensure ergoemacs-global-override-rm-keys is a list of vectors, Matthew Fidler, 2014/07/02
- [elpa] 80/287: Reverse order to allow <apps> h z processing., Matthew Fidler, 2014/07/02
- [elpa] 82/287: Ignored keys shouldn't be in the shortcut hash, Matthew Fidler, 2014/07/02
- [elpa] 83/287: Allow ergoemacs-rm-key to remove a list, Matthew Fidler, 2014/07/02
- [elpa] 84/287: Break-out sending unread-command events,
Matthew Fidler <=
- [elpa] 85/287: Keep track of shortcut key prefixes, Matthew Fidler, 2014/07/02
- [elpa] 81/287: Added version menu back, Matthew Fidler, 2014/07/02
- [elpa] 87/287: Remove "Z" in theme component, Matthew Fidler, 2014/07/02
- [elpa] 144/287: Generate image based on options, Matthew Fidler, 2014/07/02
- [elpa] 86/287: Always suppress shortcuts in read-key-lookup, Matthew Fidler, 2014/07/02
- [elpa] 88/287: Apply defered variables/modes. Fix Issue #216, Matthew Fidler, 2014/07/02
- [elpa] 147/287: Allow emacs23 to fail., Matthew Fidler, 2014/07/02
- [elpa] 78/287: Faster ignore globally defined key, Matthew Fidler, 2014/07/02
- [elpa] 149/287: Backport `make-composed-keymap'., Matthew Fidler, 2014/07/02
- [elpa] 148/287: Fix more compiler issues and typos, Matthew Fidler, 2014/07/02