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

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

Re: auto-revert-mode


From: Thamer Mahmoud
Subject: Re: auto-revert-mode
Date: Wed, 15 Sep 2010 01:54:20 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Oleksandr Gavenko <gavenkoa@gmail.com> 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.

-- 
Thamer




reply via email to

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