From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brennan Vincent Newsgroups: gmane.emacs.bugs Subject: bug#56430: [PATCH] fix broken `imenu--create-keymap` when an item is nil Date: Thu, 7 Jul 2022 14:18:16 -0400 Message-ID: <2ac26bde-ea5e-015c-e66a-ba1c090fa0a8@umanwizard.com> References: <87mtdlguwi.fsf@gnus.org> <4efdcf03-a006-fc5a-e724-c2eddeb3cd68@umanwizard.com> <87y1x4er7h.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9656"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: 56430@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 07 21:08:11 2022 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 1o9WrC-0002Nq-Os for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 21:08:10 +0200 Original-Received: from localhost ([::1]:47998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9WrB-0008SP-Nj for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 15:08:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9WiM-0004iX-7f for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 14:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9WiL-00022s-UT for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 14:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9WiL-0003lg-Tg for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 14:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2022 18:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo patch Original-Received: via spool by 56430-submit@debbugs.gnu.org id=B56430.165722032014456 (code B ref 56430); Thu, 07 Jul 2022 18:59:01 +0000 Original-Received: (at 56430) by debbugs.gnu.org; 7 Jul 2022 18:58:40 +0000 Original-Received: from localhost ([127.0.0.1]:57971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9Whx-0003l4-Qe for submit@debbugs.gnu.org; Thu, 07 Jul 2022 14:58:40 -0400 Original-Received: from smtp.umanwizard.com ([54.203.248.109]:12954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9W57-0000RF-FJ for 56430@debbugs.gnu.org; Thu, 07 Jul 2022 14:18:30 -0400 X-Fes-Received-For: 56430@debbugs.gnu.org X-Fes-Received-From: brennan@umanwizard.com Original-Received: From [10.10.1.216] ([173.205.212.102]) By umanwizard.com ; 7 Jul 2022 18:18:18+0000 Content-Language: en-US In-Reply-To: <87y1x4er7h.fsf@gnus.org> X-Fes-Encrypted: true X-Fes-Ehlo-Domain: [10.10.1.216] X-Mailman-Approved-At: Thu, 07 Jul 2022 14:58:36 -0400 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" Xref: news.gmane.io gmane.emacs.bugs:236415 Archived-At: Yes. That fixes the issue I was observing, too. My original motivation was that the lsp-mode was failing to launch for Golang files on master. Both my diff and yours fix that problem. I have no strong opinion on which diff is better. On 2022-07-07 14:02, Lars Ingebrigtsen wrote: > Content preview: Brennan Vincent writes: > I actually > observed item itself being nil, not just (car item). Does the following simple > change fix the problem, then? > > Content analysis details: (-2.9 points, 5.0 required) > > pts rule name description > ---- ---------------------- -------------------------------------------------- > -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP > -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% > [score: 0.0000] > X-Fes-Encrypted: true > X-Fes-Ehlo-Domain: quimby.gnus.org > > Brennan Vincent 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." > > > --