-rw-r--r-- | emms.el | 21 |
@@ -585,7 +585,7 @@ See `emms-random-playlist'." (interactive) (customize-set-variable 'emms-random-playlist (not emms-random-playlist)) (if emms-random-playlist - (message "Will play the tracks randomly.") + (message "Will play the tracks randomly.") (message "Will play the tracks sequentially."))) (defun emms-toggle-repeat-playlist () @@ -1468,6 +1468,7 @@ See emms-source-file.el for some examples." (source-play (intern (format "emms-play-%s" name))) (source-add (intern (format "emms-add-%s" name))) (source-insert (intern (format "emms-insert-%s" name))) + (source-insert-current (intern (format "emms-insert-current-%s" name))) (docstring "A source of tracks for EMMS.") (interactive nil) (call-args (delete '&rest @@ -1500,7 +1501,11 @@ See emms-source-file.el for some examples." (defun ,source-insert ,arglist ,docstring ,interactive - (emms-source-insert ',source-name ,@call-args))))) + (emms-source-insert ',source-name ,@call-args)) + (defun ,source-insert-current ,arglist + ,docstring + ,interactive + (emms-source-insert-current ',source-name ,@call-args))))) (defun emms-source-play (source &rest args) "Play the tracks of SOURCE, after first clearing the EMMS playlist." @@ -1522,8 +1527,16 @@ See emms-source-file.el for some examples." (defun emms-source-insert (source &rest args) "Insert the tracks from SOURCE in the current buffer." - (if (not emms-playlist-buffer-p) - (error "Not in an EMMS playlist buffer") + (with-current-emms-playlist + (apply #'emms-playlist-insert-source source args))) + +(defun emms-source-insert-current (source &rest args) + "Insert from SOURCE into buffer at current track." + (with-current-emms-playlist + (if (not emms-playlist-selected-marker) + (error "no current playlist track") + (goto-char emms-playlist-selected-marker) + (forward-line)) (apply #'emms-playlist-insert-source source args))) ;;; User-defined playlists |