From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: john muhl Newsgroups: gmane.emacs.bugs Subject: bug#73538: [PATCH] Add notifications support to 'mpc' Date: Thu, 03 Oct 2024 22:55:54 -0500 Message-ID: <87y134y111.fsf@pub.pink> References: <87frpjtmx6.fsf@pub.pink> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36759"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.1; emacs 31.0.50 Cc: monnier@iro.umontreal.ca To: 73538@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 04 05:57:32 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1swZRa-0009KE-Uy for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Oct 2024 05:57:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swZR8-0006z5-1d; Thu, 03 Oct 2024 23:57:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swZR6-0006yL-7n for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 23:57:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swZR5-0005tO-LO for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 23:56:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=C/8TPwc9AFiPKZGJ1lfR3s1IaELtNqMN9Ff6efajTmg=; b=vq2Gc4F4zX1SbWJxII3jING2bM3LZIEL2iewSYtwKUw6ya1ThnsT7IStSFFReF4S7VHITstoj/2Jiaz8yiqZWl7Si0eOJdkTeWePMeWOfJ2R26e8LUflD1894OrH2CrRGCRcuwz9TMPnVc2Jknl4d3jPS+2alx5MMtXXNlACkFwl3rJD431+4hxWyDrYtwQHLQGa5Ry5bwOeYwwAQOdpAyuzIrmqLpqjbkyTmXNaPBytAZAqoEMcQCtnYtm8sKihaAsKd4suuD2d4/kvsEd853qEpr90BfFCC45yy7XOnfsGPFsBjW51GnbzaA5aypOP20OFwgPxcY/Jw1p2F5WdUg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swZR7-0000UU-Ra for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 23:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Oct 2024 03:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73538 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Stefan Monnier , 73538@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17280141691814 (code B ref -1); Fri, 04 Oct 2024 03:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Oct 2024 03:56:09 +0000 Original-Received: from localhost ([127.0.0.1]:34207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swZQG-0000TC-RY for submit@debbugs.gnu.org; Thu, 03 Oct 2024 23:56:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swZQD-0000So-EL for submit@debbugs.gnu.org; Thu, 03 Oct 2024 23:56:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swZQA-0006vf-Bt for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 23:56:02 -0400 Original-Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swZQ7-0005qR-8b for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 23:56:01 -0400 Original-Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 41753138060C; Thu, 3 Oct 2024 23:55:56 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 03 Oct 2024 23:55:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1728014156; x=1728100556; bh=C/8TPwc9AFiPKZGJ1lfR3s1IaELtNqMN9Ff6efajTmg=; b= B16Pcn3+XIWa8e1sYZhab7odoDwxW7HBPiIIueM0yYSyrqd1YhMRquR+Z7X8bedI KYnp+a9br3PWKyP7TaUEb8Gnwf1oA9zT9uEqfQ7QGMbMEWNlW04tNjrVhDgCtnD/ jORZJD8Bl0UO4s3pvhNu+Kbhv9OCN1fbbwEBmSeKUneArUHpSGYlreUT6PV4AIa8 Ao16iFfvQyZMqUIK8/7cHjFKaer/Pfn2vd5g+1QGfvsKvVgFUT06GeGzx34j1ttz AKAQutd56YGuk+I5jd5jozJbVZrjLFSjAGCwKW0fARwd12B3i9W+41JflbDv2z1H Q0T25XnyW2cY0VLpLTG1Sg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728014156; x= 1728100556; bh=C/8TPwc9AFiPKZGJ1lfR3s1IaELtNqMN9Ff6efajTmg=; b=W rhQJ3zDTrVunrWV3GicWsMOjUIcm8RMiifnfpEN7fMMLdZzaK9wyeTD8mxyOiSzM taYYQb7D+UlG/FyVp0v81U5Be1uUKgcdwSqivTM23LkGWnGWZOOA35QhU5cOhw6u DHmRbsFcifuiiomxp/51A1xgpVHICkd2xaPwwTCa/yXEXJWeQ3YX3DKA6xXVcWR4 Qo8tkkGOsWJpbJ5T+GVBNHRQNTUP2bWlTHfCMqtW8ndEBp8iEf6TWj6omRLFsZjw SUIRwNbCsfIwTOzBKPoUvMIrguzfl7lmXJdUW3sSM/aLLe3ZVt6nP2B1NEGEm1bu wBnojdFGyHJNUOcGBNECQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvvddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgfgsehtqhertddtreej necuhfhrohhmpehjohhhnhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggftrf grthhtvghrnhepgeevhedvtdetvdekuddvtddthefhvdfggfdvgfeitdejudehhfffjedt vdevveeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epjhhmsehpuhgsrdhpihhnkhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepjeefheefkeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtph htthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrgdprhgtphhtthho pegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i74194916:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Oct 2024 23:55:55 -0400 (EDT) In-Reply-To: (Stefan Monnier via's message of "Thu, 03 Oct 2024 10:57:23 -0400") Received-SPF: pass client-ip=103.168.172.145; envelope-from=jm@pub.pink; helo=fout-a2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292942 Archived-At: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text= editors" writes: > [ Sorry for the delay. ] No sweat. It=E2=80=99s 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=E2=80=99t 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=E2=80=99ll address the rest in a follow up patch but in the meantime could you elaborate on this point: >> + (when-let (((string=3D "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 =E2=80=9C%{title} %5{duration}=E2=80=9D or something else?= How would it handle the case where you want to try different tags like =E2=80=9Cuse Artist or AlbumArtist=E2=80=9D? If you don=E2=80=99t have something specific in mind I=E2=80=99ll see what = I can come up but any ideas would be helpful.