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

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

Re: Forcing a mode


From: Will Parsons
Subject: Re: Forcing a mode
Date: 31 Aug 2006 21:11:13 GMT
User-agent: slrn/0.9.8.1 (Debian)

Phillip Lord wrote:
>>>>>> "AB" == Aaron Bingham <bingham@cenix-bioscience.com> writes:
>
>  AB> CloudStrife wrote:
>
>  >> I have some tcl files that donot have .tcl extension in file
>  >> name. So when i open them in emacs the tcl mode is not turned
>  >> on. can i enforce this onto the file.
>  >> 
[snip]

> I think he wants this to happen automatically. 
>
> You can do this with file variables. Sticking
>
>
> ;; -*- mode: tcl -*-  
>
> as the first line of the file should work. 

I've always used:

   #-*-tcl-*-

Is there any reason the longer form with "mode: " should be preferred?

> Or 
>
> ;; Local Variables: ***
> ;; mode: tcl ***
>
> at the end should work. You can replace ";;" with what ever tcl uses
> as a comment. 

I didn't know about that one.

(Note that Tcl scripts typically begin something like:

   #!/bin/sh
   # ....
   # \
   exec tclsh "$0" ${1+"$@"}

so Emacs cannot deduce the mode from the shebang.)

- Will


reply via email to

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