[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 30ed202 012/325: Remove cttl-x-c 'both'
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 30ed202 012/325: Remove cttl-x-c 'both' option |
Date: |
Sat, 23 Oct 2021 18:48:11 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 30ed2020e3f770e237aaa2562b210517c8d3a38b
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>
Remove cttl-x-c 'both' option
It uses a timer to choose which one
---
ergoemacs-command-loop.el | 28 ++++++++++++----------------
ergoemacs-functions.el | 12 ++----------
ergoemacs-lib.el | 4 ++--
ergoemacs-test.el | 10 ++++------
ergoemacs-theme-engine.el | 11 +----------
5 files changed, 21 insertions(+), 44 deletions(-)
diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index 8628dbb..cf2358a 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -189,7 +189,6 @@ ignore the post-command hooks.")
(defvar ergoemacs-command-loop-type)
(defvar ergoemacs-keymap)
(defvar ergoemacs-handle-ctl-c-or-ctl-x)
-(defvar ergoemacs-ctl-c-or-ctl-x-delay)
(defun ergoemacs-command-loop--modal-show ()
@@ -663,11 +662,11 @@ inconjunction with `input-method-function' to translate
keys if
(ergoemacs-keymapp test-ret))
;; The translation needs more keys...
(if timeout-key
- (setq next-key (with-timeout (ergoemacs-ctl-c-or-ctl-x-delay
- (progn
- (setq
ergoemacs-command-loop--decode-event-timeout-p t)
- nil))
- (ergoemacs-command-loop--history nil
ergoemacs-command-loop--decode-event-delay current-key)))
+ (setq next-key (ergoemacs-command-loop--history
+ nil
+ ergoemacs-command-loop--decode-event-delay
+ current-key)
+ )
(setq next-key (ergoemacs-command-loop--history nil
ergoemacs-command-loop--decode-event-delay current-key)))
(when next-key ;; Since a key was read, save it to be read later.
(push last-command-event new-ergoemacs-input))
@@ -822,14 +821,13 @@ KEYS is the keys information"
(push 'ergoemacs-timeout unread-command-events))
((not (region-active-p))) ;; active
((and (or ergoemacs-this-command-keys-shift-translated
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))
+ (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)))
+ ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
(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)))))
+ (ergoemacs-command--timer-timeout)))))
(unless unread-command-events
(ergoemacs-command-loop--message
"%s" (ergoemacs-command-loop--key-msg
@@ -2194,19 +2192,17 @@ pressed the translated key by changing
((not (region-active-p))) ;; its a key sequence.
((and (or ergoemacs-this-command-keys-shift-translated
this-command-keys-shift-translated)
- (eq ergoemacs-handle-ctl-c-or-ctl-x 'both)))
+ (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)))
;; Immediate
- ((and (not ergoemacs-ctl-c-or-ctl-x-delay)
- (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
+ ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
(setq ret tmp))
(t ;; with delay
(if ergoemacs-command-loop--decode-event-timeout-p
(setq tmp2 nil
ergoemacs-command-loop--decode-event-timeout-p
nil))
- (setq tmp2 (with-timeout (ergoemacs-ctl-c-or-ctl-x-delay
nil)
- (ergoemacs-command-loop--read-event nil key)))
+ (setq tmp2 (ergoemacs-command-loop--read-event nil key))
(if (not tmp2)
(setq ret tmp) ;; timeout, use copy/cut
;; Actual key
@@ -2219,7 +2215,7 @@ pressed the translated key by changing
;; Shift+Control+c
(when (and (ergoemacs-keymapp ret)
(setq tmp (lookup-key ret [ergoemacs-timeout]))
- (eq ergoemacs-handle-ctl-c-or-ctl-x 'both))
+ (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut))
(setq ret tmp))
(ergoemacs-command-loop--message-binding new-key ret key))
(t
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 74b23f1..cad8069 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -102,19 +102,11 @@
'(delete-backward-char delete-char kill-word backward-kill-word)
"Defines deletion functions that ergoemacs is aware of.")
-(defcustom ergoemacs-ctl-c-or-ctl-x-delay 0.2
- "Delay before sending Cut or Copy.
-This is applied when using Ctrl+c and Ctrl+x."
- :type '(choice (number :tag "Inhibit delay")
- (const :tag "No delay" nil))
- :group 'ergoemacs-mode)
-
-(defcustom ergoemacs-handle-ctl-c-or-ctl-x 'both
+(defcustom ergoemacs-handle-ctl-c-or-ctl-x 'only-C-c-and-C-x
"Type of Copy and Paste handling for `ergoemacs-mode'."
:type '(choice
(const :tag "C-c/C-x only copy/cut" only-copy-cut)
- (const :tag "C-c/C-x only Emacs C-c and C-x" only-C-c-and-C-x)
- (const :tag "C-c/C-x copy/paste when region active, Emacs C-c/C-x
otherwise." both))
+ (const :tag "C-c/C-x only Emacs C-c and C-x" only-C-c-and-C-x))
:group 'ergoemacs-mode)
(defvar ergoemacs-revert-buffer 0)
diff --git a/ergoemacs-lib.el b/ergoemacs-lib.el
index 8cd92a6..845533d 100644
--- a/ergoemacs-lib.el
+++ b/ergoemacs-lib.el
@@ -435,9 +435,9 @@ All other modes are assumed to be minor modes or
unimportant.
"Figures out ergoemacs-mode menu's preferred key-binding for CMD."
(cond
((not cmd))
- ((and (memq ergoemacs-handle-ctl-c-or-ctl-x '(only-copy-cut both))
+ ((and (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
(eq cmd 'ergoemacs-cut-line-or-region))
(ergoemacs-key-description--menu (kbd "C-x")) )
- ((and (memq ergoemacs-handle-ctl-c-or-ctl-x '(only-copy-cut both))
+ ((and (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
(eq cmd 'ergoemacs-copy-line-or-region))
(ergoemacs-key-description--menu (kbd "C-c")))
(t
;;; FIXME: faster startup by creating component alists
diff --git a/ergoemacs-test.el b/ergoemacs-test.el
index 168694d..dfdffef 100644
--- a/ergoemacs-test.el
+++ b/ergoemacs-test.el
@@ -379,7 +379,7 @@ Tests issue #347"
"Issue #184; Not replace the \"selected all\" by paste."
:tags '(:copy :interactive)
(let ((ret t)
- (ergoemacs-handle-ctl-c-or-ctl-x 'both))
+ (ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut))
(ergoemacs-test-layout
:macro "C-v"
(save-excursion
@@ -406,7 +406,7 @@ Tests issue #347"
Selected mark would not be cleared after paste."
:tags '(:copy)
(ergoemacs-test-layout
- (let ((ergoemacs-handle-ctl-c-or-ctl-x 'both))
+ (let ((ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut))
(save-excursion
(switch-to-buffer (get-buffer-create "*ergoemacs-test*"))
(delete-region (point-min) (point-max))
@@ -449,8 +449,7 @@ not using cua or cutting line. I think kill-region is what
is meant."
:tags '(:copy :interactive)
(ergoemacs-test-layout
(let ((ret t)
- (ergoemacs-ctl-c-or-ctl-x-delay 0.1)
- (ergoemacs-handle-ctl-c-or-ctl-x 'both))
+ (ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut))
(save-excursion
(switch-to-buffer (get-buffer-create "*ergoemacs-test*"))
(delete-region (point-min) (point-max))
@@ -467,8 +466,7 @@ not using cua or cutting line. I think kill-region is what
is meant."
"Attempts to test Issue #130 -- Copy"
:tags '(:copy :interactive)
(ergoemacs-test-layout
- (let ((ergoemacs-ctl-c-or-ctl-x-delay 0.1)
- (ergoemacs-handle-ctl-c-or-ctl-x 'both)
+ (let ((ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)
(txt "Text\n123"))
(with-temp-buffer
(switch-to-buffer (get-buffer-create "*ergoemacs-test*"))
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 60ef0d8..48b24c1 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -377,16 +377,7 @@ When AT-END is non-nil, append a $ to the regular
expression."
(interactive)
(ergoemacs-save 'ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut))
:button (:radio . (eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut)))
- (c-c-c-x-both
- menu-item "Ctrl+C and Ctrl+X are both Emacs Commands & Copy/Cut"
- (lambda()
- (interactive)
- (ergoemacs-save 'ergoemacs-handle-ctl-c-or-ctl-x 'both))
- :button (:radio . (eq ergoemacs-handle-ctl-c-or-ctl-x 'both)))
- (c-c-c-x-timeout
- menu-item "Customize Ctrl+C and Ctrl+X Cut/Copy Timeout"
- (lambda() (interactive)
- (ergoemacs-save 'ergoemacs-ctl-c-or-ctl-x-delay)))))
+ ))
(c-v
menu-item "Paste behavior"
(keymap
- [elpa] externals/ergoemacs-mode updated (f9d6e3f -> 5692fc1), Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 34c2099 016/325: Remove ergoemacs-autoload, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d30b431 003/325: Remove shift translation, instead directly binding those keys, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f2caedb 032/325: Remove dead code, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 149c900 037/325: Remove ergoemacs-command-loop--modal-pop, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 8e17210 044/325: Remove ergoemacs-modal-ignored-keymap, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 3e25eac 043/325: Remove unused modal customizations, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 34daf02 062/325: Do not autoload ergoemacs-debug, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode de74f45 002/325: Remove some Control key bindings, so nano works, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 72a812c 025/325: Remove dead code, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 30ed202 012/325: Remove cttl-x-c 'both' option,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode b0c649d 052/325: Cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 1203d93 059/325: Remove dead code, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 4996d2c 066/325: Remove the apply-inits function, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 37d642e 092/325: Remove the optional off stuff and lots of helm stuff., Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d6926f0 095/325: Simplify menus, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d3a7657 116/325: Make 306 work and clean up lots of tests., Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 5a1ec10 111/325: Fix some warnings, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode bb77fa2 131/325: Replace ergoemacs-print-buffer-confirm with pr-interface everywhere, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 4f43e90 001/325: Add a whole bunch of keybindings, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f58f7d8 008/325: Replace all cl with cl-lib, Stefan Monnier, 2021/10/23