From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#32024: 27.0; [PATCH] `imenu--generic-function' Date: Sat, 7 Jul 2018 07:27:52 -0700 (PDT) Message-ID: <1bfe434a-59b8-4923-ac8a-536189252d25@default> References: <> <<83efgfjtei.fsf@gnu.org>> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1530973626 26911 195.159.176.226 (7 Jul 2018 14:27:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2018 14:27:06 +0000 (UTC) Cc: 32024@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 07 16:27:01 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 1fboAv-0006rR-Dh for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Jul 2018 16:27:01 +0200 Original-Received: from localhost ([::1]:33869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fboD2-0003gD-Jk for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Jul 2018 10:29:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fboCw-0003g8-0C for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 10:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fboCs-0002R7-SK for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 10:29:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fboCs-0002Qw-Nz for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 10:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fboCs-0005XM-Ey for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 10:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Jul 2018 14:29:02 +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.153097368321216 (code B ref 32024); Sat, 07 Jul 2018 14:29:02 +0000 Original-Received: (at 32024) by debbugs.gnu.org; 7 Jul 2018 14:28:03 +0000 Original-Received: from localhost ([127.0.0.1]:50238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fboBv-0005W8-04 for submit@debbugs.gnu.org; Sat, 07 Jul 2018 10:28:03 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:33006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fboBt-0005Ve-9N for 32024@debbugs.gnu.org; Sat, 07 Jul 2018 10:28:01 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w67EOnWX137858; Sat, 7 Jul 2018 14:27:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=w1U7XO8B1ihqW/7GJCxN3CRYxouIvMn0qufLjTLmoPc=; b=fvcJt5OXoK1fF0e2oXrGZMzwcB/yii8Ta5fiSxjghjzk8eVPGrtxbWl3vVEPsu7EvAvk YxPnKh2dxwtBi7pL6+pvz9e+aoFKI2zA171aG7xrsWj7amcz3S+EbgKU3UtaXnv9WMka Fvg+GS46hBmnePeMBF3DzlRd0Dd8uFFIgYbssG+IXV59riqI2rLgU/jk/m/UXKJUoHPO cqwTdFwOZrBzsNRQ/Spcdi6SHplrWrpdoviNad8+37lX/W51EwCStV5JQZLXIRO4BY7A MlvwsUQ2rdt3OftEogBFRmwfVbSsxwDeRHUtonWSaFXQImukN9f28pif/Ljl7JA9s9jz Hw== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2k2p7v0ny1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 07 Jul 2018 14:27:55 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w67ERrcl021867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 7 Jul 2018 14:27:54 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w67ERq2h014064; Sat, 7 Jul 2018 14:27:53 GMT In-Reply-To: <<83efgfjtei.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8946 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807070173 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:148301 Archived-At: > > 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. >=20 > Thanks. >=20 > Applying this produces the following warning from the byte compiler: >=20 > In end of data: > imenu.el:1056:1:Warning: the function `imenup-delete-if-not' is not > known to be defined. >=20 > And indeed, I cannot find that function anywhere in Emacs. Sorry about that. Can you please substitute the equivalent function from Emacs, `cl-delete-if-not' (in `cl-seq.el')? (I took this from my `imenu+.el' code, and that library does not want to load `cl-seq.el' just for this, so it defines the function separately.)