Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!umix!nrl-cmf!cmcl2!rutgers!topaz.rutgers.edu!steiner From: steiner@topaz.rutgers.edu (Dave Steiner) Newsgroups: comp.emacs Subject: Re: Appending the new stuff to the auto-mode-alist Message-ID: <16706@topaz.rutgers.edu> Date: Tue, 24-Nov-87 23:10:11 EST Article-I.D.: topaz.16706 Posted: Tue Nov 24 23:10:11 1987 Date-Received: Sat, 28-Nov-87 15:51:04 EST References: <414@slb-sdr.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 20 Keywords: append, init file To: saito@slb-sdr.UUCP Cc: steiner We have the following defined in our site-init.el file: (defun fix-auto-mode-alist (file-name-pattern major-mode-function) "Searches auto-mode-alist for a cons pair with FILE-NAME-PATTERN as its car. If found, MAJOR-MODE-FUNCTION is rplacd in place. If not found, (FILE-NAME-PATTERN . MAJOR-MODE-FUNCTION) is added to auto-mode-alist." (interactive "sFile name pattern (regexp): \nSMajor mode function: \n") (let ((temp (assoc file-name-pattern auto-mode-alist))) (if temp (setq auto-mode-alist (nconc (list (cons file-name-pattern major-mode-function)) auto-mode-alist)) (setq auto-mode-alist (nconc auto-mode-alist (list (cons file-name-pattern major-mode-function))))))) -- arpa: Steiner@TOPAZ.RUTGERS.EDU uucp: ...{ames, cbosgd, harvard, moss}!rutgers!topaz.rutgers.edu!steiner