[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 06/16: New command easy-kill-exchange-point-and-mark
From: |
Leo Liu |
Subject: |
[elpa] 06/16: New command easy-kill-exchange-point-and-mark |
Date: |
Tue, 22 Apr 2014 00:33:38 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit beb4fd57c0a91e9dd1f9cb5845a3bd7bcf2ec901
Author: Leo Liu <address@hidden>
Date: Wed Apr 16 10:25:47 2014 +0800
New command easy-kill-exchange-point-and-mark
---
README.rst | 1 +
easy-kill.el | 16 ++++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/README.rst b/README.rst
index c1153b9..b221e97 100644
--- a/README.rst
+++ b/README.rst
@@ -92,6 +92,7 @@ NEWS
#. Key ``?`` in ``easy-kill`` or ``easy-mark`` prints help info.
#. ``M-w l`` can select the enclosing string.
+#. ``easy-mark`` learns exchanging point & mark.
0.9.2
+++++
diff --git a/easy-kill.el b/easy-kill.el
index 9397aca..9189a3d 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -117,6 +117,8 @@ deprecated."
(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)
+ (define-key map [remap exchange-point-and-mark]
+ 'easy-kill-exchange-point-and-mark)
(mapc (lambda (d)
(define-key map (number-to-string d) 'easy-kill-digit-argument))
(number-sequence 0 9))
@@ -477,10 +479,20 @@ on the parent mode. Finally `easy-kill-on-list' is
checked."
(`(,_x . ,_x)
(easy-kill-echo "Empty region"))
(`(,beg . ,end)
- (set-mark beg)
- (goto-char end)
+ (pcase (if (eq (easy-kill-get mark) 'end)
+ (list end beg) (list beg end))
+ (`(,m ,pt)
+ (set-mark m)
+ (goto-char pt)))
(activate-mark))))
+(defun easy-kill-exchange-point-and-mark ()
+ (interactive)
+ (exchange-point-and-mark)
+ (setf (easy-kill-get mark)
+ (if (eq (point) (easy-kill-get start))
+ 'end 'start)))
+
(put 'easy-kill-append 'easy-kill-exit t)
(defun easy-kill-append ()
(interactive)
- [elpa] branch master updated (a1fe7f0 -> 6e73bbb), Leo Liu, 2014/04/21
- [elpa] 01/16: New command easy-kill-help, Leo Liu, 2014/04/21
- [elpa] 02/16: Teach easy-kill-help to handle old format of easy-kill-alist, Leo Liu, 2014/04/21
- [elpa] 05/16: Stricter check on bounds of list in strings, Leo Liu, 2014/04/21
- [elpa] 06/16: New command easy-kill-exchange-point-and-mark,
Leo Liu <=
- [elpa] 03/16: For #14: Treat strings like lists, Leo Liu, 2014/04/21
- [elpa] 07/16: Fix #15: Make `M-w l' in strings save to clipboard, Leo Liu, 2014/04/21
- [elpa] 04/16: Improve last change for easy-kill-thing-forward, Leo Liu, 2014/04/21
- [elpa] 09/16: Make digit key 0 shrink selection to its initial size, Leo Liu, 2014/04/21
- [elpa] 14/16: Fix easy-kill-org-up-element, Leo Liu, 2014/04/21
- [elpa] 08/16: Add wrappers for thingatpt.el for better code organisation, Leo Liu, 2014/04/21
- [elpa] 16/16: Merge branch 'master' of https://github.com/leoliu/easy-kill, Leo Liu, 2014/04/21
- [elpa] 13/16: Some tests and bug fixes for org, Leo Liu, 2014/04/21
- [elpa] 12/16: Localize two global states using overlay properties, Leo Liu, 2014/04/21
- [elpa] 11/16: Add tests and enable travis-ci, Leo Liu, 2014/04/21