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

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

Re: auto-revert-mode


From: Deniz Dogan
Subject: Re: auto-revert-mode
Date: Wed, 15 Sep 2010 07:00:03 +0200

2010/9/15 Thamer Mahmoud <address@hidden>:
> Oleksandr Gavenko <address@hidden> writes:
>
>> Thamer Mahmoud wrote:
>>> Here is another solution:
>>>
>>> (add-to-list 'auto-mode-alist             '("\\.foo\\'" (lambda ()
>>> (auto-revert-mode 1)) t))
> [...]
>>
>> So if for your .foo extension desired some major mode
>> you may hid it by minor mode!
>
> Yes, you're right. I used the code above for an extension that Emacs
> doesn't yet know about (with no major-mode, and no major-mode
> hook). However, it's possible to set both the major and minor mode for
> one extension using the following:
>
> (add-to-list 'auto-mode-alist
>             '("\\.foo\\'" . (lambda () (c-mode) (auto-revert-mode 1))))
>
> Perhaps it would be useful if Emacs had an `auto-minor-mode-alist'
> variable, i.e., a list of minor modes that are enabled based on file
> name without bothering with major modes.
>

I think that any respectable major mode should provide an appropriable
foo-mode-hook instead.

-- 
Deniz Dogan



reply via email to

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