[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 33/77: Support append kill for append-next-kill and easy-kill
From: |
Leo Liu |
Subject: |
[elpa] 33/77: Support append kill for append-next-kill and easy-kill |
Date: |
Sat, 05 Apr 2014 04:08:17 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit e38ebd0fb63110a65e826f4c835a130e464a96e2
Author: Leo Liu <address@hidden>
Date: Thu Oct 10 17:30:29 2013 +0800
Support append kill for append-next-kill and easy-kill
---
easy-kill.el | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 7674150..87e323a 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -51,6 +51,7 @@ CHAR is used immediately following `easy-kill' to select
THING."
(define-key map "-" 'easy-kill-shrink)
(define-key map "+" 'easy-kill-expand)
(define-key map "=" 'easy-kill-expand)
+ (define-key map "!" 'easy-kill-append)
(define-key map "\C-w" 'easy-kill-region)
(define-key map (kbd "C-SPC") 'easy-kill-mark-region)
(define-key map (kbd "C-@") 'easy-kill-mark-region)
@@ -202,6 +203,16 @@ candidate property instead."
(goto-char end)
(activate-mark)))))
+(defvar easy-kill-append nil)
+
+(defun easy-kill-append ()
+ (interactive)
+ (if (not easy-kill-candidate)
+ (push last-input-event unread-command-events)
+ (setq easy-kill-append t)
+ (setq easy-kill-exit t)
+ (overlay-put easy-kill-candidate 'face nil)))
+
(defun easy-kill-activate-keymap ()
(let ((map (easy-kill-map)))
(set-temporary-overlay-map
@@ -219,7 +230,11 @@ candidate property instead."
(let ((interprogram-cut-function nil)
(interprogram-paste-function nil))
(unless (string= (easy-kill-candidate) "")
- (kill-new (easy-kill-candidate))))
+ (kill-new (if easy-kill-append
+ (concat (car kill-ring) "\n"
+ (easy-kill-candidate))
+ (easy-kill-candidate))
+ easy-kill-append)))
(delete-overlay easy-kill-candidate)
(setq easy-kill-candidate nil)
nil)))))))
@@ -238,6 +253,7 @@ Temporally activate additional key bindings as follows:
(interactive "p")
(if (use-region-p)
(kill-ring-save (region-beginning) (region-end))
+ (setq easy-kill-append (eq last-command 'kill-region))
(setq easy-kill-candidate
(let ((o (make-overlay (point) (point))))
(overlay-put o 'face 'easy-kill-face)
@@ -245,7 +261,6 @@ Temporally activate additional key bindings as follows:
;; `hl-line-mode'.
(overlay-put o 'priority 999)
o))
- (setq deactivate-mark t)
(dolist (thing '(url email line))
(easy-kill-thing thing n 'nomsg)
(or (string= (easy-kill-candidate) "")
- [elpa] 21/77: New command easy-kill-mark-region, (continued)
- [elpa] 21/77: New command easy-kill-mark-region, Leo Liu, 2014/04/05
- [elpa] 24/77: Improve list expand/shrink support in smie-based modes, Leo Liu, 2014/04/05
- [elpa] 18/77: Consolidate all kill features in easy-kill-thing, Leo Liu, 2014/04/05
- [elpa] 26/77: Fix #2: just call kill-ring-save when region is active, Leo Liu, 2014/04/05
- [elpa] 27/77: Declare dependency on emacs 24, Leo Liu, 2014/04/05
- [elpa] 29/77: Merge pull request #4 from purcell/patch-1, Leo Liu, 2014/04/05
- [elpa] 31/77: Simplify the interactive form of easy-kill-thing, Leo Liu, 2014/04/05
- [elpa] 28/77: [remap kill-ring-save] should be a better key binding for this feature., Leo Liu, 2014/04/05
- [elpa] 35/77: Doc fix and release v0.8.0, Leo Liu, 2014/04/05
- [elpa] 36/77: New variable easy-kill-base-map for customising key bindings, Leo Liu, 2014/04/05
- [elpa] 33/77: Support append kill for append-next-kill and easy-kill,
Leo Liu <=
- [elpa] 34/77: Better support for defining commands that exit easy-kill, Leo Liu, 2014/04/05
- [elpa] 30/77: Merge pull request #6 from knu/usage-remap, Leo Liu, 2014/04/05
- [elpa] 32/77: Improve easy-kill-bounds-of-list, Leo Liu, 2014/04/05
- [elpa] 37/77: Make easy-kill-backward-up work better when in strings, Leo Liu, 2014/04/05
- [elpa] 38/77: Fix #3: Add command easy-mark for marking, Leo Liu, 2014/04/05
- [elpa] 39/77: Fix doc and buglets in last change, Leo Liu, 2014/04/05
- [elpa] 40/77: Some improvements based on comments in #3, Leo Liu, 2014/04/05
- [elpa] 42/77: Must reference the actual object in easy-kill-candidate, Leo Liu, 2014/04/05
- [elpa] 43/77: Add new command easy-mark-sexp, Leo Liu, 2014/04/05
- [elpa] 41/77: Tell easy-kill-append to deactivate-mark, Leo Liu, 2014/04/05