From: Mike H <hspnew@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: How to associate more than two file-types as C code, code included
Date: Mon, 3 Dec 2007 14:50:46 -0800 (PST) [thread overview]
Message-ID: <c05308e4-16cc-41fd-960e-c9055cc63ea0@x69g2000hsx.googlegroups.com> (raw)
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)
next reply other threads:[~2007-12-03 22:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 22:50 Mike H [this message]
2007-12-03 23:56 ` How to associate more than two file-types as C code, code included 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
[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=c05308e4-16cc-41fd-960e-c9055cc63ea0@x69g2000hsx.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.