From: john muhl <jm@pub.pink>
To: Stefan Kangas <stefan@marxist.se>
Cc: Matthieu Lemerre <racin@free.fr>,
41493@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#41493: 26.3; Error in MPC directory browser
Date: Tue, 31 Dec 2024 13:26:21 -0600 [thread overview]
Message-ID: <87ed1npsbm.fsf@pub.pink> (raw)
In-Reply-To: <CADwFkm=EtYrL9EZYW9Nmk-GeCWoDK6ifUavRWAgKocg6ih1gMw@mail.gmail.com> (Stefan Kangas's message of "Wed, 12 Aug 2020 18:22:26 -0700")
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
Stefan Kangas <stefan@marxist.se> writes:
> Matthieu Lemerre <racin@free.fr> writes:
>
>> While discovering MPC I customized the MPC host variable, started MPC,
>> clicked on the Menu to "Add a new browser", then selected Directory.
>> If I click on one of my directories (that mostly contain
>> subdirectories), I get the following error:
>>
>> cl--assertion-failed: Assertion failed: (or (null alist) (memq (caar
>> alist) mpc--proc-alist-to-alists-starters))
>
> Copying in the maintainer of mpd.el here. Any ideas?
The attached patch fixes it for me. The cause seems to be that the
returned alist for a directory browser has entries for (directory
...) and (Last-Modified ...) and the code was only getting rid of
the former only. That leftover (Last-Modified ...) would then trip
up the assert in mpc--proc-alist-to-alists when it checks with
mpc--proc-alist-to-alists-starters.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-directory-browsers-in-mpc-Bug-41493.patch --]
[-- Type: text/x-patch, Size: 1316 bytes --]
From 542e4e8a444d1b197a94666ed1615b1c6ee65d01 Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Tue, 31 Dec 2024 12:52:32 -0600
Subject: [PATCH] Fix directory browsers in 'mpc' (Bug#41493)
* lisp/mpc.el (mpc-cmd-find): Strip "Last-Modified" pairs so that
the returned alist matches 'mpc--proc-alist-to-alists-starters'.
---
lisp/mpc.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/mpc.el b/lisp/mpc.el
index 4317fece6fc..05ef546f884 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -644,9 +644,10 @@ mpc-cmd-find
(mpc-proc-buf-to-alist
(mpc-proc-cmd (list "listallinfo" value)))))
(mpc--proc-alist-to-alists
- ;; Strip away the `directory' entries.
+ ;; Strip away the `directory' & `Last-Modified' entries.
(delq nil (mapcar (lambda (pair)
- (if (eq (car pair) 'directory)
+ (if (or (eq (car pair) 'directory)
+ (eq (car pair) 'Last-Modified))
nil pair))
pairs)))))
((string-match "|" (symbol-name tag))
--
2.47.1
next prev parent reply other threads:[~2024-12-31 19:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-23 21:02 bug#41493: 26.3; Error in MPC directory browser Matthieu Lemerre
2020-08-13 1:22 ` Stefan Kangas
2024-12-31 19:26 ` john muhl [this message]
2025-01-01 18:22 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-02 3:27 ` john muhl
2025-01-03 18:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ed1npsbm.fsf@pub.pink \
--to=jm@pub.pink \
--cc=41493@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=racin@free.fr \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).