From 5b92f3fbd4725bd77efa48f48b2871725ffa47be Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 14 Jun 2000 02:02:30 +0000 Subject: [PATCH] 2000-06-14 Yuuichi Teranishi * wl-address.el (wl-ldap-search-internal): Renamed to `wl-ldap-search'. Choose implementation at compile time. 2000-06-13 Takeshi Chiba * wl-address.el (wl-ldap-search-internal): New function. (wl-complete-field-to): Use it. --- wl/ChangeLog | 10 ++++++++++ wl/wl-address.el | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index a4f51f3..3e11448 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,13 @@ +2000-06-14 Yuuichi Teranishi + + * wl-address.el (wl-ldap-search-internal): Renamed to `wl-ldap-search'. + Choose implementation at compile time. + +2000-06-13 Takeshi Chiba + + * wl-address.el (wl-ldap-search-internal): New function. + (wl-complete-field-to): Use it. + 2000-06-12 Yuuichi Teranishi * wl-address.el (wl-ldap-search): Use `with-temp-buffer'. diff --git a/wl/wl-address.el b/wl/wl-address.el index 063d919..a43d598 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -4,7 +4,7 @@ ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news -;; Time-stamp: <00/06/12 13:41:52 teranisi> +;; Time-stamp: <00/06/14 10:56:07 teranisi> ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen). @@ -41,6 +41,41 @@ (defvar wl-address-completion-list nil) (defvar wl-address-petname-hash nil) +(static-if (and (featurep 'xemacs) + (fboundp 'ldap-open)) +;; LDAP is built-in feature. +(defun wl-ldap-search (pat &optional cl) + "make completion-list by ldap search (use build-in ldap feature)" + (let ((ldap-pat (concat "mail=" pat "*")) + (ret cl) + hdl + search-ret + addr) + (setq hdl (ldap-open wl-ldap-server)) + (setq search-ret + (ldap-search-basic hdl ldap-pat wl-ldap-base 'subtree '("mail"))) + (ldap-close hdl) + (while search-ret + (if (listp search-ret) + (progn + (setq addr (car search-ret)) + (setq search-ret (cdr search-ret)) + (if (listp addr) + (progn + (setq addr (car addr)) + (if (listp addr) + (progn + (setq addr (cdr addr)) + (if (listp addr) + (progn + (setq addr (car addr)) + (setq addr (cons addr addr)) + (if ret + (setq ret (append ret (list addr))) + (setq ret (list addr)))))))))) + (setq search-ret nil))) + ret)) +;; LDAP is not built-in feature. (defun wl-ldap-search (pat &optional cl) "make completion-list by ldap search" (let ((ldap-pat (concat "mail=" pat "*")) @@ -59,7 +94,7 @@ (setq ret (append ret (list addr))) (setq ret (list addr)))))) ret)) - +) (defun wl-complete-field-to () (interactive) -- 1.7.10.4