[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode d5d7e5b 26/87: Partial fix for C-c and C
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode d5d7e5b 26/87: Partial fix for C-c and C-x. See Issue #444 |
Date: |
Wed, 14 Apr 2021 18:47:01 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit d5d7e5b6a5537cdcfcc79efd43bbde138fc7863c
Author: Fidler <matthew.fidler@gmail.com>
Commit: Fidler <matthew.fidler@gmail.com>
Partial fix for C-c and C-x. See Issue #444
---
ergoemacs-command-loop.el | 51 +++++++++++++++++++++++++++++++++++++++--------
1 file changed, 43 insertions(+), 8 deletions(-)
diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index 85e485c..a8ba7d8 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -785,18 +785,53 @@ KEYS is the keys information"
(defvar ergoemacs-command--blink-on nil)
(defvar ergoemacs-orig-echo-keystrokes nil)
+(defvar ergoemacs-command--timeout-timer nil)
+(defvar ergoemacs-command--timeout-keys nil)
+
+(defun ergoemacs-command--timer-timeout ()
+ "Send the [ergoemacs-timeout] event (after timeout)."
+ (let ((keys (this-single-command-keys)))
+ (when ergoemacs-command--timeout-timer
+ (cancel-timer ergoemacs-command--timeout-timer)
+ (setq ergoemacs-command--timeout-timer nil)
+ (when (equal keys ergoemacs-command--timeout-keys)
+ (push 'ergoemacs-timeout unread-command-events))
+ (setq ergoemacs-command--timeout-keys nil))))
+
(defun ergoemacs-command--echo-prefix ()
"Echos prefix keys in the ergoemacs-mode way."
- (let ((keys (this-single-command-keys)))
+ (let ((keys (this-single-command-keys))
+ ret timeout)
+ (when (and ergoemacs-command--timeout-timer
+ (not (equal keys ergoemacs-command--timeout-keys)))
+ (cancel-timer ergoemacs-command--timeout-timer)
+ (setq ergoemacs-command--timeout-keys nil
+ ergoemacs-command--timeout-timer nil))
(unless (or (equal [] keys)
(ergoemacs-command-loop-p))
- (when (ergoemacs-keymapp (key-binding keys))
- (ergoemacs-command-loop--message
- "%s" (ergoemacs-command-loop--key-msg
- (setq ergoemacs-command--blink-on (not
ergoemacs-command--blink-on))
- nil nil
- (this-single-command-keys)
- nil nil nil))))))
+ (when (ergoemacs-keymapp (setq ret (key-binding keys)))
+ (when (setq timeout (key-binding (vconcat keys [ergoemacs-timeout])))
+ (cond
+ ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
+ (push 'ergoemacs-timeout unread-command-events))
+ ((not (region-active-p))) ;; active
+ ((and this-command-keys-shift-translated
+ (eq ergoemacs-handle-ctl-c-or-ctl-x 'both)))
+ ((and (not ergoemacs-ctl-c-or-ctl-x-delay) ;; Immediate
+ (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
+ (push 'ergoemacs-timeout unread-command-events))
+ (t
+ (setq ergoemacs-command--timeout-keys keys
+ ergoemacs-command--timeout-timer
+ (run-at-time t ergoemacs-ctl-c-or-ctl-x-delay
#'ergoemacs-command--timer-timeout)))
+ ))
+ (unless unread-command-events
+ (ergoemacs-command-loop--message
+ "%s" (ergoemacs-command-loop--key-msg
+ (setq ergoemacs-command--blink-on (not
ergoemacs-command--blink-on))
+ nil nil
+ (this-single-command-keys)
+ nil nil nil)))))))
(defun ergoemacs-command--echo-timer ()
"Echo the keystrokes in the `ergoemacs-mode' way."
- [elpa] externals/ergoemacs-mode fad3ed1 56/87: Fixed not removing visible selection when ergoemacs-keep-region-after-copy is set to true., (continued)
- [elpa] externals/ergoemacs-mode fad3ed1 56/87: Fixed not removing visible selection when ergoemacs-keep-region-after-copy is set to true., Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode d51ae7e 35/87: Merge remote-tracking branch 'origin/master', Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 4769abe 61/87: Update Mac instructions to swap Command and Alt, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 981ffb3 21/87: Fix Issue #437, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 730306e 66/87: Merge pull request #495 from wlandry/mac_meta_alt_switch, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 4710b5f 14/87: Fix eating of the variable, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode daec6a1 38/87: May Fix Issue #453, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 7b06006 44/87: Merge pull request #465 from MicroAnibal/FixLayoutsTypo, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 3e6fea9 41/87: Possibly fix #453, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 6231ee0 47/87: Merge pull request #468 from m00natic/emacs26-fixes, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode d5d7e5b 26/87: Partial fix for C-c and C-x. See Issue #444,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode 7d36565 53/87: Merge pull request #481 from TinaRussell/exclude-more-hooks, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 4e188fd 46/87: Escape quotes on use as characters in, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 131b3fb 62/87: Fix command-loop errors, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 2091646 65/87: Merge pull request #497 from wlandry/space_in_filenames, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode dc2f666 54/87: Add info on how to get system-wide Ergoemacs bindings in macOS, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 4a6ba06 55/87: Merge pull request #488 from marlonrichert/macos, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode aa649b2 52/87: Add hooks to ergoemacs-map-properties--modify-run-mode-hooks-excluded, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode ade132c 67/87: Remap ergoemacs-paste to calc-yank in calc-mode, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 26c2150 68/87: Merge pull request #498 from wlandry/calc_yank, Stefan Monnier, 2021/04/14
- [elpa] externals/ergoemacs-mode 8b437ad 70/87: Merge pull request #500 from wlandry/term_fixes, Stefan Monnier, 2021/04/14