Combining mode and encoding in emacs

Magnus Lie Hetland mlh at furu.idi.ntnu.no
Fri Sep 3 12:30:33 EDT 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
least):

  #!/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
http://hetland.org      bread!" [from a can in Spongebob Squarepants]



More information about the Python-list mailing list