Subject: bug#73538: [PATCH] Add notifications support to 'mpc'

From: john muhl <[email-masked]>
Date: Thu, 03 Oct 2024 22:55:54 -0500

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]> writes:

> [ Sorry for the delay.  ]

No sweat. It’s plenty fast by my reckoning.

>> 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.

> Looks pretty good overall.  I'm not familiar with the `notifications`
> library, OTOH, so I have a few questions, comments, and nitpicks below.

Thanks for looking. I’ll address the rest in a follow up patch but
in the meantime could you elaborate on this point:

>> +  (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? How
would it handle the case where you want to try different tags like
“use Artist or AlbumArtist”?

If you don’t have something specific in mind I’ll see what I can
come up but any ideas would be helpful.