From ae36768ee0ae1af113c60aef417b6e889f914984 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Mon, 29 Jan 2007 09:17:00 +0000 Subject: emms-playlist: Pay attention to selection when updating Make sure that we preserve the current selection if updating the currently-selected track.. darcs-hash:20070129091716-1bfb2-a0a7e5b14cc02d29c27de5bfdb068f5b9a1b39b7.gz --- emms-playlist-mode.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el index d3e13ee..103bdb7 100644 --- a/emms-playlist-mode.el +++ b/emms-playlist-mode.el @@ -455,11 +455,17 @@ When NO-NEWLINE is non-nil, do not insert a newline after the track." (let ((track-region (emms-property-region (point) 'emms-track)) (track (get-text-property (point) - 'emms-track))) + 'emms-track)) + (selectedp (emms-playlist-selected-track-at-p))) (save-excursion (delete-region (car track-region) (cdr track-region)) - (emms-playlist-mode-insert-track track t))))) + (when selectedp + (delete-overlay emms-playlist-mode-selected-overlay) + (setq emms-playlist-mode-selected-overlay nil)) + (emms-playlist-mode-insert-track track t)) + (when selectedp + (emms-playlist-select (point)))))) ;;; -------------------------------------------------------- ;;; Entry -- cgit v1.2.3