[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 65/77: Fix #8: Don't strip trailing blank chars
From: |
Leo Liu |
Subject: |
[elpa] 65/77: Fix #8: Don't strip trailing blank chars |
Date: |
Sat, 05 Apr 2014 04:08:26 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit c97d3dfeca601190f403d12aebcd376e39ab89f1
Author: Leo Liu <address@hidden>
Date: Fri Nov 1 09:33:42 2013 +0800
Fix #8: Don't strip trailing blank chars
---
easy-kill.el | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 9c2638d..a105777 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -126,13 +126,6 @@ Do nothing if `easy-kill-inhibit-message' is non-nil."
(let (message-log-max)
(apply 'message format-string args))))
-(defun easy-kill-strip-trailing (s)
- (cond ((stringp s)
- (if (string-match "[ \t\f\r\n]*\\'" s)
- (substring s 0 (match-beginning 0))
- (error "`string-match' failed in `easy-kill-strip-trailing'")))
- (t "")))
-
(defvar easy-kill-candidate nil)
(defvar easy-kill-append nil)
(defvar easy-kill-mark nil)
@@ -176,13 +169,13 @@ Do nothing if `easy-kill-inhibit-message' is non-nil."
If the overlay specified by variable `easy-kill-candidate' has
non-zero length, it is the string covered by the overlay.
Otherwise, it is the value of the overlay's candidate property."
- (easy-kill-strip-trailing
- (with-current-buffer (overlay-buffer easy-kill-candidate)
- (if (/= (overlay-start easy-kill-candidate)
- (overlay-end easy-kill-candidate))
- (filter-buffer-substring (overlay-start easy-kill-candidate)
- (overlay-end easy-kill-candidate))
- (overlay-get easy-kill-candidate 'candidate)))))
+ (with-current-buffer (overlay-buffer easy-kill-candidate)
+ (or (if (/= (overlay-start easy-kill-candidate)
+ (overlay-end easy-kill-candidate))
+ (filter-buffer-substring (overlay-start easy-kill-candidate)
+ (overlay-end easy-kill-candidate))
+ (overlay-get easy-kill-candidate 'candidate))
+ "")))
(defun easy-kill-adjust-candidate (thing &optional beg end)
"Adjust kill candidate to THING, BEG, END.
@@ -214,7 +207,7 @@ candidate property instead."
(let ((interprogram-cut-function nil)
(interprogram-paste-function nil))
(kill-new (if easy-kill-append
- (concat (car kill-ring) "\n" (easy-kill-candidate))
+ (concat (car kill-ring) (easy-kill-candidate))
(easy-kill-candidate))
easy-kill-append))
t))
- [elpa] 53/77: Destroy after-string before goto-char in easy-kill-abort, (continued)
- [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, 2014/04/05
- [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 <=
- [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
- [elpa] 71/77: In no case should easy-kill-activate-keymap err, Leo Liu, 2014/04/05
- [elpa] 70/77: Adapt to upstream change, Leo Liu, 2014/04/05
- [elpa] 72/77: Rename easy-kill-backward-down to easy-kill-forward-down, Leo Liu, 2014/04/05
- [elpa] 73/77: Support list expand/shrink on js2 nodes, Leo Liu, 2014/04/05
- [elpa] 74/77: Require cl-lib, Leo Liu, 2014/04/05
- [elpa] 76/77: Add easy-kill to externals-list, Leo Liu, 2014/04/05
- [elpa] 77/77: Merge easy-kill as packages/easy-kill, Leo Liu, 2014/04/05
- [elpa] 75/77: Cleanup and preparation for inclusion in GNU ELPA, Leo Liu, 2014/04/05