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

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

Re: how to enable syntax highlighting for some shell script files?


From: Kevin Rodgers
Subject: Re: how to enable syntax highlighting for some shell script files?
Date: Tue, 11 May 2010 06:37:38 -0600
User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228)

Yuliang Wang wrote:
Isn't there a way for emacs to automatically detect file types, other than add comment in each file or add items in .emacs one by one?

Not really, unless each file has the same syntax (see below).

Vim auto detects .inputrc, but emacs doesn't. Vim doesn't auto detect .xinitrc, but emacs does. Funny.

That's just because they have special statements to recognize those file names
in their source code that someone contributed.

...
    2. Configure the variable auto-mode-alist. For example, you could do
    this
      (add-to-list 'auto-mode-alist '("\\.inputrc\\'" . conf-mode))

(add-to-list 'auto-mode-alist '("/\\..*rc\\'" . conf-mode))

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

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