Subject: Re: bug#64089: 30.0.50; `ldap-search' errors out with `wrong-type-argument listp' when called WITHDN == t

From: Jens Schmidt <[email-masked]>
Date: Sun, 18 Jun 2023 09:43:15 +0200

On 2023-06-18  01:14, Filipp Gunbin wrote:

> - the code before the fix prepended dn as string (and it's not 
> totally broken - you can skip attribute translation via 
> var/defcustom, in which case the error should not be triggered)

The problem is that WITHDN == t IMHO can mean various things, each
interpretation having some valid reasons (note that your implementation
differs from the original one as well!)

- My proposal:

   ((("dn" "cn=JENS_SCHMIDT,L=REGION,DC=COMPANY,DC=COM")
     ("mail"   "[email-masked]")))

   I'd like to have the distinguished name available in EUDC eventually
   to do fun things with it.  Traversing our (and other's?) company's
   hierarchy, to be precise.

- Your proposal:

   (("cn=JENS_SCHMIDT,L=REGION,DC=COMPANY,DC=COM"
     ("mail"   "[email-masked]")))

   This makes an alist out of the overall result, also fine.

- The original author's (Gerd's) possible intent, since he never
   actually split off the leading "dn":

    (("dn: cn=JENS_SCHMIDT,L=REGION,DC=COMPANY,DC=COM"
      ("mail"   "[email-masked]")))

   Not sure what this would be good for, though.

I think we should account (in emacs-master) for these various options 
and make WITHDN take various values:

   `cons'   - return my interpretation
   `string' - return yours
   t        - return Gerd's

Or whatever.  In any case, I'll open a new bug for that to continue this 
discussion.