> I looked at the code for directory-files, and it seems you cannot quit
> out of it while it is waiting in a system call.

Why is that?

> It is probably possible to implement quitting out of the system call
> in directory-files.  Doing this requires setting immediate_quit to 1,
> at least while that system call is running.

Looking at this code made me notice that the filename completion doesn't
handle the EAGAIN case like directory-files does.  And also that
directory-files doesn't check QUIT if it had been interrupted, which can
fail to react to C-g in cases such as SYNC_INPUT.
So I've installed the patch below.

> Which system call takes the long time?  Is it opendir, or readdir?

If the NFS server is down, I suspect that either call can stall.


        Stefan


--- dired.c     11 aoû 2005 05:27:35 -0400      1.117
+++ dired.c     14 aoû 2005 02:44:01 -0400      
@@ -224,7 +224,7 @@
 
 #ifdef EAGAIN
       if (dp == NULL && errno == EAGAIN)
-       continue;
+       { QUIT; continue; }
 #endif
 
       if (dp == NULL)
@@ -533,6 +533,10 @@
          dp = (*readfunc) (d);
 #else
          dp = readdir (d);
+#endif
+#ifdef EAGAIN
+         if (dp == NULL && errno == EAGAIN)
+           { QUIT; continue; }
 #endif
          if (!dp) break;
 


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to