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

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

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


From: Lars Ingebrigtsen
Subject: bug#56430: [PATCH] fix broken `imenu--create-keymap` when an item is nil
Date: Thu, 07 Jul 2022 20:02:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Brennan Vincent <brennan@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





reply via email to

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