GNU bug report logs - #26457
25.2; Cannot pass a function to imenu-generic-expression

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Wed, 12 Apr 2017 04:45:01 UTC

Severity: normal

Tags: patch

Found in version 25.2

Done: Nicolas Petton <nicolas <at> petton.fr>

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 26457 in the body.
You can then email your comments to 26457 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#26457; Package emacs. (Wed, 12 Apr 2017 04:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Damien Cassou <damien <at> cassou.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 12 Apr 2017 04:45:01 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 06:43:49 +0200
$ emacs -Q

M-:
(setq-local imenu-generic-expression `(("Foo" "^;; .*$" 0 ,(lambda 
(item pos) (message "%s" item)))))

M-x imenu

This results in

 sort: Wrong type argument: number-or-marker-p, (#<marker at 72 
 in *scratch*> (lambda (item pos) (message "%s" item)))

In GNU Emacs 25.2.3 (x86_64-unknown-linux-gnu, GTK+ Version 
3.22.9) 
of 2017-03-09 built on x230
Repository revision: aceac954ed29c2653e2a0eb71b899be5c916edda
Windowing system distributor 'Fedora Project', version 
11.0.11903000
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF 
GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT 
LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
Important settings:
 value of $LANG: fr_FR.UTF-8
 value of $XMODIFIERS: @im=ibus
 locale-coding-system: utf-8-unix

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Wed, 12 Apr 2017 07:33:02 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 09:32:08 +0200
[Message part 1 (text/plain, inline)]
Damien Cassou <damien <at> cassou.me> writes:
>  sort: Wrong type argument: number-or-marker-p, (#<marker at 72 
>  in 
> *scratch*> (lambda (item pos) (message "%s" item)))

here is a patch 

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[0001-Fix-imenu-sort-by-position-for-non-pairs-parameters-.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Wed, 12 Apr 2017 08:04:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Damien Cassou <damien <at> cassou.me>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 10:03:10 +0200
tags 26457 patch
thanks




Added tag(s) patch. Request was from Nicolas Petton <nicolas <at> petton.fr> to control <at> debbugs.gnu.org. (Wed, 12 Apr 2017 08:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Wed, 12 Apr 2017 08:25:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Damien Cassou <damien <at> cassou.me>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 10:24:34 +0200
Damien Cassou <damien <at> cassou.me> writes:

>  (defun imenu--sort-by-position (item1 item2)
> -  (< (cdr item1) (cdr item2)))
> +  "Comparison function to sort items depending on their position.
> +Return t if and only if ITEM1's position is lower than ITEM2's
          ^^        
          We usually say "non-nil".

> +(ert-deftest imenu--sort-by-position-pairs ()
> +  (should (imenu--sort-by-position '("a" . 2) '("a" . 3)))
> +  (should-not (imenu--sort-by-position '("a" . 3) '("a" . 2))))
> +
> +;; Regression test for bug#26457: 25.2; Cannot pass a function to
> +;; imenu-generic-expression
> +(ert-deftest imenu--sort-by-position-list ()
> +  (should (imenu--sort-by-position '("a" 2 nil) '("a" 3 nil)))
> +  (should-not (imenu--sort-by-position '("a" 3 nil) '("a" 2 nil))))

Thanks for the regression test!

Cheers,
Nico




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Wed, 12 Apr 2017 08:43:01 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: Nicolas Petton <nicolas <at> petton.fr>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 10:42:08 +0200
[Message part 1 (text/plain, inline)]
Nicolas Petton <nicolas <at> petton.fr> writes:
>We usually say "non-nil".


done 

-- 
Damien Cassou
Företagsplatsen AB
Phone/Fax: +46 (0)8 774 63 00
Mobile: +33 (0)6 80 50 18 91
Address: Skeppsbron 26, 4tr, SE-111 30 Stockholm
Web: www.foretagsplatsen.se
[0001-Fix-imenu-sort-by-position-for-non-pairs-parameters-.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Wed, 12 Apr 2017 12:43:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Damien Cassou <damien <at> cassou.me>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 14:42:41 +0200
[Message part 1 (text/plain, inline)]
Damien Cassou <damien <at> cassou.me> writes:

>>We usually say "non-nil".
>  
> done

Thanks, it looks good to me.
If nobody says anything I'll apply the patch to master tomorrow.

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Thu, 13 Apr 2017 09:46:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Damien Cassou <damien <at> cassou.me>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Thu, 13 Apr 2017 11:45:12 +0200
[Message part 1 (text/plain, inline)]
Damien Cassou <damien <at> cassou.me> writes:

> done

Thanks, I just applied the patch on master.

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

Reply sent to Nicolas Petton <nicolas <at> petton.fr>:
You have taken responsibility. (Thu, 13 Apr 2017 09:48:02 GMT) Full text and rfc822 format available.

Notification sent to Damien Cassou <damien <at> cassou.me>:
bug acknowledged by developer. (Thu, 13 Apr 2017 09:48:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: 26457-done <at> debbugs.gnu.org
Subject: [Nicolas Petton] Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Thu, 13 Apr 2017 11:47:43 +0200
[Message part 1 (message/rfc822, inline)]
From: Nicolas Petton <nicolas <at> petton.fr>
To: Damien Cassou <damien <at> cassou.me>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2; Cannot pass a function to imenu-generic-expression
Date: Thu, 13 Apr 2017 11:45:12 +0200
[Message part 2 (text/plain, inline)]
Damien Cassou <damien <at> cassou.me> writes:

> done

Thanks, I just applied the patch on master.

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]
[Message part 4 (text/plain, inline)]

[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Thu, 13 Apr 2017 10:36:02 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: Nicolas Petton <nicolas <at> petton.fr>
Cc: 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Thu, 13 Apr 2017 12:35:31 +0200
Nicolas Petton <nicolas <at> petton.fr> writes:
> Thanks, I just applied the patch on master. 

thank you very much. Does it make sense to put it in 25 branch as 
well?  I'm building a mode which needs this bug fix. 

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Thu, 13 Apr 2017 10:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Damien Cassou <damien <at> cassou.me>
Cc: nicolas <at> petton.fr, 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Thu, 13 Apr 2017 13:42:14 +0300
> From: Damien Cassou <damien <at> cassou.me>
> Date: Thu, 13 Apr 2017 12:35:31 +0200
> Cc: 26457 <at> debbugs.gnu.org
> 
> Nicolas Petton <nicolas <at> petton.fr> writes:
> > Thanks, I just applied the patch on master. 
> 
> thank you very much. Does it make sense to put it in 25 branch as 
> well?

Not before Emacs 25.2 is released, no.  And maybe not afterwards as
well, depending on what, if anything we would like to release from
that branch after 25.2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26457; Package emacs. (Thu, 13 Apr 2017 11:10:01 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: nicolas <at> petton.fr, 26457 <at> debbugs.gnu.org
Subject: Re: bug#26457: 25.2;
 Cannot pass a function to imenu-generic-expression
Date: Thu, 13 Apr 2017 13:09:34 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:
> Not before Emacs 25.2 is released, no.  And maybe not afterwards 
> as well, depending on what, if anything we would like to release 
> from that branch after 25.2. 

I understand. Thanks for the explanation.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




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

This bug report was last modified 8 years and 43 days ago.

Previous Next


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