Combining mode and encoding in emacs

John Lenton john at grulic.org.ar
Fri Sep 3 19:03:22 CEST 2004


On Fri, Sep 03, 2004 at 04:30:33PM +0000, Magnus Lie Hetland wrote:
> 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.)

what I do is

   # -*- python -*- coding: iso-8859-1 -*-

-- 
John Lenton (john at grulic.org.ar) -- Random fortune:
La sociedad moderna olvida que el mundo no es propiedad de una única
generación.
		-- Oskar Kokoshka. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20040903/dfa44947/attachment.sig>


More information about the Python-list mailing list