🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #8371

mode by file contents

#8371
From: Gilbert Harman
Date: Wed, 25 Jan 1989 16:03
16 lines
1001 bytes
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
Technical Details
Message-ID: <GHH.89Jan25110326@thought.princeton.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rutgers!njin!princeton!phoenix!ghh

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <GHH.89Jan25110326@thought.princeton.edu>
Date: 25 Jan 89 16:03:26 GMT
Sender: news@phoenix.Princeton.EDU
Organization: Princeton University Cognitive Science Lab
Lines: 16