[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 27f60cc 11/87: Will eat commands for sel
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 27f60cc 11/87: Will eat commands for self insert like <apps> e t |
Date: |
Wed, 14 Apr 2021 18:46:58 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 27f60ccaa87f6e34db0e4e7e305216b04d7cca4c
Author: Fidler <matthew.fidler@gmail.com>
Commit: Fidler <matthew.fidler@gmail.com>
Will eat commands for self insert like <apps> e t
---
ergoemacs-command-loop.el | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index ebd4219..68f797c 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -1141,6 +1141,7 @@ is the :full command loop."
(setq ergoemacs-command-loop--prefix-timer nil)))
(defvar ergoemacs-command-loop--eat nil)
+(defvar ergoemacs-command-loop--eat-unread nil)
(defun ergoemacs-command-loop--start-for-prefix ()
"Start the ergoemacs command loop for the currently running prefix key."
(when (and (not (ergoemacs :modal-p))
@@ -1149,20 +1150,30 @@ is the :full command loop."
(not (ergoemacs-command-loop-p)))
(setq ergoemacs-command-loop-start t
ergoemacs-command-loop--single-command-keys (this-single-command-keys)
- ergoemacs-command-loop--eat
ergoemacs-command-loop--single-command-keys)
+ ergoemacs-command-loop--eat
ergoemacs-command-loop--single-command-keys
+ ergoemacs-command-loop--eat-unread nil)
+ (ergoemacs-command-loop--stop-prefix-timer)
(ergoemacs-command-loop ergoemacs-command-loop--single-command-keys)))
(defun ergoemacs-command-loop--eat ()
"Eat the key sequence calling the prefix start."
(when ergoemacs-command-loop--eat
- (let ((map (make-keymap)))
- (define-key map ergoemacs-command-loop--eat '(lambda () (interactive)
(setq overriding-terminal-local-map nil)))
+ (let ((map (make-keymap))
+ (fn '(lambda ()
+ (interactive)
+ (setq overriding-terminal-local-map nil
+ unread-command-events ergoemacs-command-loop--eat-unread
+ ergoemacs-command-loop--eat-unread nil)
+ (ergoemacs-command-loop--prefix-timer))))
+ (define-key map ergoemacs-command-loop--eat fn)
+ (define-key map [eroemacs-eat] fn)
+ (define-key map (vconcat ergoemacs-command-loop--eat [eroemacs-eat]) fn)
(setq overriding-terminal-local-map map
- ergoemacs-command-loop--eat nil))))
+ ergoemacs-command-loop--eat nil
+ unread-command-events (list 'ergoemacs-eat)))))
(add-hook 'ergoemacs-mode-startup-hook #'ergoemacs-command-loop--prefix-timer)
(add-hook 'ergoemacs-mode-shutdown-hook
#'ergoemacs-command-loop--stop-prefix-timer)
-(add-hook 'post-command-hook #'ergoemacs-command-loop--eat)
(defun ergoemacs-command-loop--start-with-pre-command-hook ()
@@ -1474,9 +1485,9 @@ The RECORD-FLAG and KEYS are sent to
`ergoemacs--real-call-interactively'.
This will grow `max-lisp-eval-depth' and `max-specpdl-size' if
needed (and resotre them to the original values)."
(setq ergoemacs-command-loop--grow-command nil
- ergoemacs-command-loop--grow-record nil
- ergoemacs-command-loop--grow-keys nil
- ergoemacs-command-loop--grow-special nil)
+ ergoemacs-command-loop--grow-record nil
+ ergoemacs-command-loop--grow-keys nil
+ ergoemacs-command-loop--grow-special nil)
(if (memq command ergoemacs-command-loop-dont-grow-commands)
(call-interactively command record-flag keys)
(let ((grow-max-lisp-p t)
@@ -1643,7 +1654,7 @@ Used to replace:
Currently these are all vectors and all ingore prefix arguments.
They don't exactly behave like their Emacs equivalents."
- (or (and ergoemacs-mode ergoemacs-command-loop--single-command-keys)
+ (or (and ergoemacs-mode `ergoemacs-command-loop--single-command-keys)
(funcall ergoemacs-command-loop--this-command-keys)))
(defvar ergoemacs-command-loop--timer nil
@@ -1814,7 +1825,10 @@ Emacs versions)."
(ergoemacs-command-loop--call-interactively this-command)
(setq command this-command
this-command tmp))
-
+ (when (and ergoemacs-command-loop--eat
unread-command-events)
+ (setq ergoemacs-command-loop--eat-unread
unread-command-events
+ unread-command-events nil))
+ (ergoemacs-command-loop--eat)
;; If the command changed anything, fix it here.
(unless (equal type ergoemacs-command-loop--current-type)
(setq type ergoemacs-command-loop--current-type
@@ -1825,7 +1839,6 @@ Emacs versions)."
universal ergoemacs-command-loop--universal
ergoemacs-command-loop--single-command-keys nil
continue-read (not ergoemacs-command-loop--exit)))
-
;; Handle any keys that are bound in some translatable way.
((setq command (ergoemacs-command-loop--key-lookup
current-key))
;; Setup external indicators of how the loop currently
behaves.
- [elpa] externals/ergoemacs-mode updated (5450f4d -> f9d6e3f), Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 7ba903e4 04/87: Don't grow mouse commands & set this-command before command is called, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode bcaf49b 03/87: Don't allow infinite recursion on mapkeymap., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode f12edbb 02/87: Maybe Fix issue #426, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode f10eecc 01/87: Fix overriding keymap. Needs to be expanded., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 27f60cc 11/87: Will eat commands for self insert like <apps> e t,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode b3df015 17/87: Make sure changing local variables doesn't affect save state, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode a1dd7a7 09/87: Eat command prefixes that were intercepted by the timer, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode f7a68f6 29/87: Add back Ctrl+Shift+c and Ctrl+Shift+x., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 59cb758 08/87: Change to an idle timer for more stability, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 07ef724 22/87: Change ergoemacs-override-keymap key bindings., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode a75a338 07/87: Add ergoemacs start prefix correctly, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode f3dd332 23/87: Revert set-map-list, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 98703c4 27/87: Add Swiper keys. Issue #445, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 01197b3 13/87: Add undefined handling, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 4a8de51 19/87: The image is created for the current theme., Stefan Monnier, 2021/04/14