[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 01197b3 13/87: Add undefined handling
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 01197b3 13/87: Add undefined handling |
Date: |
Wed, 14 Apr 2021 18:46:58 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 01197b35314f99f6a83edc7e3928262526e15080
Author: Fidler <matthew.fidler@gmail.com>
Commit: Fidler <matthew.fidler@gmail.com>
Add undefined handling
---
ergoemacs-advice.el | 32 +++++++++++++++++++-------------
ergoemacs-command-loop.el | 3 +--
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/ergoemacs-advice.el b/ergoemacs-advice.el
index de3453c..d935fef 100644
--- a/ergoemacs-advice.el
+++ b/ergoemacs-advice.el
@@ -320,24 +320,30 @@ command selected, instead of rerunning `smex' and
:type :before
(setq ergoemacs-command-loop--single-command-keys nil))
+(defun ergoemacs-mode--undefined-advice ()
+ "Advice for undefined."
+ (let ((keys (this-single-command-keys)))
+ (if (member (substring keys -1) '([apps] [menu]))
+ (progn
+ (setq ergoemacs-command-loop--eat nil)
+ (ergoemacs-command-loop keys))
+ (ding)
+ (ergoemacs-command-loop--temp-message "%s is undefined!"
+ (ergoemacs-key-description
(this-single-command-keys)))
+ (setq defining-kbd-macro nil)
+ (force-mode-line-update)
+ ;; If this is a down-mouse event, don't reset prefix-arg;
+ ;; pass it to the command run by the up event.
+ (setq prefix-arg
+ (when (memq 'down (event-modifiers last-command-event))
+ current-prefix-arg)))))
+
(ergoemacs-advice undefined ()
"Allow `ergoemacs-mode' to display keys, and intercept ending <apps> keys."
:type :around
(if (not ergoemacs-mode)
ad-do-it
- (let ((keys (this-single-command-keys)))
- (if (member (substring keys -1) '([apps] [menu]))
- (ergoemacs-command-loop keys)
- (ding)
- (ergoemacs-command-loop--temp-message "%s is undefined!"
- (ergoemacs-key-description
(this-single-command-keys)))
- (setq defining-kbd-macro nil)
- (force-mode-line-update)
- ;; If this is a down-mouse event, don't reset prefix-arg;
- ;; pass it to the command run by the up event.
- (setq prefix-arg
- (when (memq 'down (event-modifiers last-command-event))
- current-prefix-arg))))))
+ (ergoemacs-mode--undefined-advice)))
(provide 'ergoemacs-advice)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index 68f797c..47ea3e6 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -1174,7 +1174,7 @@ is the :full command loop."
(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 ()
"Start ergoemacs command loop.
@@ -1828,7 +1828,6 @@ Emacs versions)."
(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
- [elpa] externals/ergoemacs-mode f10eecc 01/87: Fix overriding keymap. Needs to be expanded., (continued)
- [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, 2021/04/14
- [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 <=
- [elpa] externals/ergoemacs-mode 4a8de51 19/87: The image is created for the current theme., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 176af55 10/87: Take out message, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 6051ab5 25/87: Remove unicode fonts setup. Refix Issue #408, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 87fe85a 36/87: No longer try to ensure undo-tree and persistent-soft are installed, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode b4b5241 30/87: Add back ergoemacs-style shift-translation, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 1421a65 06/87: Change how key prefixes are handled., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 59235bb 12/87: Allow ergoemacs-mode to handle ending <apps> keys, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 27c6245 05/87: Remove helm-do-grep. Its no longer found in helm, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode b70d9fe 43/87: Fix back quote., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode d5d2ba4 39/87: Create extras directory. See Issue #452, Stefan Monnier, 2021/04/14