From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Bruno Hertz" Newsgroups: gmane.emacs.help Subject: Re: eudc / ldap / mail duplicates. Date: Mon, 02 May 2005 18:23:28 +0200 Organization: Cablecom Newsserver Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115050809 13739 80.91.229.2 (2 May 2005 16:20:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 May 2005 16:20:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 02 18:20:05 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DSddN-00078P-8W for geh-help-gnu-emacs@m.gmane.org; Mon, 02 May 2005 18:19:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DSdkJ-0008Ns-1I for geh-help-gnu-emacs@m.gmane.org; Mon, 02 May 2005 12:26:11 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!newsfeed.freenet.de!newsfeed.inode.at!news.hispeed.ch!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-NNTP-Posting-Host: 80-218-17-54.dclient.hispeed.ch Original-X-Trace: news.hispeed.ch 1115051008 28352 80.218.17.54 (2 May 2005 16:23:28 GMT) Original-X-Complaints-To: news@hispeed.ch Original-NNTP-Posting-Date: Mon, 2 May 2005 16:23:28 +0000 (UTC) User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:QrZkV4IET1VEyQ1y3iZ+lzXS8tQ= Original-Xref: shelby.stanford.edu gnu.emacs.help:130600 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26172 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26172 Kevin Rodgers 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.