emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autorevert.el


From: Luc Teirlinck
Subject: Re: autorevert.el
Date: Thu, 25 Mar 2004 00:49:18 -0600 (CST)

The following appears to be better than my original patch (stylistic
improvement, not bug fix):

===File ~/dired-diff========================================
diff -c /home/teirllm/dired.old.el /home/teirllm/emacscvsdir/emacs/lisp/dired.el
*** /home/teirllm/dired.old.el  Wed Mar 24 22:07:09 2004
--- /home/teirllm/emacscvsdir/emacs/lisp/dired.el       Thu Mar 25 00:39:40 2004
***************
*** 525,530 ****
--- 525,538 ----
        (setq dir-or-list dirname))
      (dired-internal-noselect dir-or-list switches)))
  
+ (defvar dired-directory-size nil
+   "Internal variable used by dired on certain operating systems.
+ On ms-dos, the value is the sum of all file lenghts in the directory.
+ On other operating systems, the value may have a different meaning
+ or be meaningless.")
+ 
+ (put 'dired-directory-size 'permanent-local t)
+ 
  ;; The following is an internal dired function.  It returns non-nil if
  ;; the directory visited by the current dired buffer has changed on
  ;; disk.  DIRNAME should be the directory name of that directory.
***************
*** 534,540 ****
         (or (eq modtime 0)
             (not (eq (car attributes) t))
             (and (= (car (nth 5 attributes)) (car modtime))
!                 (= (nth 1 (nth 5 attributes)) (cdr modtime)))))))
  
  (defun dired-buffer-stale-p (&optional noconfirm)
    "Return non-nil if current dired buffer needs updating.
--- 542,552 ----
         (or (eq modtime 0)
             (not (eq (car attributes) t))
             (and (= (car (nth 5 attributes)) (car modtime))
!                 (= (nth 1 (nth 5 attributes)) (cdr modtime))
!                 (if (eq system-type 'ms-dos)
!                     ;; This does not work perfectly.
!                     (= dired-directory-size (nth 7 attributes))
!                   t))))))
  
  (defun dired-buffer-stale-p (&optional noconfirm)
    "Return non-nil if current dired buffer needs updating.
***************
*** 678,685 ****
        (set (make-local-variable 'dired-subdir-alist) nil)
        (dired-build-subdir-alist)
        (let ((attributes (file-attributes dirname)))
!       (if (eq (car attributes) t)
!           (set-visited-file-modtime (nth 5 attributes))))
        (set-buffer-modified-p nil)
        ;; No need to narrow since the whole buffer contains just
        ;; dired-readin's output, nothing else.  The hook can
--- 690,699 ----
        (set (make-local-variable 'dired-subdir-alist) nil)
        (dired-build-subdir-alist)
        (let ((attributes (file-attributes dirname)))
!       (when (eq (car attributes) t)
!         (set-visited-file-modtime (nth 5 attributes))
!         (set (make-local-variable 'dired-directory-size)
!              (nth 7 attributes))))
        (set-buffer-modified-p nil)
        ;; No need to narrow since the whole buffer contains just
        ;; dired-readin's output, nothing else.  The hook can

Diff finished.  Thu Mar 25 00:40:04 2004
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]