From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32024: 27.0; [PATCH] `imenu--generic-function' Date: Sat, 07 Jul 2018 12:18:29 +0300 Message-ID: <83efgfjtei.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1530955027 19457 195.159.176.226 (7 Jul 2018 09:17:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2018 09:17:07 +0000 (UTC) Cc: 32024@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 07 11:17:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbjKw-0004s1-H0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Jul 2018 11:17:02 +0200 Original-Received: from localhost ([::1]:32893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbjN1-0007Wu-PM for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Jul 2018 05:19:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbjMv-0007Wl-4z for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 05:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbjMs-0007ds-04 for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 05:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41197) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbjMr-0007do-Su for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 05:19:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fbjMr-0004Ph-ML for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 05:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Jul 2018 09:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32024 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32024-submit@debbugs.gnu.org id=B32024.153095511716933 (code B ref 32024); Sat, 07 Jul 2018 09:19:01 +0000 Original-Received: (at 32024) by debbugs.gnu.org; 7 Jul 2018 09:18:37 +0000 Original-Received: from localhost ([127.0.0.1]:49094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbjMT-0004P3-7D for submit@debbugs.gnu.org; Sat, 07 Jul 2018 05:18:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbjMQ-0004Oq-Og for 32024@debbugs.gnu.org; Sat, 07 Jul 2018 05:18:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbjMI-0007Sb-Hc for 32024@debbugs.gnu.org; Sat, 07 Jul 2018 05:18:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbjMI-0007SU-EF; Sat, 07 Jul 2018 05:18:26 -0400 Original-Received: from [176.228.60.248] (port=4573 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fbjMH-0003lM-PF; Sat, 07 Jul 2018 05:18:26 -0400 In-reply-to: (message from Drew Adams on Sat, 30 Jun 2018 15:53:22 -0700 (PDT)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148290 Archived-At: > Date: Sat, 30 Jun 2018 15:53:22 -0700 (PDT) > From: Drew Adams > > Attached is a patch for two bugs in `imenu--generic-function'. I ran > into them when using a function value for argument REGEXP, though > neither has to do particularly with that use case. Instead, they both > have to do with the case where items are within comments or strings, > which might be skipped. > > 1. When checking whether the current item is inside a comment or string, > it's necessary to first move point to position START. Otherwise, the > test is made at bol (which might not be within a comment or string, > even though the START position is). > > 2. At the end, it's necessary to remove any empty menus that could have > been added. That can happen because of skipping things inside > comments or strings. Thanks. Applying this produces the following warning from the byte compiler: In end of data: imenu.el:1056:1:Warning: the function `imenup-delete-if-not' is not known to be defined. And indeed, I cannot find that function anywhere in Emacs.