Mercurial > emacs
comparison src/dired.c @ 15626:a973e9f3f6d1
(file_name_completion): Set `stat' flags to avoid
computing expensive fields in struct stat (makes filename
completion much faster).
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 07 Jul 1996 22:37:17 +0000 |
parents | a97349b06c2c |
children | ec322e4ffa16 |
comparison
equal
deleted
inserted
replaced
15625:537b4cdf9eff | 15626:a973e9f3f6d1 |
---|---|
292 struct stat st; | 292 struct stat st; |
293 int directoryp; | 293 int directoryp; |
294 int passcount; | 294 int passcount; |
295 int count = specpdl_ptr - specpdl; | 295 int count = specpdl_ptr - specpdl; |
296 struct gcpro gcpro1, gcpro2, gcpro3; | 296 struct gcpro gcpro1, gcpro2, gcpro3; |
297 | |
298 #ifdef MSDOS | |
299 #if __DJGPP__ > 1 | |
300 /* Some fields of struct stat are *very* expensive to compute on MS-DOS, | |
301 but aren't required here. Avoid computing the following fields: | |
302 st_inode, st_size and st_nlink for directories, and the execute bits | |
303 in st_mode for non-directory files with non-standard extensions. */ | |
304 | |
305 unsigned short save_djstat_flags = _djstat_flags; | |
306 | |
307 _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE; | |
308 #endif | |
309 #endif | |
297 | 310 |
298 #ifdef VMS | 311 #ifdef VMS |
299 extern DIRENTRY * readdirver (); | 312 extern DIRENTRY * readdirver (); |
300 | 313 |
301 DIRENTRY *((* readfunc) ()); | 314 DIRENTRY *((* readfunc) ()); |
494 } | 507 } |
495 | 508 |
496 UNGCPRO; | 509 UNGCPRO; |
497 bestmatch = unbind_to (count, bestmatch); | 510 bestmatch = unbind_to (count, bestmatch); |
498 | 511 |
512 #ifdef MSDOS | |
513 #if __DJGPP__ > 1 | |
514 _djstat_flags = save_djstat_flags; | |
515 #endif | |
516 #endif | |
517 | |
499 if (all_flag || NILP (bestmatch)) | 518 if (all_flag || NILP (bestmatch)) |
500 return bestmatch; | 519 return bestmatch; |
501 if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) | 520 if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) |
502 return Qt; | 521 return Qt; |
503 return Fsubstring (bestmatch, make_number (0), make_number (bestmatchsize)); | 522 return Fsubstring (bestmatch, make_number (0), make_number (bestmatchsize)); |