[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 05/77: Call interprogram-cut-function in easy-kill-forward
From: |
Leo Liu |
Subject: |
[elpa] 05/77: Call interprogram-cut-function in easy-kill-forward |
Date: |
Sat, 05 Apr 2014 04:08:10 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit dae04fe6028196bb91b216b6a321d8a31549fcb3
Author: Leo Liu <address@hidden>
Date: Sun Oct 6 11:49:15 2013 +0800
Call interprogram-cut-function in easy-kill-forward
---
easy-kill.el | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index dfd1456..a4922c2 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -61,6 +61,13 @@
(buffer-substring (overlay-start easy-kill-candidate)
(overlay-end easy-kill-candidate)))))
+(defun easy-kill-select-text ()
+ "Make current kill candidate available to other programs."
+ (let ((candidate (easy-kill-candidate)))
+ (and candidate
+ interprogram-cut-function
+ (funcall interprogram-cut-function candidate))))
+
(defun easy-kill-map ()
(let ((map (make-sparse-keymap)))
(define-key map "-" 'easy-kill-backward)
@@ -91,6 +98,7 @@
(return))))
(when (/= end (point))
(move-overlay easy-kill-candidate start (point))
+ (easy-kill-select-text)
t)))))
(defun easy-kill-backward (n)
@@ -112,9 +120,7 @@
(overlay-put easy-kill-candidate 'thing thing)
(easy-kill-forward (1- n))
t))))))
- ;; Immediately put it in clipboard for other applications.
- (and interprogram-cut-function
- (funcall interprogram-cut-function (or (easy-kill-candidate) "")))
+ (easy-kill-select-text)
t))
(defun easy-kill-select (n)
- [elpa] branch master updated (769f2f2 -> 0a73626), Leo Liu, 2014/04/05
- [elpa] 03/77: Fix error: wrong-type-argument number-or-marker-p nil, Leo Liu, 2014/04/05
- [elpa] 02/77: Fix error when interprogram-cut-function unset, Leo Liu, 2014/04/05
- [elpa] 05/77: Call interprogram-cut-function in easy-kill-forward,
Leo Liu <=
- [elpa] 01/77: Initial commit, Leo Liu, 2014/04/05
- [elpa] 07/77: Rename easy-kill-forward/backward to easy-kill-enlarge/shrink, Leo Liu, 2014/04/05
- [elpa] 08/77: Give overlay by easy-kill-candidate higher priority, Leo Liu, 2014/04/05
- [elpa] 06/77: Various bug fixes and improvements, Leo Liu, 2014/04/05
- [elpa] 09/77: Restore the ability to inspect char properties for URLs, Leo Liu, 2014/04/05
- [elpa] 04/77: Use overlay for storing kill candidate and change +/-, Leo Liu, 2014/04/05
- [elpa] 11/77: Minor tweaks to easy-kill-on-url, Leo Liu, 2014/04/05
- [elpa] 12/77: Tweak the definition of thing `region', Leo Liu, 2014/04/05
- [elpa] 13/77: New command easy-kill-region to kill current selection, Leo Liu, 2014/04/05
- [elpa] 10/77: New function easy-kill-adjust-candidate and doc fix, Leo Liu, 2014/04/05