Yoni Rabkin <[email protected]> writes:
> You could store the "label" in the track information, either before or
> after adding the track to the buffer. For instance, some code to change
> the title of a youtube track under point:
>
> (defun emms-ephemeral-title (title)
> (let ((track (emms-playlist-track-at (point))))
> (emms-track-set track 'info-title title)
> (emms-with-inhibit-read-only-t
> (kill-line)
> (emms-playlist-insert-track track))))
>
> Such a change would be indeed ephemeral, since the track doesn't
> represent a file, but this information would survive if you then saved
> the playlist as a native emms playlist to load it later on.
Just tested that with a interactive function but for some reason I need
2 kill-line or else it adds a empty line after the entry:
(defun emms-ephemeral-title ()
(interactive)
(let ((track (emms-playlist-track-at (point))))
(emms-track-set track 'info-title "TEST")
(emms-with-inhibit-read-only-t
(kill-line)
(kill-line)
(emms-playlist-insert-track track))))
Now I have to find out how to do that outside of the buffer in a
non-interactive way. I think I need "with-temp-buffer" but that is for
another day but yes it works on prinziple. Any idea why I need 2
kill-line here?