help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eudc / ldap / mail duplicates.


From: Bruno Hertz
Subject: Re: eudc / ldap / mail duplicates.
Date: Mon, 02 May 2005 18:23:28 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Bruno Hertz wrote:
>> Apparently, with Emacs CVS the eudc-filter-duplicate-attributes
>> function expects a different kind of list than the ldap backend
>> actually delivers.
>>
>> That is, a list like
>> ((mail . "a@b") (mail . "c@d"))
>> coming back from the ldap query is not recognized as duplicate list,
>> and the whole thing just doesn't work.
>>
>> I've been debugging the stuff for two hours, but it's still not clear
>> where to cut into the code without breaking something.
>
> Don't you just need to frob the eudc-duplicate-attribute-handling-method
> variable?

Nope. As of Emacs CVS the whole thing seems to be broken. Maybe I
should file a bug or something.

Some detail anyway: ldap returns lists of records, like
( ((mail . john@a) (mail . john@b)) ((mail . carla@c)) )

In this example, I have two ldap records, one for john and one for
carla, where the record of john contains two mail addresses. So his
record would be a candidate for duplicate handling.

Unfortunately, eudc-filter-duplicate-attributes doesn't even recognize
those duplicates and hence doesn't even come so far as to apply
eudc-duplicate-attribute-handling-method. So whatever you specify for
the latter (concat, duplicate, whatever) has no effect.

As a temporary workaround, I advised eudc-query to transform duplicate
mail addresses into individual records. So the example above would
become
( ((mail . john@a)) ((mail . john@b)) ((mail . carla@c)) )
and inline expansion/select works OK again.

The advice code is something like

(let ((result ad-do-it))

  (if (equal return-attributes '(mail)) ; inline query ?
     ; fix mail duplicate handling
     (setq result
        (let (z)
          (mapcar
            '(lambda (x)
               (mapcar
                 '(lambda (y)
                     (push (list y) z)) x)) result) z)))
     (setq ad-return-value result)) ; override return value

just in case anybody cares.

Regards, Bruno.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]