changeset 531:0493e9f3c27f

[xemacs-hg @ 2001-05-12 11:16:12 by ben] event-msw.c: eliminate cygwin warnings. dired.c, syswindows.h, win32.c: find the Net* functions the hard way to avoid errors on win 9x. find-paths.el: fix error with null EXCLUDE-REGEXP. font-lock.el: fix problem reported by hrvoje with buffers starting with a space. lib-complete.el: add a variable to control where `find-library' looks, analogous to `find-function-source-path'. etags.c: new version from Francesco. Makefile.in.in: i'm getting real tired of incomplete commits. is this getting worse or something?
author ben
date Sat, 12 May 2001 11:16:25 +0000
parents c948643d954f
children 1cb1000b6813
files lib-src/ChangeLog lib-src/etags.c lisp/ChangeLog lisp/find-paths.el lisp/font-lock.el lisp/lib-complete.el src/ChangeLog src/dired.c src/event-msw.c src/syswindows.h src/win32.c
diffstat 11 files changed, 263 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Fri May 11 05:49:46 2001 +0000
+++ b/lib-src/ChangeLog	Sat May 12 11:16:25 2001 +0000
@@ -1,3 +1,16 @@
+2001-05-12  Ben Wing  <ben@xemacs.org>
+
+	* etags.c:
+	* etags.c (print_help):
+	* etags.c (sym_type):
+	* etags.c (TOTAL_KEYWORDS):
+	* etags.c (hash):
+	* etags.c (in_word_set):
+	* etags.c (consider_token):
+	* etags.c (C_entries):
+	* etags.c (add_regex):
+	new version from Francesco.
+
 2001-05-09  Ben Wing  <ben@xemacs.org>
 
 	* etags.c (add_regex):
--- a/lib-src/etags.c	Fri May 11 05:49:46 2001 +0000
+++ b/lib-src/etags.c	Sat May 12 11:16:25 2001 +0000
@@ -32,7 +32,7 @@
  *	Francesco Potort́ <pot@gnu.org> has maintained it since 1993.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 14.15";
+char pot_etags_version[] = "@(#) pot revision number is 14.20";
 
 #define	TRUE	1
 #define	FALSE	0
@@ -58,7 +58,11 @@
 # undef static
 # define ETAGS_REGEXPS		/* use the regexp features */
 # define LONG_OPTIONS		/* accept long options */
-#endif /* HAVE_CONFIG_H */
+#else
+# ifndef __STDC__
+#   define static		/* remove static for old compilers' sake */
+# endif
+#endif /* !HAVE_CONFIG_H */
 
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1		/* enables some compiler checks on GNU */
@@ -708,7 +712,7 @@
 	REGEXP is anchored (as if preceded by ^).\n\
 	The form /REGEXP/NAME/ creates a named tag.\n\
 	For example Tcl named tags can be created with:\n\
-	--regex=/proc[ \\t]+\\([^ \\t]+\\)/\\1/.");
+	--regex=\"/proc[ \\t]+\\([^ \\t]+\\)/\\1/.\"");
   puts ("-c /REGEXP/, --ignore-case-regex=/REGEXP/ or --ignore-case-regex=@regexfile\n\
         Like -r, --regex but ignore case when matching expressions.");
   puts ("-R, --no-regex\n\
@@ -1943,7 +1947,7 @@
   st_C_ignore,
   st_C_javastruct,
   st_C_operator,
-  st_C_class,
+  st_C_class, st_C_template,
   st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef, st_C_typespec
 };
 
@@ -1953,7 +1957,6 @@
 
 /* Feed stuff between (but not including) %[ and %] lines to:
       gperf -c -k 1,3 -o -p -r -t
-   then put a `static' keyword in front of the in_word_set function.
 %[
 struct C_stab_entry { char *name; int c_ext; enum sym_type type; }
 %%
@@ -1982,6 +1985,7 @@
 typedef, 	0,	st_C_typedef
 define,  	0,	st_C_define
 operator,	C_PLPL, st_C_operator
+template,	0,	st_C_template
 bool,		C_PLPL,	st_C_typespec
 long,    	0,	st_C_typespec
 short,   	0,	st_C_typespec
@@ -2016,12 +2020,12 @@
 /* Command-line: gperf -c -k 1,3 -o -p -r -t  */
 struct C_stab_entry { char *name; int c_ext; enum sym_type type; };
 
-#define TOTAL_KEYWORDS 46
+#define TOTAL_KEYWORDS 47
 #define MIN_WORD_LENGTH 2
 #define MAX_WORD_LENGTH 15
-#define MIN_HASH_VALUE 13
-#define MAX_HASH_VALUE 121
-/* maximum key range = 109, duplicates = 0 */
+#define MIN_HASH_VALUE 18
+#define MAX_HASH_VALUE 138
+/* maximum key range = 121, duplicates = 0 */
 
 #ifdef __GNUC__
 __inline
@@ -2033,32 +2037,32 @@
 {
   static unsigned char asso_values[] =
     {
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122,  57, 122, 122, 122,  55,   6,
-       60, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-       51, 122, 122,  10,   2, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122,   2,  52,  59,
-       49,  38,  56,  41, 122,  22, 122, 122,   9,  32,
-       33,  60,  26, 122,   1,  28,  46,  59,  44,  51,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-      122, 122, 122, 122, 122, 122
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139,  63, 139, 139, 139,  33,  44,
+       62, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+       42, 139, 139,  12,  32, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139,  34,  59,  37,
+       24,  58,  33,   3, 139,  16, 139, 139,  42,  60,
+       18,  11,  39, 139,  23,  57,   4,  63,   6,  20,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+      139, 139, 139, 139, 139, 139
     };
   register int hval = len;
 
@@ -2086,77 +2090,79 @@
   static struct C_stab_entry wordlist[] =
     {
       {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-      {""}, {""}, {""}, {""},
-      {"ENTRY",		0,	st_C_gnumacro},
       {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-      {""},
       {"if",		0,	st_C_ignore},
-      {""}, {""},
-      {"SYSCALL",	0,	st_C_gnumacro},
-      {""}, {""}, {""}, {""}, {""}, {""}, {""},
-      {"struct", 	0,	st_C_struct},
-      {"static",  	0,	st_C_typespec},
-      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-      {"long",    	0,	st_C_typespec},
-      {""}, {""}, {""}, {""}, {""},
-      {"auto",    	0,	st_C_typespec},
-      {"return",		0,	st_C_ignore},
-      {"import",		C_JAVA,	st_C_ignore},
-      {""},
-      {"switch",		0,	st_C_ignore},
-      {""},
-      {"implements",  	C_JAVA,	st_C_javastruct},
-      {""},
-      {"for",		0,	st_C_ignore},
-      {"volatile",	0,	st_C_typespec},
-      {""},
-      {"PSEUDO",		0,	st_C_gnumacro},
-      {""},
-      {"char",    	0,	st_C_typespec},
-      {"class",  	0,	st_C_class},
-      {"@protocol",	0,	st_C_objprot},
+      {""}, {""}, {""}, {""},
+      {"int",     	0,	st_C_typespec},
       {""}, {""},
       {"void",    	0,	st_C_typespec},
-      {"int",     	0,	st_C_typespec},
-      {"explicit",	C_PLPL,	st_C_typespec},
+      {""}, {""},
+      {"interface",	C_JAVA, st_C_struct},
+      {""},
+      {"SYSCALL",	0,	st_C_gnumacro},
       {""},
-      {"namespace",	C_PLPL,	st_C_struct},
-      {"signed",  	0,	st_C_typespec},
-      {""},
-      {"interface",	C_JAVA, st_C_struct},
+      {"return",		0,	st_C_ignore},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""},
       {"while",		0,	st_C_ignore},
+      {"auto",    	0,	st_C_typespec},
+      {""}, {""}, {""}, {""}, {""}, {""},
+      {"float",   	0,	st_C_typespec},
       {"typedef", 	0,	st_C_typedef},
       {"typename",	C_PLPL,	st_C_typespec},
       {""}, {""}, {""},
       {"friend",		C_PLPL,	st_C_ignore},
-      {"mutable",	C_PLPL,	st_C_typespec},
-      {"union",  	0,	st_C_struct},
-      {"domain", 	C_STAR,	st_C_struct},
+      {"volatile",	0,	st_C_typespec},
       {""}, {""},
+      {"for",		0,	st_C_ignore},
+      {"const",   	0,	st_C_typespec},
+      {"import",		C_JAVA,	st_C_ignore},
+      {""},
+      {"define",  	0,	st_C_define},
+      {"long",    	0,	st_C_typespec},
+      {"implements",  	C_JAVA,	st_C_javastruct},
+      {"signed",  	0,	st_C_typespec},
+      {""},
       {"extern",  	0,	st_C_extern},
       {"extends",  	C_JAVA,	st_C_javastruct},
+      {""},
+      {"mutable",	C_PLPL,	st_C_typespec},
+      {"template",	0,	st_C_template},
+      {"short",   	0,	st_C_typespec},
+      {"bool",		C_PLPL,	st_C_typespec},
+      {"char",    	0,	st_C_typespec},
+      {"class",  	0,	st_C_class},
+      {"operator",	C_PLPL, st_C_operator},
+      {""},
+      {"switch",		0,	st_C_ignore},
+      {""},
+      {"ENTRY",		0,	st_C_gnumacro},
+      {""},
       {"package",	C_JAVA,	st_C_ignore},
-      {"short",   	0,	st_C_typespec},
+      {"union",  	0,	st_C_struct},
       {"@end",		0,	st_C_objend},
-      {"unsigned",	0,	st_C_typespec},
+      {"struct", 	0,	st_C_struct},
+      {"namespace",	C_PLPL,	st_C_struct},
+      {""}, {""},
+      {"domain", 	C_STAR,	st_C_struct},
+      {"@interface",	0,	st_C_objprot},
+      {"PSEUDO",		0,	st_C_gnumacro},
+      {"double",  	0,	st_C_typespec},
       {""},
-      {"const",   	0,	st_C_typespec},
+      {"@protocol",	0,	st_C_objprot},
+      {""},
+      {"static",  	0,	st_C_typespec},
       {""}, {""},
-      {"@interface",	0,	st_C_objprot},
+      {"DEFUN",		0,	st_C_gnumacro},
+      {""}, {""}, {""}, {""},
+      {"explicit",	C_PLPL,	st_C_typespec},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {""},
       {"enum",    	0,	st_C_enum},
       {""}, {""},
-      {"@implementation",0,	st_C_objimpl},
-      {""},
-      {"operator",	C_PLPL, st_C_operator},
-      {""}, {""}, {""}, {""},
-      {"define",  	0,	st_C_define},
-      {""}, {""},
-      {"double",  	0,	st_C_typespec},
-      {""},
-      {"bool",		C_PLPL,	st_C_typespec},
-      {""}, {""}, {""},
-      {"DEFUN",		0,	st_C_gnumacro},
-      {"float",   	0,	st_C_typespec}
+      {"unsigned",	0,	st_C_typespec},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {"@implementation",0,	st_C_objimpl}
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -2523,12 +2529,15 @@
       if (structdef == stagseen)
         structdef = scolonseen;
       return FALSE;
+    case st_C_template:
     case st_C_class:
       if (cblev == 0
 	  && (*c_extp & C_AUTO)	/* automatic detection of C++ language */
 	  && definedef == dnone && structdef == snone
 	  && typdef == tnone && fvdef == fvnone)
 	*c_extp = (*c_extp | C_PLPL) & ~C_AUTO;
+      if (toktype == st_C_template)
+	break;
       /* FALLTHRU */
     case st_C_struct:
     case st_C_enum:
@@ -2792,7 +2801,7 @@
       cstack.cblev = xnew (cstack.size, int);
     }
 
-  tokoff = toklen = 0;		/* keep compiler quiet */
+  tokoff = toklen = typdefcblev = 0; /* keep compiler quiet */
   curndx = newndx = 0;
   lineno = 0;
   charno = 0;
@@ -3370,8 +3379,10 @@
 	    break;
 	  if (typdef == ttypeseen)
 	    {
+	      /* Whenever typdef is set to tinbody (currently only
+		 here), typdefcblev should be set to cblev. */
+	      typdef = tinbody;
 	      typdefcblev = cblev;
-	      typdef = tinbody;
 	    }
 	  switch (fvdef)
 	    {
@@ -3433,6 +3444,7 @@
 	    cblev--;
 	  popclass_above (cblev);
 	  structdef = snone;
+	  /* Only if typdef == tinbody is typdefcblev significant. */
 	  if (typdef == tinbody && cblev <= typdefcblev)
 	    {
 	      assert (cblev == typdefcblev);
@@ -5143,6 +5155,7 @@
      bool ignore_case;
      language *lang;
 {
+  static struct re_pattern_buffer zeropattern;
   char *name;
   const char *err;
   struct re_pattern_buffer *patbuf;
@@ -5163,13 +5176,9 @@
   (void) scan_separators (name);
 
   patbuf = xnew (1, struct re_pattern_buffer);
-  memset (patbuf, 0, sizeof (struct re_pattern_buffer));
-
-  /* Translation table to fold case if appropriate. */
-  patbuf->translate = (ignore_case) ? lc_trans : NULL;
-  patbuf->fastmap = NULL;
-  patbuf->buffer = NULL;
-  patbuf->allocated = 0;
+  *patbuf = zeropattern;
+  if (ignore_case)
+    patbuf->translate = lc_trans;	/* translation table to fold case  */
 
   err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf);
   if (err != NULL)
--- a/lisp/ChangeLog	Fri May 11 05:49:46 2001 +0000
+++ b/lisp/ChangeLog	Sat May 12 11:16:25 2001 +0000
@@ -1,3 +1,16 @@
+2001-05-12  Ben Wing  <ben@xemacs.org>
+
+	* find-paths.el (paths-find-recursive-path):
+	fix error with null EXCLUDE-REGEXP.
+	
+	* font-lock.el (font-lock-mode):
+	fix problem reported by hrvoje with buffers starting with a space.
+	
+	* lib-complete.el:
+	* lib-complete.el (find-library-source-path): New.
+	* lib-complete.el (find-library):
+	add a variable to control where `find-library' looks, analogous to `find-function-source-path'.
+
 2001-05-10  Ben Wing  <ben@xemacs.org>
 
 	* mule\mule-coding.el:
--- a/lisp/find-paths.el	Fri May 11 05:49:46 2001 +0000
+++ b/lisp/find-paths.el	Sat May 12 11:16:25 2001 +0000
@@ -69,7 +69,8 @@
 		     (directory-files directory nil "^[^.-]")))
 		  (reverse-dirs '()))
 	      (while raw-entries
-		(if (null (string-match exclude-regexp (car raw-entries)))
+		(if (not (and exclude-regexp
+			      (string-match exclude-regexp (car raw-entries))))
 		    (setq reverse-dirs
 			  (cons (expand-file-name (car raw-entries) directory)
 				reverse-dirs)))
--- a/lisp/font-lock.el	Fri May 11 05:49:46 2001 +0000
+++ b/lisp/font-lock.el	Sat May 12 11:16:25 2001 +0000
@@ -904,15 +904,12 @@
 			  font-lock-maximum-size
 			(cdr (or (assq major-mode font-lock-maximum-size)
 				 (assq t font-lock-maximum-size))))))
-    ;; Font-lock mode will refuse to turn itself on if in batch mode, or if
-    ;; the current buffer is "invisible".  The latter is because packages
-    ;; sometimes put their temporary buffers into some particular major mode
-    ;; to get syntax tables and variables and whatnot, but we don't want the
-    ;; fact that the user has font-lock-mode on a mode hook to slow these
-    ;; things down.
-    (if (or noninteractive (eq (aref (buffer-name) 0) ?\ ))
-	(setq on-p nil))
-    (if (equal (buffer-name) " *Compiler Input*") ; hack for bytecomp...
+    ;; Font-lock mode will refuse to turn itself on if in batch mode
+    ;; to avoid potential (probably not actual, though) slowdown.  We
+    ;; used to try to "be nice" by avoiding doing this in temporary
+    ;; buffers.  But with the deferral code we don't need this, and it
+    ;; definitely screws some things up.
+    (if (noninteractive)
 	(setq on-p nil))
     (cond (on-p
 	   (make-local-hook 'after-change-functions)
--- a/lisp/lib-complete.el	Fri May 11 05:49:46 2001 +0000
+++ b/lisp/lib-complete.el	Sat May 12 11:16:25 2001 +0000
@@ -295,6 +295,21 @@
 
 ;;=== find-library with completion (Author: Bob Weiner) ===================
 
+(defcustom find-library-source-path nil
+  "The default list of directories where find-library searches.
+
+If this variable is `nil' then find-library searches `load-path' by
+default.
+
+A good way to set this variable is like this:
+
+\(setq find-library-source-path
+  (paths-find-recursive-load-path
+    (list lisp-directory \"/src/xemacs/xemacs-packages-src/\")))
+"
+  :type '(repeat directory)
+  :group 'find-function)
+
 (defun find-library (library &optional codesys display-function)
   "Find and display in the current window the source for the Elisp LIBRARY.
 LIBRARY should be a name without any path information and may include or omit
@@ -302,14 +317,17 @@
 specifies the coding system to use when decoding the file.  Interactively,
 with a prefix argument, this prompts for the coding system.  Optional third
 argument DISPLAY-FUNCTION must take two arguments, the filename to display
-and CODESYS.  The default for DISPLAY-FUNCTION is `find-file'."
+and CODESYS.  The default for DISPLAY-FUNCTION is `find-file'.
+
+This function searches `find-library-source-path' to find the library;
+if this is nil (the default), then `load-path' is searched."
   (interactive 
    (list (read-library-name "Find library: ")
 	 (if current-prefix-arg
 	     (read-coding-system "Coding System: "))))
   (let ((path (if (or (null library) (equal library ""))
 		   nil
-		(locate-file library load-path
+		(locate-file library (or find-library-source-path load-path)
 			     ;; decompression doesn't work with Mule -slb
 			     (if (featurep 'mule)
 				 ":.el:.elc"
--- a/src/ChangeLog	Fri May 11 05:49:46 2001 +0000
+++ b/src/ChangeLog	Sat May 12 11:16:25 2001 +0000
@@ -1,3 +1,16 @@
+2001-05-12  Ben Wing  <ben@xemacs.org>
+
+	* event-msw.c (mswindows_dde_callback):
+	* event-msw.c (mswindows_wnd_proc):
+	eliminate cygwin warnings.
+
+	* dired.c:
+	* dired.c (user_name_completion):
+	* syswindows.h:
+	* win32.c:
+	* win32.c (init_potentially_nonexistent_functions):
+	find the Net* functions the hard way to avoid errors on win 9x.
+
 2001-05-10  Ben Wing  <ben@xemacs.org>
 
 	* dired.c:
--- a/src/dired.c	Fri May 11 05:49:46 2001 +0000
+++ b/src/dired.c	Sat May 12 11:16:25 2001 +0000
@@ -37,9 +37,6 @@
 
 #ifdef WIN32_NATIVE
 #include "syswindows.h"
-#include <lmaccess.h>
-#include <lmapibuf.h>
-#include <lmerr.h>
 #endif
 
 Lisp_Object Vcompletion_ignored_extensions;
@@ -662,44 +659,47 @@
 	  user_cache.length++;
         }
 #else
-      do
+      if (xNetUserEnum)
 	{
-	  USER_INFO_0 *bufptr;
-	  NET_API_STATUS status_status_statui_statum_statu;
-	  int i;
-
-          QUIT;
-	  status_status_statui_statum_statu =
-	    NetUserEnum (NULL, 0, 0, (LPBYTE *) &bufptr, 1024, &entriesread,
-			 &totalentries, &resume_handle);
-	  if (status_status_statui_statum_statu != NERR_Success &&
-	      status_status_statui_statum_statu != ERROR_MORE_DATA)
-	    invalid_operation ("Error enumerating users",
-			       make_int (GetLastError ()));
-	  for (i = 0; i < entriesread; i++)
+	  do
 	    {
-	      int nout =
-		WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
-				     bufptr[i].usri0_name,
-				     -1, 0, 0, "~", 0);
-	      void *outp = alloca (nout);
-	      WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
-				   bufptr[i].usri0_name, -1,
-				   (LPSTR) outp, nout, "~", 0);
-	      DO_REALLOC (user_cache.user_names, user_cache.size,
-			  user_cache.length + 1, struct user_name);
-	      TO_INTERNAL_FORMAT (C_STRING, outp,
-				  MALLOC,
-				  (user_cache.
-				   user_names[user_cache.length].ptr,
-				   user_cache.
-				   user_names[user_cache.length].len),
-				  Qmswindows_tstr);
-	      user_cache.length++;
+	      USER_INFO_0 *bufptr;
+	      NET_API_STATUS status_status_statui_statum_statu;
+	      int i;
+
+	      QUIT;
+	      status_status_statui_statum_statu =
+		xNetUserEnum (NULL, 0, 0, (LPBYTE *) &bufptr, 1024,
+			      &entriesread, &totalentries, &resume_handle);
+	      if (status_status_statui_statum_statu != NERR_Success &&
+		  status_status_statui_statum_statu != ERROR_MORE_DATA)
+		invalid_operation ("Error enumerating users",
+				   make_int (GetLastError ()));
+	      for (i = 0; i < entriesread; i++)
+		{
+		  int nout =
+		    WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
+					 bufptr[i].usri0_name,
+					 -1, 0, 0, "~", 0);
+		  void *outp = alloca (nout);
+		  WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
+				       bufptr[i].usri0_name, -1,
+				       (LPSTR) outp, nout, "~", 0);
+		  DO_REALLOC (user_cache.user_names, user_cache.size,
+			      user_cache.length + 1, struct user_name);
+		  TO_INTERNAL_FORMAT (C_STRING, outp,
+				      MALLOC,
+				      (user_cache.
+				       user_names[user_cache.length].ptr,
+				       user_cache.
+				       user_names[user_cache.length].len),
+				      Qmswindows_tstr);
+		  user_cache.length++;
+		}
+	      xNetApiBufferFree (bufptr);
 	    }
-	  NetApiBufferFree (bufptr);
+	  while (entriesread != totalentries);
 	}
-      while (entriesread != totalentries);
 #endif
 
       XCAR (cache_incomplete_p) = Qnil;
--- a/src/event-msw.c	Fri May 11 05:49:46 2001 +0000
+++ b/src/event-msw.c	Sat May 12 11:16:25 2001 +0000
@@ -1673,9 +1673,9 @@
 	    return DDE_FNOTPROCESSED;
 
 #ifdef CYGWIN
-	  filename = alloca (cygwin32_win32_to_posix_path_list_buf_size (cmd) + 5);
+	  filename = alloca (cygwin_win32_to_posix_path_list_buf_size (cmd) + 5);
 	  strcpy (filename, "file:");
-	  cygwin32_win32_to_posix_path_list (cmd, filename+5);
+	  cygwin_win32_to_posix_path_list (cmd, filename+5);
 #else
 	  dostounix_filename (cmd);
 	  filename = alloca (strlen (cmd)+6);
@@ -2983,9 +2983,9 @@
 #endif
 
 #ifdef CYGWIN
-	    filename = xmalloc (cygwin32_win32_to_posix_path_list_buf_size (fname) + 5);
+	    filename = xmalloc (cygwin_win32_to_posix_path_list_buf_size (fname) + 5);
 	    strcpy (filename, "file:");
-	    cygwin32_win32_to_posix_path_list (fname, filename+5);
+	    cygwin_win32_to_posix_path_list (fname, filename+5);
 #else
 	    filename = (char *)xmalloc (len+6);
 	    strcat (strcpy (filename, "file:"), fname);
--- a/src/syswindows.h	Fri May 11 05:49:46 2001 +0000
+++ b/src/syswindows.h	Sat May 12 11:16:25 2001 +0000
@@ -79,6 +79,10 @@
 #include <ddeml.h>
 #endif
 
+#include <lmaccess.h>
+#include <lmapibuf.h>
+#include <lmerr.h>
+
 /* mmsystem.h defines. */
 #ifndef SND_ASYNC
 #define SND_ASYNC		1
@@ -289,4 +293,21 @@
 extern DWORD (WINAPI *xSHGetFileInfoW) (LPCWSTR, DWORD, SHFILEINFOW FAR *,
 					UINT, UINT);
 
+extern NET_API_STATUS (NET_API_FUNCTION *xNetUserEnum)
+     (
+      IN  LPCWSTR     servername OPTIONAL,
+      IN  DWORD      level,
+      IN  DWORD      filter,
+      OUT LPBYTE     *bufptr,
+      IN  DWORD      prefmaxlen,
+      OUT LPDWORD    entriesread,
+      OUT LPDWORD    totalentries,
+      IN OUT LPDWORD resume_handle OPTIONAL
+      );
+
+extern NET_API_STATUS (NET_API_FUNCTION *xNetApiBufferFree)
+     (
+      IN LPVOID Buffer
+      );
+
 #endif /* INCLUDED_syswindows_h_ */
--- a/src/win32.c	Fri May 11 05:49:46 2001 +0000
+++ b/src/win32.c	Sat May 12 11:16:25 2001 +0000
@@ -62,6 +62,25 @@
      (LPCWSTR, DWORD, SHFILEINFOW FAR *, UINT, UINT);
 pfSHGetFileInfoW_t xSHGetFileInfoW;
 
+typedef NET_API_STATUS (NET_API_FUNCTION *pfNetUserEnum_t)
+     (
+      IN  LPCWSTR     servername OPTIONAL,
+      IN  DWORD      level,
+      IN  DWORD      filter,
+      OUT LPBYTE     *bufptr,
+      IN  DWORD      prefmaxlen,
+      OUT LPDWORD    entriesread,
+      OUT LPDWORD    totalentries,
+      IN OUT LPDWORD resume_handle OPTIONAL
+      );
+pfNetUserEnum_t xNetUserEnum;
+
+typedef NET_API_STATUS (NET_API_FUNCTION *pfNetApiBufferFree_t)
+     (
+      IN LPVOID Buffer
+      );
+pfNetApiBufferFree_t xNetApiBufferFree;
+
 Lisp_Object
 tstr_to_local_file_format (Extbyte *pathout)
 {
@@ -81,6 +100,8 @@
   HMODULE h_user = GetModuleHandle ("user32");
   HMODULE h_gdi = GetModuleHandle ("gdi32");
   HMODULE h_shell = GetModuleHandle ("shell32");
+  /* the following does not seem to get mapped in automatically */
+  HMODULE h_netapi = LoadLibrary ("netapi32.dll");
 
   if (h_kernel)
     {
@@ -123,6 +144,14 @@
       xSHGetFileInfoW =
 	(pfSHGetFileInfoW_t) GetProcAddress (h_shell, "SHGetFileInfoW");
     }
+
+  if (h_netapi)
+    {
+      xNetUserEnum =
+	(pfNetUserEnum_t) GetProcAddress (h_netapi, "NetUserEnum");
+      xNetApiBufferFree =
+	(pfNetApiBufferFree_t) GetProcAddress (h_netapi, "NetApiBufferFree");
+    }
 }
 
 DEFUN ("mswindows-shell-execute", Fmswindows_shell_execute, 2, 4, 0, /*