Combining mode and encoding in emacs

Magnus Lie Hetland mlh at
Fri Sep 3 18:30:33 CEST 2004

If I want to specify both mode and source encoding using the

  -*- FOO -*-

syntax in emacs -- how can I do that? Both insist on being on the
second line of the file, yet I have found no way of combining them.
That is, the following doesn't work properly (not in all emaxen, at

  #!/usr/bin/env python
  # -*- encoding: iso-8859-1 -*-
  # -*- python -*-

If I switch the two, Python doesn't get the encoding. (I need to
specify the mode, because the file has a '.cgi' ending.)

Any tips?

Magnus Lie Hetland     "Canned Bread: The greatest thing since sliced      bread!" [from a can in Spongebob Squarepants]

More information about the Python-list mailing list