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

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

Re: Emacs . How can I associate *.cu files as cc mode as a default ?


From: Tyler Smith
Subject: Re: Emacs . How can I associate *.cu files as cc mode as a default ?
Date: 19 Sep 2007 17:55:16 GMT
User-agent: slrn/0.9.8.1pl1 (Debian)

On 2007-09-19, Gordon Beaton <address@hidden> wrote:
> On 19 Sep 2007 15:47:19 GMT, Tyler Smith wrote:
>> (add-hook 'find-file-hook 'my-find-file-hook)
>>
>
> If you want to do this for all files of that type, then c-mode-hook is
> a better place to put the function, which doesn't need to check the
> filename:
>
>   (add-hook 'c-mode-hook (lambda() (setq c-basic-offset 4)))

Thanks for the suggestion, but this is something I want to use only on 
files for this particular project, not all c code. 

>
> Alternatively, use file variables to save settings specific to that
> file in the file itself. Put a comment like this one near the end of
> the file:
>
>   /*
>    * Local Variables:
>    * mode:c
>    * c-basic-offset: 4
>    * End:
>    */
>

Another good suggestion, and maybe the best alternative to my 
find-file-hook. Is there something in particular that is bad about 
find-file-hook, or is it just because there are better options to use 
that I should avoid it?

Thanks!

Tyler


reply via email to

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