unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to associate more than two file-types as C code, code included
@ 2007-12-03 22:50 Mike H
  2007-12-03 23:56 ` Lennart Borgman (gmail)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mike H @ 2007-12-03 22:50 UTC (permalink / raw)
  To: help-gnu-emacs

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-04 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [not found] ` <mailman.4488.1196773183.18990.help-gnu-emacs@gnu.org>
2007-12-04 17:27   ` Mike H

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).