GNU bug report logs - #56430
[PATCH] fix broken `imenu--create-keymap` when an item is nil

Previous Next

Package: emacs;

Reported by: Brennan Vincent <brennan <at> umanwizard.com>

Date: Wed, 6 Jul 2022 20:15:02 UTC

Severity: normal

Tags: moreinfo, patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Brennan Vincent <brennan <at> umanwizard.com>
Cc: 56430 <at> debbugs.gnu.org
Subject: bug#56430: [PATCH] fix broken `imenu--create-keymap` when an item is nil
Date: Thu, 07 Jul 2022 20:02:42 +0200
Brennan Vincent <brennan <at> umanwizard.com> writes:

> I actually observed item itself being nil, not just (car item).

Does the following simple change fix the problem, then?

diff --git a/lisp/imenu.el b/lisp/imenu.el
index 040e373fb4..dcd816cb7a 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -471,7 +471,7 @@ imenu--create-keymap
                      (t
                       (lambda () (interactive)
                         (if cmd (funcall cmd item) item))))))
-              alist)))
+              (seq-filter #'identity alist))))
 
 (defun imenu--in-alist (str alist)
   "Check whether the string STR is contained in multi-level ALIST."


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.