Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!sunybcs!planck!talon!wiles From: wiles@talon.uucp (Dale Wiles) Newsgroups: gnu.emacs Subject: Re: fundamental-mode for .c files Keywords: c-mode Message-ID: <1989Nov13.220320.15073@planck.uucp> Date: 13 Nov 89 22:03:20 GMT References: <5582@ogccse.ogc.edu> Sender: news@planck.uucp (Usenet News) Reply-To: wiles@talon.UUCP (Dale Wiles) Distribution: usa Organization: Calspan Corporation ATC Buffalo, NY Lines: 45 In article <5582@ogccse.ogc.edu> scottb@ogccse.ogc.edu (Scott Baker) writes: >I prefer to use fundamental-mode when editing .c files. > [Stuff deleted] >Anyone help me out. This is what I use: -------------------------Chop----------------------------------------- ; ;rm-auto-mode is a function to remove all the elements from ;auto-mode-alist that have the regexp 'old-mode as their car. This ;isn't needed, but it's nice house keeping. ; (defun rm-auto-mode (old-mode) "Return all elements that don't have a car of OLD-MODE from auto-mode-alist" (let ((new-list ()) (copy-list auto-mode-alist)) (while copy-list (if (not (string= (car (car copy-list)) old-mode)) (setq new-list (append new-list (list (car copy-list))))) (setq copy-list (cdr copy-list))) new-list)) ; ;Get rid of the old auto-mode for .c files. ; (setq auto-mode-alist (rm-auto-mode "\\.c$")) ; ;Set a new default mode for .c files. ;(In this case fundamental-mode) ; (setq auto-mode-alist (cons (cons '"\\.c$" 'fundamental-mode) auto-mode-alist)) --------------------------Chop---------------------------------------- This has the advantage of leaving all your other special modes intact. Enjoy. Fundamental Dale. Reply to: ...!{watmath,boulder,decvax,rutgers}!sunybcs!planck!hercules!wiles *Disclaimer: Anyone who's opinion is changed by a *Looks more (bonk) *disclaimer should be shot. If I said it, I meant *like a sick-e-more (bonk) *it, or else you were too stupid to get the joke! *to me. Yogi the Space Bear.