aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1996-07-07 22:37:17 +0000
committerKarl Heuer1996-07-07 22:37:17 +0000
commit33d5e9cc8fdbd14172135e1d91e703458c8f748a (patch)
tree5c1627c035a8254b3f3afd10c955255b09995413 /src
parent34ead71a13152314bf149fbd185cd29b89ae5cb0 (diff)
downloademacs-33d5e9cc8fdbd14172135e1d91e703458c8f748a.tar.gz
emacs-33d5e9cc8fdbd14172135e1d91e703458c8f748a.zip
(file_name_completion): Set `stat' flags to avoid
computing expensive fields in struct stat (makes filename completion much faster).
Diffstat (limited to 'src')
-rw-r--r--src/dired.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/dired.c b/src/dired.c
index 29027718da4..9767f6289c1 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -295,6 +295,19 @@ file_name_completion (file, dirname, all_flag, ver_flag)
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 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
310
298#ifdef VMS 311#ifdef VMS
299 extern DIRENTRY * readdirver (); 312 extern DIRENTRY * readdirver ();
300 313
@@ -496,6 +509,12 @@ file_name_completion (file, dirname, all_flag, ver_flag)
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)