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

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

Re: auto-revert-mode


From: Andreas Politz
Subject: Re: auto-revert-mode
Date: Wed, 08 Dec 2010 15:28:38 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> (add-to-list
>>>> 'find-file-hook
>>>> (lambda nil
>>>> (when (equal (file-name-extension (buffer-file-name)) "log")
>>>> (auto-revert-mode 1) ;; or (auto-revert-tail-mode 1) !!
>>>> )))
>>>>
>>>> I don't know more efficient way to do this.
>>>>
>>>
>>> Here is another solution:
>>>
>>> (add-to-list 'auto-mode-alist
>>> '("\\.foo\\'" (lambda () (auto-revert-mode 1)) t))
>
> In Emacs-24 you'll be able to just say
>
>    (add-to-list 'auto-mode-alist '("\\.foo\\'" auto-revert-mode t))
>
>> With the sideeffect of inhibiting the proper major-mode for .foo files.
>> Maybe this calls for another variable `auto-minor-mode-alist'.
>
> No, the t he put at the end tells Emacs to keep looking for a major mode

But with the extension removed.  At least that's how the 3rd value is
explained in the documentation.

-ap


reply via email to

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