[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 63/77: Teach easy-kill-activate-keymap to handle command remappin
From: |
Leo Liu |
Subject: |
[elpa] 63/77: Teach easy-kill-activate-keymap to handle command remapping |
Date: |
Sat, 05 Apr 2014 04:08:25 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 9ddf0b1bda35eac2c6f5732451688f0fdb528cd6
Author: Leo Liu <address@hidden>
Date: Tue Oct 29 15:34:35 2013 +0800
Teach easy-kill-activate-keymap to handle command remapping
Change key binding to easy-kill-mark-region back to C-SPC.
---
README.rst | 2 +-
easy-kill.el | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/README.rst b/README.rst
index c8bc9c7..d953a13 100644
--- a/README.rst
+++ b/README.rst
@@ -29,7 +29,7 @@ active:
#. address@hidden -> append selection to previous kill
#. ``C-w`` -> kill selection
#. ``+``, ``-`` and ``0..9`` -> expand/shrink selection
-#. ``SPC`` -> turn selection into an active region
+#. ``C-SPC`` -> turn selection into an active region
#. ``C-g`` -> abort
Any other keys exit the temporary keymap and automatically save
diff --git a/easy-kill.el b/easy-kill.el
index 1d736ad..69448d9 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -99,9 +99,9 @@ CHAR is used immediately following `easy-kill' to select
THING."
(define-key map "+" 'easy-kill-expand)
(define-key map "=" 'easy-kill-expand)
(define-key map "@" 'easy-kill-append)
- (define-key map " " 'easy-kill-mark-region)
- (define-key map "\C-w" 'easy-kill-region)
- (define-key map "\C-g" 'easy-kill-abort)
+ (define-key map [remap set-mark-command] 'easy-kill-mark-region)
+ (define-key map [remap kill-region] 'easy-kill-region)
+ (define-key map [remap keyboard-quit] 'easy-kill-abort)
(mapc (lambda (d)
(define-key map (number-to-string d) 'easy-kill-digit-argument))
(number-sequence 0 9))
@@ -345,7 +345,9 @@ candidate property instead."
(with-demoted-errors
(or (and (not (and (symbolp this-command)
(get this-command 'easy-kill-exit)))
- (eq this-command (lookup-key map
(this-command-keys-vector))))
+ (or (eq this-command (lookup-key map
(this-single-command-keys)))
+ (let ((cmd (key-binding (this-single-command-keys) nil
t)))
+ (command-remapping cmd nil (list map)))))
(ignore
(easy-kill-destroy-candidate)
(unless (or easy-kill-mark
@@ -363,7 +365,7 @@ Temporally activate additional key bindings as follows:
+,=/- => expand or shrink selection;
@ => append selection to previous kill;
C-w => kill selection;
- SPC => turn selection into an active region;
+ C-SPC => turn selection into an active region;
C-g => abort;
others => save selection and exit."
(interactive "p")
- [elpa] 49/77: Work with `sexp' and `list' in nxml mode, (continued)
- [elpa] 49/77: Work with `sexp' and `list' in nxml mode, Leo Liu, 2014/04/05
- [elpa] 52/77: Use filter-buffer-substring, Leo Liu, 2014/04/05
- [elpa] 51/77: Fix quoting error in face definitions, Leo Liu, 2014/04/05
- [elpa] 50/77: Fix last change to easy-kill-backward-up, Leo Liu, 2014/04/05
- [elpa] 55/77: Fix easy-kill-backward-down to handle prefix chars, Leo Liu, 2014/04/05
- [elpa] 48/77: Make command easy-kill-append work for easy-mark, Leo Liu, 2014/04/05
- [elpa] 57/77: Fix to always display the string candidate, Leo Liu, 2014/04/05
- [elpa] 58/77: Emacs 24.x compatibility, Leo Liu, 2014/04/05
- [elpa] 53/77: Destroy after-string before goto-char in easy-kill-abort, Leo Liu, 2014/04/05
- [elpa] 54/77: Better control of message emission in an easy-kill session, Leo Liu, 2014/04/05
- [elpa] 63/77: Teach easy-kill-activate-keymap to handle command remapping,
Leo Liu <=
- [elpa] 59/77: Doc fix, Leo Liu, 2014/04/05
- [elpa] 64/77: Teach easy-kill to handle rectangle-mark from Emacs trunk, Leo Liu, 2014/04/05
- [elpa] 56/77: Doc fix and release v0.9.0, Leo Liu, 2014/04/05
- [elpa] 61/77: Optimise easy-kill-thing-forward when n is 0, Leo Liu, 2014/04/05
- [elpa] 62/77: Small tweak to easy-kill-on-nxml-element, Leo Liu, 2014/04/05
- [elpa] 60/77: Make easy-kill-on-buffer-file-name do nothing in easy-mark, Leo Liu, 2014/04/05
- [elpa] 68/77: Fix easy-kill-append to update clipboard, Leo Liu, 2014/04/05
- [elpa] 65/77: Fix #8: Don't strip trailing blank chars, Leo Liu, 2014/04/05
- [elpa] 67/77: New handler for defun-name and bind it to `D', Leo Liu, 2014/04/05
- [elpa] 66/77: Fix #9: Work around fixed bug in thingatpt.el, Leo Liu, 2014/04/05