[Zope] Emacs, ange-ftp, zope ftp serv, auto mode loading and font-lock-mode

Jason Earl jason.earl@simplot.com
20 Dec 2001 10:37:49 -0700


Chances are good that Zope isn't giving Emacs enough of a clue as to
what kind of file you are editting.  Emacs either needs a '.'
extension that it recognizes or the file needs to contain comments
that Emacs understand.  You could manually enter the mode that you
want when you first read the file (M-x html-mode for example) or you
can do what I do.

My DTML files have the following text in the first line:

<dtml-comment> -*- mode: dtml; dtml-top-element: "body" -*- </dtml-comment>

This automatically puts Emacs in dtml-mode, which is a Zope-ified
version of html-mode.  If you wanted normal html-mode (or
html-helper-mode) you would need to modify the line like so.

<dtml-comment> -*- mode: html -*- </dtml-comment>

Python Scripts and ZSQL methods can also be modified with Emacs, but
they are a little tricker, in that it is probably not a good idea to
modify their headers.  That's okay though, Emacs also looks at the
bottom of a file for clues as to what sort of mode to use.  Here are
some examples from my Python Scripts and ZSQL methods (respectively).

Python scripts have this at the bottom:

# Local Variables:
# mode:python
# End:

and ZSQL methods have this:

-- Local Variables:
-- mode:sql
-- End:

Yes, this does make all of my Python Scripts and ZSQL methods 3 lines
longer than they have to be, but I am too lazy to type M-x sql-mode
every time I want to edit a ZSQL method.

By the way, being able to edit Zope objects in Emacs transparently is
almost certainly my favorite Zope feature.  Python is cool, XML-RPC is
interesting, Acquisition is useful, but being able to hack the whole
thing with Emacs via FTP is priceless.

Jason

"Azboklin Lirik" <azbok@hotmail.com> writes:

> Ok, I have emacs21 and auto mode loading all set up with python,
> html and sql files.
>=20
> I can load files off my local file system and it auto loads the
> correct mode and fontifies the buffer.
>=20
> =A0
>=20
> Also, I can use ange-ftp with regular ftp sites and it also auto
> loads the mode and fontifies.
>=20
> =A0
>=20
> BUT, when I access my local=A0zope ftp server and load the files, it
> does not auto load the mode and fontify.=A0 This is very very strange
> indeed!
>=20
> =A0
>=20
> Does anyone out there have auto mode loading working with the zope
> ftp server?
>=20
> =A0
>=20
> Thank you
>=20
> Azbok
>=20
> =A0
>=20
>=20
> -------------------------------------------------------------------------=
------
>=20
> Send and receive Hotmail on your mobile device: Click Here
> _______________________________________________ Zope maillist - Zope@zope=
.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML =
encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-a=
nnounce http://lists.zope.org/mailman/listinfo/zope-dev )=20