Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!eagle.ukc.ac.uk!icdoc!tgould!iwm From: iwm@asun2.ic.ac.uk (Ian Moor) Newsgroups: comp.emacs Subject: Re: Adding to auto-mode-alist Message-ID: Date: 25 Oct 88 17:35:58 GMT References: <11520001@hpsmtc1.HP.COM> <25270@tut.cis.ohio-state.edu> Sender: news@doc.ic.ac.uk Organization: Dept. of Computing, Imperial College Lines: 28 In-reply-to: bob@allosaur.cis.ohio-state.edu's message of 20 Oct 88 20:39:41 GMT Posting-Front-End: GNU Emacs 18.45.3 of Fri Jun 26 1987 on asun2 (berkeley-unix) >>I would like to add another file type to the auto-mode-alist variable >>that invokes the text-mode, but I can't seem to get the syntax right. >There may be an easier, more elegant way, but this works for me, in my >.emacs file. Nothing here does text-mode, but you'll get the idea. (setq auto-mode-alist (append '( ("\\.1$" . nroff-mode) ("\\.2$" . nroff-mode) ("\\.3$" . nroff-mode) ("\\.4$" . nroff-mode) ("\\.5$" . nroff-mode) ("\\.6$" . nroff-mode) ("\\.7$" . nroff-mode) ("\\.8$" . nroff-mode) ("\\.man$" . nroff-mode) ("\\.me$" . nroff-mode) ("\\.mm$" . nroff-mode) ("\\.mr$" . nroff-mode) ("\\.ms$" . nroff-mode) ("\\.Z$" . z-mode) ) auto-mode-alist)) The thing that caught me is that you must load the file containing the mode definition or put it on your autoload list thus (autoload 'z-mode "z-mode" "Uncompress file" t) otherwise you get a strange complaint about file syntax.