GNU bug report logs -
#26457
25.2; Cannot pass a function to imenu-generic-expression
Previous Next
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.
Full log
Message #16 received at 26457 <at> debbugs.gnu.org (full text, mbox):
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
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.