From: Mike H <hspnew@gmail.com>
To: help-gnu-emacs@gnu.org
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) [thread overview]
Message-ID: <d8460cdf-05f4-406f-a297-07ec7d87b87d@s12g2000prg.googlegroups.com> (raw)
In-Reply-To: mailman.4464.1196726225.18990.help-gnu-emacs@gnu.org
On 12월3일, 오후6시56분, "Lennart Borgman (gmail)"
<lennart.borg...@gmail.com> 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!
next prev parent reply other threads:[~2007-12-04 17:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 22:50 How to associate more than two file-types as C code, code included Mike H
2007-12-03 23:56 ` Lennart Borgman (gmail)
2007-12-04 12:59 ` Peter Dyballa
[not found] ` <mailman.4464.1196726225.18990.help-gnu-emacs@gnu.org>
2007-12-04 17:27 ` Mike H [this message]
[not found] ` <mailman.4488.1196773183.18990.help-gnu-emacs@gnu.org>
2007-12-04 17:27 ` Mike H
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=d8460cdf-05f4-406f-a297-07ec7d87b87d@s12g2000prg.googlegroups.com \
--to=hspnew@gmail.com \
--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.