GNU bug report logs - #27584
26.0.50; alist-get: Add optional arg TESTFN

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Wed, 5 Jul 2017 03:24:02 UTC

Severity: wishlist

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 27584 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, tino.calancha <at> gmail.com
Subject: Re: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN
Date: Sun, 09 Jul 2017 21:18:01 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> What solution did you have in mind?
>
> Something like this:
>
>   FOR_EACH_TAIL (tail)
>     {
>       Lisp_Object car = XCAR (tail);
>       if (CONSP (car)
> 	  && (NILP (testfn)
> 	      ? (EQ (XCAR (car), key) || !NILP (Fequal (XCAR (car), key)))
> 	      : !NILP (call2 (testfn, XCAR (car), key))))
> 	return car;
>     }

Thanks, it's indeed much better.
[signature.asc (application/pgp-signature, inline)]

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

Previous Next


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