emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wish for a emms-add-url to have a "name" parameter


From: Stefan Huchler
Subject: Re: Wish for a emms-add-url to have a "name" parameter
Date: Sat, 05 Dec 2020 04:26:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Yoni Rabkin <yoni@rabkins.net> 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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]