For my or your future reference, the format for the magic comment at the beginning of a file that tells emacs what mode to use: http://www.gnu.org/software/emacs/manual/html_node/Choosing-Modes.html This being lately because prolog files with the extention ".pl" are interpreted as ( sigh ) perl scripts.