From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tramp with global-auto-revert-mode. Date: 14 May 2004 00:16:49 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87pt973b7y.fsf-monnier+emacs@gnu.org> References: <200405122254.i4CMsUj29445@raven.dms.auburn.edu> <200405122326.i4CNQk929511@raven.dms.auburn.edu> <200405132324.i4DNOBs14811@raven.dms.auburn.edu> <200405140008.i4E08lb14858@raven.dms.auburn.edu> <871xln4xmc.fsf-monnier+emacs@gnu.org> <200405140132.i4E1WaH15085@raven.dms.auburn.edu> <87vfiz3fez.fsf-monnier+emacs@gnu.org> <200405140308.i4E38b415540@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084508845 14840 80.91.224.253 (14 May 2004 04:27:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 May 2004 04:27:25 +0000 (UTC) Cc: kai@emptydomain.de, storm@cua.dk, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 14 06:27:12 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 1BOUHv-0002Pl-00 for ; Fri, 14 May 2004 06:27:11 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOUHv-00024d-00 for ; Fri, 14 May 2004 06:27:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOUAb-0007vK-LR for emacs-devel@quimby.gnus.org; Fri, 14 May 2004 00:19:37 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BOUAX-0007v8-IB for emacs-devel@gnu.org; Fri, 14 May 2004 00:19:33 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BOUA1-0007r8-N6 for emacs-devel@gnu.org; Fri, 14 May 2004 00:19:32 -0400 Original-Received: from [209.226.175.188] (helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOU7y-0007WO-HM for emacs-devel@gnu.org; Fri, 14 May 2004 00:16:54 -0400 Original-Received: from alfajor ([67.68.218.161]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040514041652.ZIWF17358.tomts25-srv.bellnexxia.net@alfajor>; Fri, 14 May 2004 00:16:52 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id A1C4BD74FF; Fri, 14 May 2004 00:16:49 -0400 (EDT) Original-To: Luc Teirlinck In-Reply-To: <200405140308.i4E38b415540@raven.dms.auburn.edu> Original-Lines: 64 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:23378 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23378 > I believe that the freezes are not an Emacs or Tramp bug, but the > inevitable result of a slow connection. Hence we need a user option > to deal with them. If C-g does not get you out of the hang, it's a bug. As I said, the with-local-quit should be put in Tramp. You might be right that auto-reverting remote files needs to be turned off or customizable, but the problems you're experiencing could also be triggered by other packages than auto-revert, so we should fix them. Among all the problems, one of them is actually in autorevert.el: the auto-revert timer should not be re-run if it hasn't finished running yet. One way to do that is to not use a repeating timer, but instead to reset the timer manually at the end of auto-revert-buffers. Another is to bind auto-revert-running to t in auto-revert-buffers and check it before running, as in the patch below. A third option is to do this kind of re-entrance-check directly in the C code. Stefan --- orig/lisp/autorevert.el +++ mod/lisp/autorevert.el @@ -1,6 +1,6 @@ ;;; autorevert.el --- revert buffers when files on disk change -;; Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1997, 98, 1999, 2001, 2004 Free Software Foundation, Inc. ;; Author: Anders Lindgren ;; Keywords: convenience @@ -343,7 +343,7 @@ ;; do want to reset the mode for VC, so we do it manually. (when (or revert auto-revert-check-vc-info) (vc-find-file-hook))))) - +(defvar auto-revert-running nil) (defun auto-revert-buffers () "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. @@ -367,9 +367,13 @@ This function is also responsible for removing buffers no longer in Auto-Revert mode from `auto-revert-buffer-list', and for canceling the timer when no buffers need to be checked." + (if auto-revert-running + ;; Don't re-run if we're not finished executing the previous run. + nil (let ((bufs (if global-auto-revert-mode (buffer-list) auto-revert-buffer-list)) + (auto-revert-running t) (remaining '()) (new '())) ;; Partition `bufs' into two halves depending on whether or not @@ -405,7 +409,7 @@ (when (and (not global-auto-revert-mode) (null auto-revert-buffer-list)) (cancel-timer auto-revert-timer) - (setq auto-revert-timer nil)))) + (setq auto-revert-timer nil))))) ;; The end: