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: Re: Problems with latest CVS. Date: Tue, 17 Feb 2004 10:47:31 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200402171647.i1HGlVm11638@raven.dms.auburn.edu> References: <200402162237.i1GMbYh08219@raven.dms.auburn.edu> <200402162247.i1GMlin08356@raven.dms.auburn.edu> <200402162255.i1GMtis08363@raven.dms.auburn.edu> <200402170249.i1H2nIv09314@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1077036698 17744 80.91.224.253 (17 Feb 2004 16:51:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Feb 2004 16:51:38 +0000 (UTC) Cc: "Jari Aalto+mail.linux" , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Feb 17 17:51:25 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 1At8RQ-00034X-00 for ; Tue, 17 Feb 2004 17:51:24 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1At8RQ-0003T8-00 for ; Tue, 17 Feb 2004 17:51:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1At8Ql-0005j0-4i for emacs-devel@quimby.gnus.org; Tue, 17 Feb 2004 11:50:43 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1At8PC-0005Jr-4h for emacs-devel@gnu.org; Tue, 17 Feb 2004 11:49:06 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1At8Ob-0004zb-KO for emacs-devel@gnu.org; Tue, 17 Feb 2004 11:49:02 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1At8O9-0004aB-Ng for emacs-devel@gnu.org; Tue, 17 Feb 2004 11:48:01 -0500 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 i1HGlvKt002735; Tue, 17 Feb 2004 10:47:57 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i1HGlVm11638; Tue, 17 Feb 2004 10:47:31 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: eliz@elta.co.il In-reply-to: (message from Eli Zaretskii on 17 Feb 2004 08:43:54 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 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:20022 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20022 Eli Zaretskii wrote: At Richard's request, I installed yesterday several changes in autorevert.el, perhaps some of them cause these problems. Yes they do cause the problems. I installed a fix for the more urgent part of the problem yesterday. The patch below seems to fix the second part of the problem. Because the remaining problem only occurs if `global-auto-revert-non-file-buffers' is non-nil and the default is nil, fixing the remaining part of the problem is less urgent. Hence, I will let people take a look at it before installing. I can install if desired. Note that part of the patch, namely checking (buffer-modified-p), is, in addition to the reasons already mentioned, also necessary to allow auto-reverting dired buffers to co-exist with commands such as dired-undo and the like. In my own testing, the patch seems to work well and no significant CPU-usage seems to occur, even after visiting tons of dired buffers. My dired-listing-switches's value is "-AltF" and without the patch, Emacs becomes essentially unusable (and chews up tons of CPU) if `global-auto-revert-non-file-buffers' is set to t. ===File ~/autorevert-diff=================================== *** autorevert.el.~1.21.~ Mon Feb 16 20:04:45 2004 --- autorevert.el Tue Feb 17 09:53:15 2004 *************** *** 283,312 **** (forward-line 1))) list)) - (defun auto-revert-dired-changed-p () - "Check if dired buffer has changed." - (when (and (stringp dired-directory) - ;; Exclude remote buffers, would be too slow for user - ;; modem, timeouts, network lag ... all is possible - (not (string-match "@" dired-directory)) - (file-directory-p dired-directory)) - (let ((files (directory-files dired-directory)) - (dired (auto-revert-dired-file-list))) - (or (not (eq (length files) (length dired))) - (auto-revert-list-diff files dired))))) - (defun auto-revert-buffer-p () "Check if current buffer should be reverted." ! ;; - Always include dired buffers to list. It would be too expensive ;; to test the "revert" status here each time timer launches. - ;; - Same for VC buffers. (or (and (eq major-mode 'dired-mode) (or (and global-auto-revert-mode global-auto-revert-non-file-buffers) ! auto-revert-mode)) ! (and (not (buffer-modified-p)) (auto-revert-vc-buffer-p)) ! (and (not (buffer-modified-p)) (if (buffer-file-name) (and (file-readable-p (buffer-file-name)) (not (verify-visited-file-modtime (current-buffer)))) --- 283,314 ---- (forward-line 1))) list)) (defun auto-revert-buffer-p () "Check if current buffer should be reverted." ! ;; - Always include VC buffers to list. It would be too expensive ;; to test the "revert" status here each time timer launches. (or (and (eq major-mode 'dired-mode) (or (and global-auto-revert-mode global-auto-revert-non-file-buffers) ! auto-revert-mode) ! (not (buffer-modified-p)) ! (stringp dired-directory) ! ;; Exclude remote buffers, would be too slow for user ! ;; modem, timeouts, network lag ... all is possible ! (not (string-match "@" dired-directory)) ! (file-directory-p dired-directory) ! (file-readable-p dired-directory) ! (not (let ((attributes (file-attributes dired-directory)) ! (modtime (visited-file-modtime))) ! (or (eq modtime 0) ! (not (eq (car attributes) t)) ! (and (= (car (nth 5 attributes)) (car modtime)) ! (= (nth 1 (nth 5 attributes)) (cdr modtime))))))) ! (and (not (eq major-mode 'dired-mode)) ! (not (buffer-modified-p)) (auto-revert-vc-buffer-p)) ! (and (not (eq major-mode 'dired-mode)) ! (not (buffer-modified-p)) (if (buffer-file-name) (and (file-readable-p (buffer-file-name)) (not (verify-visited-file-modtime (current-buffer)))) *************** *** 375,382 **** (cond ((eq major-mode 'dired-mode) ;; Dired includes revert-buffer-function ! (when (and revert-buffer-function ! (auto-revert-dired-changed-p)) (setq revert t))) ((auto-revert-vc-buffer-p) (when (auto-revert-handler-vc) --- 377,383 ---- (cond ((eq major-mode 'dired-mode) ;; Dired includes revert-buffer-function ! (when revert-buffer-function (setq revert t))) ((auto-revert-vc-buffer-p) (when (auto-revert-handler-vc) ============================================================