Subject: Re: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Jul 2017 14:46:09 +0300

> From: Nicolas Petton <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Sat, 08 Jul 2017 13:32:11 +0200
> 
> > That's one way, yes.  But not necessarily the one I had in mind.
> 
> 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;
    }