leoliu pushed a commit to branch master in repository elpa. commit d10686871536575a6dbb78288309aed2da83d050 Author: Leo Liu <sdl....@gmail.com> Date: Sat Oct 12 12:00:53 2013 +0800
Must reference the actual object in easy-kill-candidate because this-command may set easy-kill-candidate to something else. --- easy-kill.el | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/easy-kill.el b/easy-kill.el index fcfae02..286d138 100644 --- a/easy-kill.el +++ b/easy-kill.el @@ -167,13 +167,13 @@ candidate property instead." (defun easy-kill-destroy-candidate () (let ((hook (make-symbol "easy-kill-destroy-candidate"))) - (fset hook (lambda () - (when easy-kill-candidate - (let ((i (overlay-get easy-kill-candidate 'origin-indicator))) - (and (overlayp i) (delete-overlay i))) - (delete-overlay easy-kill-candidate)) - (setq easy-kill-candidate nil) - (remove-hook 'post-command-hook hook))) + (fset hook `(lambda () + (let ((o ,easy-kill-candidate)) + (when o + (let ((i (overlay-get o 'origin-indicator))) + (and (overlayp i) (delete-overlay i))) + (delete-overlay o))) + (remove-hook 'post-command-hook ',hook))) (add-hook 'post-command-hook hook))) (defun easy-kill-expand ()