Mercurial > emacs
comparison lisp/autorevert.el @ 53984:73f78af624f2
(auto-revert-dired-file-list): added missing variable `file' to `let'.
(top level): Byte compiler fixes: defvar `dired-directory' added,
autoload `dired-get-filename' added.
author | Eli Zaretskii <eliz@is.elta.co.il> |
---|---|
date | Mon, 16 Feb 2004 13:44:07 +0000 |
parents | 0bcb32954b6f |
children | 643f584fdd38 |
comparison
equal
deleted
inserted
replaced
53983:30f8a717bfdf | 53984:73f78af624f2 |
---|---|
68 ;;; Code: | 68 ;;; Code: |
69 | 69 |
70 ;; Dependencies: | 70 ;; Dependencies: |
71 | 71 |
72 (require 'timer) | 72 (require 'timer) |
73 (eval-when-compile (require 'cl)) | 73 (autoload 'dired-get-filename "dired") |
74 | |
75 (eval-when-compile | |
76 (defvar dired-directory) | |
77 (require 'cl)) | |
74 | 78 |
75 | 79 |
76 ;; Custom Group: | 80 ;; Custom Group: |
77 ;; | 81 ;; |
78 ;; The two modes will be placed next to Auto Save Mode under the | 82 ;; The two modes will be placed next to Auto Save Mode under the |
265 (if (not (string= elt1 elt2)) | 269 (if (not (string= elt1 elt2)) |
266 (throw 'break t))))))) | 270 (throw 'break t))))))) |
267 | 271 |
268 (defun auto-revert-dired-file-list () | 272 (defun auto-revert-dired-file-list () |
269 "Return list of dired files." | 273 "Return list of dired files." |
270 (let (list) | 274 (let (file list) |
271 (save-excursion | 275 (save-excursion |
272 (goto-char (point-min)) | 276 (goto-char (point-min)) |
273 (while (not (eobp)) | 277 (while (not (eobp)) |
274 (if (setq file (dired-get-filename t t)) | 278 (if (setq file (dired-get-filename t t)) |
275 (push file list)) | 279 (push file list)) |
294 ;; to test the "revert" status here each time timer launches. | 298 ;; to test the "revert" status here each time timer launches. |
295 (or (eq major-mode 'dired-mode) | 299 (or (eq major-mode 'dired-mode) |
296 (and (not (buffer-modified-p)) | 300 (and (not (buffer-modified-p)) |
297 (if (buffer-file-name) | 301 (if (buffer-file-name) |
298 (and (file-readable-p (buffer-file-name)) | 302 (and (file-readable-p (buffer-file-name)) |
299 (not (verify-visited-file-modtime buf))) | 303 (not (verify-visited-file-modtime (current-buffer)))) |
300 (and revert-buffer-function | 304 (and revert-buffer-function |
301 (or (and global-auto-revert-mode | 305 (or (and global-auto-revert-mode |
302 global-auto-revert-non-file-buffers) | 306 global-auto-revert-non-file-buffers) |
303 auto-revert-mode)))))) | 307 auto-revert-mode)))))) |
304 | 308 |