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: Richard G Riley
Subject: Re: Emacs . How can I associate *.cu files as cc mode as a default ?
Date: Wed, 19 Sep 2007 17:13:22 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50.6 (gnu/linux)

Mike H <hspnew@gmail.com> writes:

> On Sep 18, 10:01 pm, Tyler Smith <tyler.sm...@mail.mcgill.ca> wrote:
>> On 2007-09-19, Mike H <hsp...@gmail.com> wrote:
>>
>> > Just one thing ,
>>
>> > When I put those scripts in, and when I open *.cu files,
>> > I get the following...
>>
>> > Symbol's function definition is void
>>
>> It should be (c-mode), not (cc-mode). The following works for
>> me:
>>
>> (defun my-find-file-hook()
>>   (let ((fn (buffer-file-name)))
>>     (when (string-match "\\.cu$" fn)
>>       (c-mode))))
>> (add-hook 'find-file-hooks 'my-find-file-hook)
>>
>> Tyler
>
>
> Thanks a lot !! it works now

See the other reply. It is a better way:

      (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))

find-file-hooks is obsolete in newer versions of emacs.


reply via email to

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