From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike H Newsgroups: gmane.emacs.help Subject: How to associate more than two file-types as C code, code included Date: Mon, 3 Dec 2007 14:50:46 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196725237 10062 80.91.229.12 (3 Dec 2007 23:40:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2007 23:40:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 04 00:40:45 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IzKu5-0003bw-7L for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Dec 2007 00:40:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzKto-0008WQ-MP for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Dec 2007 18:40:28 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!x69g2000hsx.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 143.215.128.56 Original-X-Trace: posting.google.com 1196722246 4639 127.0.0.1 (3 Dec 2007 22:50:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 3 Dec 2007 22:50:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x69g2000hsx.googlegroups.com; posting-host=143.215.128.56; posting-account=X0wLfwoAAACMUj0bN175vFl3ydbOJBp5 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7,gzip(gfe),gzip(gfe) Content-Disposition: inline Original-Xref: shelby.stanford.edu gnu.emacs.help:154371 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49797 Archived-At: 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)