From 24a3b107f48617d130d156b903983a6087a8131a Mon Sep 17 00:00:00 2001 From: forcer Date: Tue, 13 Sep 2005 14:43:00 +0000 Subject: Added `emms-playlist-delete-track-function'. darcs-hash:20050913144350-2189f-a2006aeec64fec759f735934c7c301e1337844cd.gz --- emms.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/emms.el b/emms.el index dfea3b6..f3a2ce0 100644 --- a/emms.el +++ b/emms.el @@ -132,6 +132,11 @@ sorts before the second (see `sort')." :group 'emms :type 'function) +(defcustom emms-playlist-delete-track-function 'emms-playlist-simple-delete-track + "*A function to delete the track at point in the playlist buffer." + :group 'emms + :type 'function) + (defcustom emms-playlist-source-inserted-hook nil "*Hook run when a source got inserted into the playlist. The buffer is narrowed to the new tracks." @@ -483,11 +488,7 @@ used, and the contents removed." (defun emms-playlist-delete-track () "Delete the track at point." - (when (not (emms-playlist-track-at (point))) - (error "No track at point")) - (let ((region (emms-property-region (point) 'emms-track))) - (delete-region (car region) - (cdr region)))) + (funcall emms-playlist-delete-track-function)) ;;; Track selection (defun emms-playlist-selected-track () @@ -627,6 +628,14 @@ This uses `emms-playlist-insert-track-function'." 'emms-track track) "\n")) +(defun emms-playlist-simple-delete-track () + "Delete the track at point." + (when (not (emms-playlist-track-at (point))) + (error "No track at point")) + (let ((region (emms-property-region (point) 'emms-track))) + (delete-region (car region) + (cdr region)))) + (defun emms-playlist-simple-shuffle () "Shuffle the whole playlist buffer." (let ((current nil)) -- cgit v1.2.3