leoliu pushed a commit to branch master in repository elpa. commit 13bb9830819a4dd85402a8d95bd9df75c4e3a08d Author: Leo Liu <sdl....@gmail.com> Date: Tue Oct 8 10:33:21 2013 +0800
Fix error: (args-out-of-range 1009 1035) Such errors could happen when easy-kill is active and emacsclient opens a new buffer. --- easy-kill.el | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/easy-kill.el b/easy-kill.el index d259e3c..0185374 100644 --- a/easy-kill.el +++ b/easy-kill.el @@ -87,11 +87,12 @@ 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 - (if (/= (overlay-start easy-kill-candidate) - (overlay-end easy-kill-candidate)) - (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) + (if (/= (overlay-start easy-kill-candidate) + (overlay-end easy-kill-candidate)) + (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.