Hey Emacs

From Wikipedia, the free encyclopedia

"Hey Emacs" is a line that is placed into text files to indicate to the Emacs and XEmacs text editors what mode to use when editing the file.

The "hey emacs" line is of the form <arbitrary text> -*- <mode name> -*- <arbitrary text>. Often the line begins with the comment indicator for the language the file is written in, followed by the words "Hey Emacs, this is a", and ends with the word "file." For example, a Lisp programmer might use the following "hey emacs" line (the semicolon is the Lisp comment character):

;Hey, Emacs! This is a -*- Lisp -*- file!

The words "Hey, Emacs" have no particular significance and serve only to explain the purpose of the line to non-Emacs users. Only the text between the -*- tokens is interpreted by the editor.

Languages