Path: utzoo!attcan!uunet!husc6!rutgers!njin!princeton!phoenix!ghh From: ghh@thought.princeton.edu (Gilbert Harman) Newsgroups: comp.emacs Subject: mode by file contents Message-ID: Date: 25 Jan 89 16:03:26 GMT Sender: news@phoenix.Princeton.EDU Organization: Princeton University Cognitive Science Lab Lines: 16 I would like to put something in my .emacs that would determine the major mode of a buffer on the basis of the contents of the file read into the buffer rather than on the basis of something about the name of the file. For example, if the file began with "\documentstyle... " the buffer would be automatically put into latex mode. Any suggestions about how to do this would be greatly appreciated. -- Gilbert Harman Princeton University Cognitive Science Laboratory 221 Nassau Street, Princeton, NJ 08542 ghh@princeton.edu HARMAN@PUCC.BITNET