On 01/28/2013 06:37 AM, Eli Zaretskii wrote: > perhaps a > further optimization would be to avoid the call to > file_name_completion_stat if completion-ignored-extensions is devoid > of elements that end in a slash. Yes, something like that might make sense. >> + fd = (int) name; > ^^^^^ > I think we should use ptrdiff_t rather than int here, since that could > make a difference in 64-bit builds on Windows. Unfortunately that won't work because the existing API uses int elsewhere and we can't easily change int to ptrdiff_t there. But there's another approach: simply set fd = 0, and use dir_pathname inside w32.c. This should be good enough for what Emacs needs. Revised patch attached.