aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2007-01-29 09:17:00 +0000
committerMichael Olson <mwolson@gnu.org>2007-01-29 09:17:00 +0000
commitae36768ee0ae1af113c60aef417b6e889f914984 (patch)
treea59a5deae4c8f223c37bce14ca8a4b57e389ed00
parentdc1f3f03fbc62baa6da7112cbdf23b9b3d50b661 (diff)
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
-rw-r--r--emms-playlist-mode.el10
1 files 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