GNU bug report logs - #32024
27.0; [PATCH] `imenu--generic-function'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 30 Jun 2018 22:54:02 UTC

Severity: normal

Tags: patch

Found in version 27.0

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32024 in the body.
You can then email your comments to 32024 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32024; Package emacs. (Sat, 30 Jun 2018 22:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 30 Jun 2018 22:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0; [PATCH] `imenu--generic-function'
Date: Sat, 30 Jun 2018 15:53:22 -0700 (PDT)
[Message part 1 (text/plain, inline)]
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.

In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32)
 of 2018-03-21
Repository revision: e70d0c9e66d7a8609450b2889869d16aeb0363b5
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install -C 'CFLAGS=-O2 -static -g3''
[imenu-2018-06-30.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32024; Package emacs. (Sat, 07 Jul 2018 09:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 32024 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 32024 <at> debbugs.gnu.org
Subject: Re: bug#32024: 27.0; [PATCH] `imenu--generic-function'
Date: Sat, 07 Jul 2018 12:18:29 +0300
> Date: Sat, 30 Jun 2018 15:53:22 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32024; Package emacs. (Sat, 07 Jul 2018 14:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 32024 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: 32024 <at> debbugs.gnu.org
Subject: RE: bug#32024: 27.0; [PATCH] `imenu--generic-function'
Date: Sat, 7 Jul 2018 07:27:52 -0700 (PDT)
> > 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.

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.)




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 07 Jul 2018 16:23:02 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Sat, 07 Jul 2018 16:23:02 GMT) Full text and rfc822 format available.

Message #16 received at 32024-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 32024-done <at> debbugs.gnu.org
Subject: Re: bug#32024: 27.0; [PATCH] `imenu--generic-function'
Date: Sat, 07 Jul 2018 19:22:17 +0300
> Date: Sat, 7 Jul 2018 07:27:52 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 32024 <at> debbugs.gnu.org
> 
> Sorry about that.  Can you please substitute the equivalent
> function from Emacs, `cl-delete-if-not' (in `cl-seq.el')?

Done, thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 05 Aug 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.