[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: |
20 Sep 2007 23:17:12 GMT |
User-agent: |
slrn/0.9.8.1pl1 (Debian) |
On 2007-09-19, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> Reading the manual, I see that find-file-hooks is now obsolete - will
>> find-file-hook be obsolete also?
>
> No: find-file-hooks is obsolete only because it was renamed to find-file-hook.
>
>> What should I replace the following
>> code with:
>
>> (defun my-find-file-hook()
>> (let ((fn (buffer-file-name)))
>> (when (string-match "latex2rtf" fn)
>> (set-variable 'tab-width 4))))
>> (add-hook 'find-file-hook 'my-find-file-hook)
>
> You can keep it as-is. Although I'd use (setq tab-width 4) instead of
> set-variable (set-variable is meant for interactive use, not that it matters
> in this case).
>
> Actually I'd probably do it that way instead:
>
> (defun my-latex2rtf-c-mode ()
> (c-mode)
> (setq tab-width 4))
>
> (add-to-list 'auto-mode-alist
> '("/latex2rtf/.*\\.c\\'" . my-latex2rtf-c-mode))
>
Actually, that's closer to what I really want. Thanks for the
suggestion! And to Lowell for your help too.
Cheers,
Tyler
- 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 ?, 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 <=
Re: Emacs . How can I associate *.cu files as cc mode as a default ?, Gordon Beaton, 2007/09/19