bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: bug#73538: [PATCH] Add notifications support to 'mpc'
Date: Thu, 17 Oct 2024 12:43:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

> Hereโ€™s an updated patch. Should have all feedback incorporated and
> now with a NEWS entry.

Thanks, merged into `master` (after which I installed some further tweaks).

>> Question: Why is it interactive?
> I have a global mpc-minor-mode that adds a key binding for
> notifications and it must have bled through.

๐Ÿ™‚

> Instead of changing mpc-format I made the customizable variables
> take a list of specs where the first element to return something
> interesting is used and a plain string can be added for fallback:
>
>   (setopt mcp-notifications-body-specs
>           '("%{Artist}" "%{AlbumArtist}" "Unknown Artist"))
>
> I added your description of the FORMAT-SPEC to the mpc-format
> docstring too.

I tweaked the docstring a bit further.  Regarding the
`mpc-notifications-body/title`, the problem I can see with it is that
the "conditionality" is based on the fact that the overall result is
an empty string, so you can use something like

    (setopt mcp-notifications-body
            '("By %{Artist}" "By %{AlbumArtist}" "Unknown Artist"))

since the first will expand to the non-empty "By ".  ๐Ÿ™


        Stefan






reply via email to

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