Index: src/eldap.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/eldap.h,v
retrieving revision 1.4
diff -u -r1.4 eldap.h
--- eldap.h	1998/04/17 07:17:09	1.4
+++ eldap.h	1998/04/26 22:57:00
@@ -29,8 +29,6 @@
 
 #else /* HAVE_LDAP */
 
-extern Lisp_Object Qopen, Qclosed;
-
 struct Lisp_LDAP;
 
 DECLARE_LRECORD (ldap, struct Lisp_LDAP);
@@ -39,6 +37,7 @@
 #define LDAPP(x) RECORDP (x, ldap)
 #define GC_LDAPP(x) GC_RECORDP (x, ldap)
 #define CHECK_LDAP(x) CHECK_RECORD (x, ldap)
+#define CONCHECK_LDAP(x) CONCHECK_RECORD (x, ldap)
 #define LDAP_LIVE_P(x) (EQ (x->status_symbol, Qopen))
 
 #define CHECK_LIVE_LDAP(ldap) do {                                       \
@@ -47,8 +46,8 @@
     signal_simple_error ("Attempting to access closed LDAP connection",  \
                          ldap);                                          \
 } while (0)
-  
-  
+
+
 
 
 #ifdef emacs
Index: src/eldap.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/eldap.c,v
retrieving revision 1.8
diff -u -r1.8 eldap.c
--- eldap.c	1998/04/23 02:08:01	1.8
+++ eldap.c	1998/04/26 22:57:00
@@ -47,25 +47,25 @@
 #undef HAVE_LDAP_GET_ERRNO
 #endif
 
-
-
 static int ldap_default_port;
 static Lisp_Object Vldap_default_base;
 
 /* ldap-open plist keywords */
-static Lisp_Object Qport, Qauth, Qbinddn, Qpasswd, Qderef, Qtimelimit,
+extern Lisp_Object Qport, Qauth, Qbinddn, Qpasswd, Qderef, Qtimelimit,
   Qsizelimit;
 /* Search scope limits */
-static Lisp_Object Qbase, Qonelevel, Qsubtree;
+extern Lisp_Object Qbase, Qonelevel, Qsubtree;
 /* Authentication methods */
 #ifdef LDAP_AUTH_KRBV41
-static Lisp_Object Qkrbv41;
+extern Lisp_Object Qkrbv41;
 #endif
 #ifdef LDAP_AUTH_KRBV42
-static Lisp_Object Qkrbv42;
+extern Lisp_Object Qkrbv42;
 #endif
 /* Deref policy */
-static Lisp_Object Qnever, Qalways, Qfind;
+extern Lisp_Object Qnever, Qalways, Qfind;
+/* Connection status */
+extern Lisp_Object Qopen, Qclosed;
 
 static Lisp_Object Qldapp;
 
@@ -150,8 +150,24 @@
   return ldap;
 }
 
+static void
+finalize_ldap (void *header, int for_disksave)
+{
+  struct Lisp_LDAP *ldap = (struct Lisp_LDAP *) header;
+
+  if (for_disksave)
+    {
+      Lisp_Object obj;
+      XSETLDAP (obj, ldap);
+      signal_simple_error
+	("Can't dump an emacs containing LDAP objects", obj);
+    }
+  if (EQ (ldap->status_symbol, Qopen))
+    ldap_unbind (ldap->ld);
+}
+
 DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap,
-                               mark_ldap, print_ldap, NULL,
+                               mark_ldap, print_ldap, finalize_ldap,
                                NULL, NULL, struct Lisp_LDAP);
 
 
@@ -320,7 +336,7 @@
                            lisp_strerror (errno));
 
 
-#if HAVE_LDAP_SET_OPTION
+#ifdef HAVE_LDAP_SET_OPTION
   if (ldap_set_option (ld, LDAP_OPT_DEREF, (void *)&ldap_deref) != LDAP_SUCCESS)
     signal_ldap_error (ld);
   if (ldap_set_option (ld, LDAP_OPT_TIMELIMIT,
@@ -331,16 +347,16 @@
     signal_ldap_error (ld);
   if (ldap_set_option (ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON) != LDAP_SUCCESS)
     signal_ldap_error (ld);
-#else /* HAVE_LDAP_SET_OPTION */
+#else  /* not HAVE_LDAP_SET_OPTION */
   ld->ld_deref = ldap_deref;
   ld->ld_timelimit = ldap_timelimit;
   ld->ld_sizelimit = ldap_sizelimit;
 #ifdef LDAP_REFERRALS
   ld->ld_options = LDAP_OPT_REFERRALS;
-#else /* LDAP_REFERRALS */
+#else /* not LDAP_REFERRALS */
   ld->ld_options = 0;
-#endif /* LDAP_REFERRALS */
-#endif /* HAVE_LDAP_SET_OPTION */
+#endif /* not LDAP_REFERRALS */
+#endif /* not HAVE_LDAP_SET_OPTION */
 
   /* ldap_bind_s calls select and may be wedged by spurious signals */
   slow_down_interrupts ();
@@ -364,18 +380,14 @@
 
 DEFUN ("ldap-close", Fldap_close, 1, 1, 0, /*
 Close an LDAP connection.
-Return t if the connection was actually closed or nil if
-it was already closed before the call
 */
       (ldap))
 {
-  CHECK_LDAP (ldap);
-  if ( EQ ((XLDAP (ldap))->status_symbol, Qopen) )
-    {
-      ldap_unbind ((XLDAP (ldap))->ld);
-      (XLDAP (ldap))->status_symbol = Qclosed;
-      return Qt;
-    }
+  struct Lisp_LDAP *lldap;
+  CHECK_LIVE_LDAP (ldap);
+  lldap = XLDAP (ldap);
+  ldap_unbind (lldap->ld);
+  lldap->status_symbol = Qclosed;
   return Qnil;
 }
 
@@ -562,8 +574,9 @@
     {
       signal_ldap_error (ld);
     }
-
-  if ((rc = ldap_result2error (ld, unwind.res, 0)) != LDAP_SUCCESS)
+  rc = ldap_result2error (ld, unwind.res, 0);
+  if ((rc != LDAP_SUCCESS) &&
+      (rc != LDAP_SIZELIMIT_EXCEEDED))
     {
       signal_ldap_error (ld);
     }
Index: src/general.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/general.c,v
retrieving revision 1.10
diff -u -r1.10 general.c
--- general.c	1998/04/04 23:13:52	1.10
+++ general.c	1998/04/26 22:57:01
@@ -34,21 +34,24 @@
 Lisp_Object Qactually_requested;
 Lisp_Object Qafter;
 Lisp_Object Qall;
+Lisp_Object Qalways;
 Lisp_Object Qand;
 Lisp_Object Qassoc;
 Lisp_Object Qat;
+Lisp_Object Qauth;
 Lisp_Object Qautodetect;
-Lisp_Object Qundecided;
 Lisp_Object Qbad_variable;
+Lisp_Object Qbase;
 Lisp_Object Qbefore;
 Lisp_Object Qbinary;
+Lisp_Object Qbinddn;
 Lisp_Object Qblack;
 Lisp_Object Qboolean;
 Lisp_Object Qbottom;
 Lisp_Object Qbuffer;
 Lisp_Object Qbutton;
-Lisp_Object Qcategory;
 Lisp_Object Qcase;
+Lisp_Object Qcategory;
 Lisp_Object Qchannel;
 Lisp_Object Qchar;
 Lisp_Object Qcharacter;
@@ -63,6 +66,7 @@
 Lisp_Object Qdefault;
 Lisp_Object Qdelete;
 Lisp_Object Qdelq;
+Lisp_Object Qderef;
 Lisp_Object Qdevice;
 Lisp_Object Qdimension;
 Lisp_Object Qdisplay;
@@ -71,11 +75,12 @@
 Lisp_Object Qdynarr_overhead;
 Lisp_Object Qempty;
 Lisp_Object Qeq;
-Lisp_Object Qequal;
 Lisp_Object Qeql;
+Lisp_Object Qequal;
 Lisp_Object Qeval;
 Lisp_Object Qextents;
 Lisp_Object Qface;
+Lisp_Object Qfind;
 Lisp_Object Qfont;
 Lisp_Object Qframe;
 Lisp_Object Qfunction;
@@ -95,6 +100,8 @@
 Lisp_Object Qkey_assoc;
 Lisp_Object Qkeyboard;
 Lisp_Object Qkeymap;
+Lisp_Object Qkrbv41;
+Lisp_Object Qkrbv42;
 Lisp_Object Qleft;
 Lisp_Object Qlist;
 Lisp_Object Qmagic;
@@ -109,17 +116,26 @@
 Lisp_Object Qmotion;
 Lisp_Object Qmswindows;
 Lisp_Object Qname;
+Lisp_Object Qnever;
 Lisp_Object Qnone;
 Lisp_Object Qnot;
 Lisp_Object Qnothing;
 Lisp_Object Qnotice;
 Lisp_Object Qobject;
+Lisp_Object Qold_assoc;
+Lisp_Object Qold_delete;
+Lisp_Object Qold_delq;
+Lisp_Object Qold_rassoc;
+Lisp_Object Qold_rassq;
+Lisp_Object Qonelevel;
 Lisp_Object Qonly;
 Lisp_Object Qor;
 Lisp_Object Qother;
+Lisp_Object Qpasswd;
 Lisp_Object Qpath;
 Lisp_Object Qpointer;
 Lisp_Object Qpopup;
+Lisp_Object Qport;
 Lisp_Object Qprint;
 Lisp_Object Qprocess;
 Lisp_Object Qprovide;
@@ -130,29 +146,28 @@
 Lisp_Object Qreturn;
 Lisp_Object Qreverse;
 Lisp_Object Qright;
-Lisp_Object Qold_assoc;
-Lisp_Object Qold_delete;
-Lisp_Object Qold_delq;
-Lisp_Object Qold_rassoc;
-Lisp_Object Qold_rassq;
 Lisp_Object Qsearch;
 Lisp_Object Qsignal;
 Lisp_Object Qsimple;
 Lisp_Object Qsize;
+Lisp_Object Qsizelimit;
 Lisp_Object Qspace;
 Lisp_Object Qspecifier;
 Lisp_Object Qstream;
 Lisp_Object Qstring;
+Lisp_Object Qsubtree;
 Lisp_Object Qsymbol;
 Lisp_Object Qsyntax;
 Lisp_Object Qtest;
 Lisp_Object Qtext;
+Lisp_Object Qtimelimit;
 Lisp_Object Qtimeout;
 Lisp_Object Qtimestamp;
 Lisp_Object Qtoolbar;
 Lisp_Object Qtop;
 Lisp_Object Qtty;
 Lisp_Object Qtype;
+Lisp_Object Qundecided;
 Lisp_Object Qundefined;
 Lisp_Object Qunimplemented;
 Lisp_Object Qvalue_assoc;
@@ -171,14 +186,17 @@
   defsymbol (&Qactually_requested, "actually-requested");
   defsymbol (&Qafter, "after");
   defsymbol (&Qall, "all");
+  defsymbol (&Qalways, "always");
   defsymbol (&Qand, "and");
   defsymbol (&Qassoc, "assoc");
   defsymbol (&Qat, "at");
+  defsymbol (&Qauth, "auth");
   defsymbol (&Qautodetect, "autodetect");
-  defsymbol (&Qundecided, "undecided");
   defsymbol (&Qbad_variable, "bad-variable");
+  defsymbol (&Qbase, "base");
   defsymbol (&Qbefore, "before");
   defsymbol (&Qbinary, "binary");
+  defsymbol (&Qbinddn, "binddn");
   defsymbol (&Qblack, "black");
   defsymbol (&Qboolean, "boolean");
   defsymbol (&Qbottom, "bottom");
@@ -200,6 +218,7 @@
   defsymbol (&Qdefault, "default");
   defsymbol (&Qdelete, "delete");
   defsymbol (&Qdelq, "delq");
+  defsymbol (&Qderef, "deref");
   defsymbol (&Qdevice, "device");
   defsymbol (&Qdimension, "dimension");
   defsymbol (&Qdisplay, "display");
@@ -208,11 +227,12 @@
   defsymbol (&Qdynarr_overhead, "dynarr-overhead");
   defsymbol (&Qempty, "empty");
   defsymbol (&Qeq, "eq");
-  defsymbol (&Qequal, "equal");
   defsymbol (&Qeql, "eql");
+  defsymbol (&Qequal, "equal");
   defsymbol (&Qeval, "eval");
   defsymbol (&Qextents, "extents");
   defsymbol (&Qface, "face");
+  defsymbol (&Qfind, "find");
   defsymbol (&Qfont, "font");
   defsymbol (&Qframe, "frame");
   defsymbol (&Qfunction, "function");
@@ -225,13 +245,15 @@
   defsymbol (&Qid, "id");
   defsymbol (&Qimage, "image");
   defsymbol (&Qinfo, "info");
-  defsymbol (&Qinteger, "integer");
   defsymbol (&Qinherit, "inherit");
+  defsymbol (&Qinteger, "integer");
   defsymbol (&Qinternal, "internal");
   defsymbol (&Qkey, "key");
   defsymbol (&Qkey_assoc, "key-assoc");
   defsymbol (&Qkeyboard, "keyboard");
   defsymbol (&Qkeymap, "keymap");
+  defsymbol (&Qkrbv41, "krbv41");
+  defsymbol (&Qkrbv42, "krbv42");
   defsymbol (&Qleft, "left");
   defsymbol (&Qlist, "list");
   defsymbol (&Qmagic, "magic");
@@ -246,17 +268,26 @@
   defsymbol (&Qmotion, "motion");
   defsymbol (&Qmswindows, "mswindows");
   defsymbol (&Qname, "name");
+  defsymbol (&Qnever, "never");
   defsymbol (&Qnone, "none");
   defsymbol (&Qnot, "not");
   defsymbol (&Qnothing, "nothing");
   defsymbol (&Qnotice, "notice");
   defsymbol (&Qobject, "object");
+  defsymbol (&Qold_assoc, "old-assoc");
+  defsymbol (&Qold_delete, "old-delete");
+  defsymbol (&Qold_delq, "old-delq");
+  defsymbol (&Qold_rassoc, "old-rassoc");
+  defsymbol (&Qold_rassq, "old-rassq");
+  defsymbol (&Qonelevel, "onelevel");
   defsymbol (&Qonly, "only");
   defsymbol (&Qor, "or");
   defsymbol (&Qother, "other");
+  defsymbol (&Qpasswd, "passwd");
   defsymbol (&Qpath, "path");
   defsymbol (&Qpointer, "pointer");
   defsymbol (&Qpopup, "popup");
+  defsymbol (&Qport, "port");
   defsymbol (&Qprint, "print");
   defsymbol (&Qprocess, "process");
   defsymbol (&Qprovide, "provide");
@@ -266,29 +297,28 @@
   defsymbol (&Qreturn, "return");
   defsymbol (&Qreverse, "reverse");
   defsymbol (&Qright, "right");
-  defsymbol (&Qold_assoc, "old-assoc");
-  defsymbol (&Qold_delete, "old-delete");
-  defsymbol (&Qold_delq, "old-delq");
-  defsymbol (&Qold_rassoc, "old-rassoc");
-  defsymbol (&Qold_rassq, "old-rassq");
   defsymbol (&Qsearch, "search");
   defsymbol (&Qsignal, "signal");
   defsymbol (&Qsimple, "simple");
   defsymbol (&Qsize, "size");
+  defsymbol (&Qsizelimit, "sizelimit");
   defsymbol (&Qspace, "space");
   defsymbol (&Qspecifier, "specifier");
   defsymbol (&Qstream, "stream");
   defsymbol (&Qstring, "string");
+  defsymbol (&Qsubtree, "subtree");
   defsymbol (&Qsymbol, "symbol");
   defsymbol (&Qsyntax, "syntax");
   defsymbol (&Qtest, "test");
   defsymbol (&Qtext, "text");
+  defsymbol (&Qtimelimit, "timelimit");
   defsymbol (&Qtimeout, "timeout");
   defsymbol (&Qtimestamp, "timestamp");
   defsymbol (&Qtoolbar, "toolbar");
   defsymbol (&Qtop, "top");
   defsymbol (&Qtty, "tty");
   defsymbol (&Qtype, "type");
+  defsymbol (&Qundecided, "undecided");
   defsymbol (&Qundefined, "undefined");
   defsymbol (&Qunimplemented, "unimplemented");
   defsymbol (&Qvalue_assoc, "value-assoc");
Index: lisp/ldap.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/ldap.el,v
retrieving revision 1.3
diff -u -r1.3 ldap.el
--- ldap.el	1998/04/17 07:17:01	1.3
+++ ldap.el	1998/04/26 22:57:01
@@ -84,7 +84,7 @@
     (setq host-alist
 	  (assoc host ldap-host-parameters-alist))
     (message "Opening LDAP connection to %s..." host)
-    (setq ldap (ldap-open host (alist-to-plist host-alist)))
+    (setq ldap (ldap-open host (alist-to-plist (cdr host-alist))))
     (message "Searching with LDAP on %s..." host)
     (setq res (ldap-search-internal ldap filter 
 				    (cdr (assq 'base host-alist))
