GNU bug report logs -
#73538
[PATCH] Add notifications support to 'mpc'
Previous Next
Reported by: john muhl <jm <at> pub.pink>
Date: Sat, 28 Sep 2024 22:49:02 UTC
Severity: wishlist
Tags: patch
Done: john muhl <jm <at> pub.pink>
Bug is archived. No further changes may be made.
Full log
Message #19 received at 73538 <at> debbugs.gnu.org (full text, mbox):
>>> This adds support for displaying a notification when the song changes.
>> Oh, wow! A patch for `mpc.el`! Thanks!
> I hope you won’t mind a few more.
🙂
>>> + (when-let (((string= "play" (alist-get 'state mpc-status)))
>>> + (title (or (alist-get 'Title mpc-status) "Unknown Title"))
>>> + (body (or (alist-get 'Artist mpc-status)
>>> + (alist-get 'AlbumArtist mpc-status)
>>> + "Unknown Artist"))
>>
>> Comment: I think it would make sense to use `mpc-format` here with
>> Custom vars to specify what goes in the title and body.
>
> What do you think the custom vars should look like?
> Would it be a FORMAT-SPEC like “%{title} %5{duration}” or something else?
I don't have a strong opinion on what the default format should look like.
> How would it handle the case where you want to try different tags like
> “use Artist or AlbumArtist”?
Ah... Hmm... good point. We don't support that currently in
`mpc-format`. Maybe we should add support for this (and take the
opportunity to actually document the % thingies understood by `mpc-format`).
Currently, the main format is `%WIDTH{NAME-POST}` where `-POST` is
optional, and it means to use the empty string if NAME is absent or
else use the concatenation of the content of NAME with the string POST.
Currently `-POST` is used only for `%{Disc--}`.
Maybe we should simply extend that to something like `%{NAME1|NAME2|...-POST}`?
Not sure whether it's worth adding support for a "default string", nor
what format we could use for that. Maybe simply make it so that if
there's a | then the last element is not a tag name but a literal string
to use, so we could use:
%{Artist|AlbumArtist|Unknown Artist}
Of course we could combine the two into something like
`%{NAME-POST+DEFAULT}` where DEFAULT would be recursively parsed as
a format string so we could do
%{Artist+%{AlbumArtist+Unknown Artist}}
but I think this is getting too fancy for my taste (at that point, an
S-exp based format would start looking pretty attractive).
Stefan
This bug report was last modified 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.