help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: automatic dired update


From: Andreas Politz
Subject: Re: automatic dired update
Date: Tue, 06 Jan 2009 17:47:49 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)


d_zman@hotmail.com wrote:
> If I add this to my lisp scripts called out in .emacs it doesn't
> work.  If I load your lisp script by itself, it does.  How can I have
> it load with my other lisp scipts, is there line I can add to
> my .emacs file?
>

I don't know why it's not working, but as someone mentioned in this
thread I was reinventing wheels. Use auto-revert-mode instead :

(add-to-list 'dired-mode-hook 'auto-revert-mode)

-ap

>> (defun maybe-revert-dired-buffers ()
>>    (walk-windows
>>     #'(lambda (win)
>>         (with-selected-window win
>>           (when (eq major-mode 'dired-mode)
>>             (let ((mod (gethash default-directory 
dired-file-modification-hash)))
>>               (unless (and mod
>>                            (equal mod (nth 5 (file-attributes 
default-directory))))
>>                 (setq mod (nth 5 (file-attributes default-directory)))
>>                 (puthash default-directory mod dired-file-modification-hash)
>>                 (dired-revert))))))
>>     'no-mini 'all-frames))
>>
>> (run-with-idle-timer 1 t 'maybe-revert-dired-buffers)
>>
>> This is polling the filesystem, plus I don't know if it is working
>> on win32.
>>
>> -ap- Hide quoted text -
>>
>> - Show quoted text -
>
>



reply via email to

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