[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 16/77: Make function easy-kill-candidate always return string
From: |
Leo Liu |
Subject: |
[elpa] 16/77: Make function easy-kill-candidate always return string |
Date: |
Sat, 05 Apr 2014 04:08:13 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 61b2befdd4faf857a8c61d2c076a22d337014e3a
Author: Leo Liu <address@hidden>
Date: Tue Oct 8 10:11:13 2013 +0800
Make function easy-kill-candidate always return string
---
easy-kill.el | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 1571ff1..d259e3c 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -74,7 +74,7 @@ CHAR is used immediately following `easy-kill' to select
THING."
(if (string-match "[ \t\f\r\n]*\\'" s)
(substring s 0 (match-beginning 0))
(error "`string-match' failed in `easy-kill-strip-trailing'")))
- (t s)))
+ (t "")))
(defvar easy-kill-exit nil
"Tell `set-temporary-overlay-map' to exit if non-nil.")
@@ -106,6 +106,7 @@ candidate property instead."
(easy-kill-message-nolog "%s" beg))
(move-overlay o (or beg (overlay-start o)) (or end (overlay-end 0)))))
(and interprogram-cut-function
+ (not (string= (easy-kill-candidate) ""))
(funcall interprogram-cut-function (easy-kill-candidate))))
(defun easy-kill-enlarge (n)
@@ -145,7 +146,7 @@ candidate property instead."
(defun easy-kill-region ()
"Kill current selection and exit."
- (interactive)
+ (interactive "*")
(let ((beg (overlay-start easy-kill-candidate))
(end (overlay-end easy-kill-candidate)))
(if (= beg end)
@@ -188,10 +189,9 @@ candidate property instead."
;; intercept pasting from other programs and
;; `easy-kill-adjust-candidate' already did the work.
(let ((interprogram-cut-function nil)
- (interprogram-paste-function nil)
- (candidate (easy-kill-candidate)))
- (unless(member candidate '(nil ""))
- (kill-new candidate)))
+ (interprogram-paste-function nil))
+ (unless (string= (easy-kill-candidate) "")
+ (kill-new (easy-kill-candidate))))
(delete-overlay easy-kill-candidate)
(setq easy-kill-candidate nil)
nil)))))))
@@ -217,8 +217,8 @@ Temporally activate additional key bindings as follows:
(setq deactivate-mark t)
(dolist (thing '(region url email line))
(easy-kill-thing thing n)
- (when (overlay-get easy-kill-candidate 'thing)
- (return)))
+ (or (string= (easy-kill-candidate) "")
+ (return)))
(when (zerop (buffer-size))
(easy-kill-message-nolog "Warn: `easy-kill' activated in empty buffer"))
(easy-kill-activate-keymap))
- [elpa] 01/77: Initial commit, (continued)
- [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
- [elpa] 16/77: Make function easy-kill-candidate always return string,
Leo Liu <=
- [elpa] 17/77: Fix error: (args-out-of-range 1009 1035), Leo Liu, 2014/04/05
- [elpa] 15/77: Some string and comment fixes, Leo Liu, 2014/04/05
- [elpa] 23/77: Use parse-partial-sexp in easy-kill-bounds-of-list, Leo Liu, 2014/04/05
- [elpa] 20/77: Replace `enlarge' with `expand' in strings and comments, Leo Liu, 2014/04/05
- [elpa] 19/77: Add lispy treatment for +/- on list and sexp, Leo Liu, 2014/04/05
- [elpa] 14/77: Doc fix and release v0.7.0, Leo Liu, 2014/04/05
- [elpa] 22/77: Handle the case when overlay has already been destroyed, Leo Liu, 2014/04/05
- [elpa] 25/77: Fix thinko in easy-kill-backward-down, Leo Liu, 2014/04/05
- [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