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

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

Re: How to associate more than two file-types as C code, code included


From: Mike H
Subject: Re: How to associate more than two file-types as C code, code included
Date: Tue, 4 Dec 2007 09:27:45 -0800 (PST)
User-agent: G2/1.0

On 12월3일, 오후6시56분, "Lennart Borgman (gmail)"
<address@hidden> wrote:
> Mike H wrote:
> > I want the files .cu and .txx to be recognized as C files..
> > One block of the following codes works separately, but when I put them
> > together.. it doesn't work.
>
> > How should I do it ?
>
> > when ((string-match "\\.cu$" fn) || (string-match "\\.txx$" fn))
>
> > will something like above work? i tried, and it doesn't...
>
> > Thanks..
>
> > (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)
>
> > (defun my-find-file-hook()
> >   (let ((fn (buffer-file-name)))
> >     (when (string-match "\\.txx$" fn)
> >       (c-mode))))
> > (add-hook 'find-file-hooks 'my-find-file-hook)
>
> A much more easy way to do it is to use auto-mode-alist, do
>
>    M-x (info "(emacs) Choosing Modes") RET
>
> in Emacs for info.- 따온 텍스트 숨기기 -
>
> - 따온 텍스트 보기 -

Thanks!


reply via email to

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