unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Brennan Vincent <brennan@umanwizard.com>
Cc: 56430@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	[thread overview]
Message-ID: <87y1x4er7h.fsf@gnus.org> (raw)
In-Reply-To: <4efdcf03-a006-fc5a-e724-c2eddeb3cd68@umanwizard.com> (Brennan Vincent's message of "Thu, 7 Jul 2022 10:26:37 -0400")

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	other threads:[~2022-07-07 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 19:45 bug#56430: [PATCH] fix broken `imenu--create-keymap` when an item is nil Brennan Vincent
2022-07-07  8:59 ` Lars Ingebrigtsen
2022-07-07 14:26   ` Brennan Vincent
2022-07-07 18:02     ` Lars Ingebrigtsen [this message]
2022-07-07 18:18       ` Brennan Vincent
2022-07-07 18:22         ` Lars Ingebrigtsen

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=87y1x4er7h.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=56430@debbugs.gnu.org \
    --cc=brennan@umanwizard.com \
    /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).