[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: |
Gordon Beaton |
Subject: |
Re: Emacs . How can I associate *.cu files as cc mode as a default ? |
Date: |
19 Sep 2007 06:24:39 GMT |
User-agent: |
slrn/0.9.8.1pl1 (Linux) |
On 19 Sep 2007 00:28:09 GMT, Tyler Smith wrote:
> This function will do that:
>
> (defun my-find-file-hook()
> (let ((fn (buffer-file-name)))
> (when (string-match "\\.cu$" fn)
> (cc-mode))))
>
> You have to tell Emacs to run this function every time you open a new
> file, so you add the hook:
>
> (add-hook 'find-file-hooks 'my-find-file-hook)
No need for the function. Just add the extension to auto-mode-alist:
(add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
/gordon
--
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, (continued)
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Mike H, 2007/09/18
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Tyler Smith, 2007/09/18
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Mike H, 2007/09/18
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Richard G Riley, 2007/09/19
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Tyler Smith, 2007/09/19
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Gordon Beaton, 2007/09/19
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Tyler Smith, 2007/09/19
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Lowell Gilbert, 2007/09/19
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Stefan Monnier, 2007/09/19
- Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Tyler Smith, 2007/09/20
Re: Emacs . How can I associate *.cu files as cc mode as a default ?,
Gordon Beaton <=