all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tyler Smith <tyler.smith@mail.mcgill.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs . How can I associate *.cu files as cc mode as a default ?
Date: 20 Sep 2007 23:17:12 GMT	[thread overview]
Message-ID: <slrnff5vs9.162.tyler.smith@blackbart.mynetwork> (raw)
In-Reply-To: jwvps0e787p.fsf-monnier+gnu.emacs.help@gnu.org

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

  reply	other threads:[~2007-09-20 23:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19  0:10 Emacs . How can I associate *.cu files as cc mode as a default ? Mike H
2007-09-19  0:28 ` Tyler Smith
2007-09-19  1:09   ` Mike H
2007-09-19  1:25     ` Mike H
2007-09-19  2:01       ` Tyler Smith
2007-09-19  2:04         ` Mike H
2007-09-19 15:13           ` Richard G Riley
2007-09-19 15:47             ` Tyler Smith
2007-09-19 16:15               ` Gordon Beaton
2007-09-19 17:55                 ` Tyler Smith
2007-09-19 19:14                   ` Lowell Gilbert
2007-09-19 19:46               ` Stefan Monnier
2007-09-20 23:17                 ` Tyler Smith [this message]
2007-09-19  6:24   ` Gordon Beaton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrnff5vs9.162.tyler.smith@blackbart.mynetwork \
    --to=tyler.smith@mail.mcgill.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.