unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Petton <nicolas@petton.fr>
To: Damien Cassou <damien@cassou.me>
Cc: 26457@debbugs.gnu.org
Subject: bug#26457: 25.2; Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 10:24:34 +0200	[thread overview]
Message-ID: <87efwy2ful.fsf@petton.fr> (raw)
In-Reply-To: <87bms26pzb.fsf@cassou.me> (Damien Cassou's message of "Wed, 12 Apr 2017 09:32:08 +0200")

Damien Cassou <damien@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





  parent reply	other threads:[~2017-04-12  8:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  4:43 bug#26457: 25.2; Cannot pass a function to imenu-generic-expression Damien Cassou
2017-04-12  7:32 ` Damien Cassou
2017-04-12  8:03   ` Nicolas Petton
2017-04-12  8:24   ` Nicolas Petton [this message]
2017-04-12  8:42     ` Damien Cassou
2017-04-12 12:42       ` Nicolas Petton
2017-04-13  9:45       ` Nicolas Petton
2017-04-13 10:35         ` Damien Cassou
2017-04-13 10:42           ` Eli Zaretskii
2017-04-13 11:09             ` Damien Cassou
2017-04-13  9:47 ` bug#26457: [Nicolas Petton] " Nicolas Petton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efwy2ful.fsf@petton.fr \
    --to=nicolas@petton.fr \
    --cc=26457@debbugs.gnu.org \
    --cc=damien@cassou.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).