From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: auto-revert-mode and tramp file handlers Date: Sun, 9 May 2004 12:34:27 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200405091734.i49HYRM01844@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1084124379 6385 80.91.224.253 (9 May 2004 17:39:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 May 2004 17:39:39 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 09 19:39:30 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BMsGw-000365-00 for ; Sun, 09 May 2004 19:39:30 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BMsGw-00084n-00 for ; Sun, 09 May 2004 19:39:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BMsGV-0007Hu-Ri for emacs-devel@quimby.gnus.org; Sun, 09 May 2004 13:39:03 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.33) id 1BMsGP-0007Bc-Mk for emacs-devel@gnu.org; Sun, 09 May 2004 13:38:57 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.33) id 1BMsFr-0006Ol-Fz for emacs-devel@gnu.org; Sun, 09 May 2004 13:38:54 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BMsFh-00066R-6N for emacs-devel@gnu.org; Sun, 09 May 2004 13:38:13 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i49HcBTS010281; Sun, 9 May 2004 12:38:11 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i49HYRM01844; Sun, 9 May 2004 12:34:27 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: kai@emptydomain.de X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22981 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22981 >>From one of my earlier messages: I do not know whether the following problem is connected to the update or not. Visit a file using the /ssh:USER@HOST:FILENAME syntax. When the file is displayed, close your connection. Obviously, now tramp is not going to be able to function normally anymore. But what happens is that Emacs now appears to freeze. It does not even respond to C-g anymore, and I had to kill it from the command line. Is this really unavoidable? Closing one's connection forgetting that one has active trap buffers _is_ sometimes going to happen, so the behavior is a nuisance. The above only happens when auto-revert-mode is enabled. (Again, sorry for forgetting to double check using emacs -q). A problem is that tramp seems to handle functions like file-exists-p and file-readable-p by trying to connect for 60 seconds and then throwing an error if the connection has been closed. I believe that both functions strictly speaking should return nil in the given situation. In the case of file-exists-p that is because it is impossible to figure out the file's attributes. From the Elisp manual: -- Function: file-exists-p filename This function returns `t' if a file named FILENAME appears to exist. This does not mean you can necessarily read the file, only that you can find out its attributes. If there is no way to quickly check whether the connection has been closed, and if so, return nil instead of throwing an error, then I believe that maybe we should just disable auto-reverting for remote files. (This is trivial, using `file-remote-p'.) I believe that at the very least there should be an option to disable auto-reverting for remote files, because it can be very costly for people with slow connections. Sincerely, Luc.